Token导航 LogoToken导航TokenDH.com
Critical Heros logo
AI代理未说明官方级别未说明来源级核验

Critical Heros

MCP Server

一个基于Node.js的MCP服务器模板,支持多种传输协议和开发工具,适用于构建MCP兼容的服务器应用。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
服务器模板开发工具JavaScriptTypeScript本地部署

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Critical-Heros

提供方

Critical-Heros

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

Node.js MCP服务器模板

Node.js应用程序的模型上下文协议(MCP)服务器模板。此模板为构建支持多种传输协议的MCP兼容服务器提供了基础。

![](https://www.npmjs.com/package/@my-mcp-hub/node-mcp-server) ![](https://coveralls.io/github/my-mcp-hub/node-mcp-server?branch=main) ![](https://github.com/my-mcp-hub/node-mcp-server/releases) ![](https://github.com/my-mcp-hub/node-mcp-server/actions/workflows/build.yml) ![](https://github.com/my-mcp-hub/node-mcp-server/blob/main/LICENSE)

特性

  • 多种传输协议:

- 命令行界面的标准I/O(stdio) - web应用程序的HTTP流传输 - 服务器发送事件(SSE)用于实时更新

  • TypeScript支持:使用TypeScript构建,以实现类型安全和更好的开发人员体验
  • 开发工具:

- 开发过程中的热重新加载 - 与MCP Inspector集成进行调试 - ESLint和Prettier用于代码质量 - Husky和lint为Git钩子准备好了

  • 可扩展工具系统:轻松注册自定义MCP工具

先决条件

  • Node.js(推荐最新LTS版本)
  • npm或纱线

安装

npm install

发展

# Start development server with stdio transport
npm run dev

# Start development server with web transport
npm run dev:web

使用dev:web时,服务器将在以下位置可用:

  • 可流式传输的HTTP端点:http://localhost:8401/mcp
  • SSE端点:http://localhost:8401/sse

建筑

npm run build

构建输出将位于构建目录中。

用法

命令行

# Start with stdio transport (default)
node build/index.js

# Start with web transport
node build/index.js web --port 8401

添加自定义工具

可以在src/tools/index.ts文件中添加自定义工具:

server.registerTool(
  'YourToolName',
  {
    title: 'Your Tool Name',
    description: 'Tool description',
    inputSchema: {
      param1: z.string().describe('Parameter description'),
    },
  },
  ({ param1 }) => {
    // Implement tool logic
    return {
      content: [
        {
          type: 'text',
          text: `Your tool response: ${param1}`,
        },
      ],
    }
  },
)

环境变量

  • PORT:指定web传输的端口(默认值:8401)
  • NODE_ENV:设置为生产构建或本地开发

许可证

麻省理工学院

目录标签

目录标签

服务器模板开发工具JavaScriptTypeScript本地部署MCP协议Node.js

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP