Allows creating custom tools through JavaScript configuration files, enabling dynamic definition and extension of MCP capabilities with user-defined JavaScript plugins
Enables embedding MCP Server into Node.js applications as a separate process with inter-process communication through stdio mode
MCP Server.exe
小智 & Cursor 的 MCP 启动器 - MCP For Cursor&xiaozhi
MCP Server.exe 是一个强大的可执行服务器,它不仅能够运行标准的 MCP (Model Context Protocol) 服务,更提供了丰富的高级功能:
- 工具链式调用:支持将多个工具按序组合,实现复杂的自动化流程
- 多 MCP 服务组合:可同时运行和管理多个 MCP 服务,支持 SSE 和 stdio 双模式
- 插件化工具系统:支持自定义工具的动态加载和配置
- 灵活的部署选项:从单机运行到分布式部署,满足各类集成场景
- 自动重载:监听
--mcp-config
与--mcp-js
变更,自动重启生效
MCP Server.exe is a powerful executable server that not only runs standard MCP (Model Context Protocol) services, but also provides rich advanced features:
- Tool Chain Execution: Support sequential combination of multiple tools for complex automation
- Multiple MCP Services: Can run and manage multiple MCP services simultaneously, supporting both SSE and stdio modes
- Pluggable Tool System: Support dynamic loading and configuration of custom tools
- Flexible Deployment: From standalone operation to distributed deployment, meeting various integration scenarios
- Auto reload for config changes
Usage
🎯 主要使用场景 | Main Usage Scenarios
1. WebSocket 连接模式 | WebSocket Connection Mode
支持通过 WebSocket 连接到其他 MCP 服务,特别适合连接到 xiaozhi.me 等的接入。通过配置文件,可以轻松地将多个 MCP 服务接入到 xiaozhi.me。
Support connecting to other MCP services via WebSocket, especially suitable for connecting to WebSocket-enabled MCP services like xiaozhi.me. Through configuration files, you can easily integrate multiple MCP services with xiaozhi.me.
配置示例 | Configuration Example (mcp-sse.json):
WebSocket 模式特性 | WebSocket Mode Features:
- 支持实时双向通信 | Support real-time bidirectional communication
- 自动重连机制 | Automatic reconnection mechanism
- 多服务统一管理 | Unified management of multiple services
- 兼容标准 MCP 协议 | Compatible with standard MCP protocol
2. 快速启动独立服务 | Quick Start Standalone Service
最简单的使用方式 - 双击运行,或使用 npx 即可启动一个标准的 MCP 服务。
The simplest way - double-click to run, or start via npx.
默认配置 | Default Configuration:
- 监听端口 | Listen Port: 3000(可通过
--port
修改) - SSE 路由 | SSE Endpoints: GET
/
建立会话,POST/sessions?sessionId=...
发送消息 - 内置基础工具集 | Built-in Basic Tools
- 自动重载 | Auto reload
--mcp-config
与--mcp-js
3. 组合多个 MCP 服务 | Combine Multiple MCP Services
使用与 Cursor 一致的 mcp.json 配置文件,通过配置文件组合多个 MCP 服务,支持同时使用 SSE 和 stdio 两种传输模式。这样可以根据不同的应用场景选择合适的传输方式,提高系统的灵活性和可扩展性。
Use the same mcp.json configuration file as Cursor to combine multiple MCP services, supporting both SSE and stdio transport modes simultaneously.
配置示例 | Configuration Example (mcp.json):
tools
: 允许的工具白名单(为空数组表示不过滤)namespace
: 组合命名空间分隔符,默认.
(亦可使用::
)
4. 工具链式调用 | Tool Chain Execution
支持将多个工具组合成工具链,实现复杂的自动化流程。工具链可以灵活配置数据流转和结果输出。
Support combining multiple tools into a tool chain to implement complex automation processes. Tool chains can flexibly configure data flow and result output.
配置示例 | Configuration Example(节选,自定义按需调整):
工具链特性 | Tool Chain Features:
- 支持多步骤顺序执行 | Support multi-step sequential execution
- 灵活的数据流转映射 | Flexible data flow mapping(
outputMapping
/fromStep
) - 可从任意步骤获取结果 | Can get results from any step(
output.steps
)
5. 自定义工具的插件机制 | Custom Tools Plugin Mechanism
通过 JavaScript 配置文件,灵活定义工具、资源和提示。
Flexibly define tools, resources, and prompts through JavaScript configuration files.
配置示例 | Configuration Example (custom-mcp-config.js
):
6. 定时任务模式 | Cronjob Mode
使用 --cronjob
定时执行工具。目前支持的操作:listTools
、callTool
。任务会在启动时立即执行一次,并按 schedule
周期执行,可通过桌面气泡/邮件/ntfy 推送结果。
配置示例 | Configuration Example(examples/cronjob.json
):
通知支持 | Notifications:
- desktop: 系统气泡(需本地桌面环境)
- email: 发送邮件(需提供
to
、subject
等) - ntfy: 推送到
ntfy
(需提供url
、topic
、tags
、priority
)
注意:定时任务直接调用已组合的工具(含远端 SSE/本地 stdio 工具),无需在任务中指定传输。
7. 嵌入式集成 | Embedded Integration
作为独立进程集成到任何应用程序中。
Integrate as a standalone process into any application.
📚 详细文档 | Detailed Documentation
命令行参数 | Command Line Arguments
服务器支持以下命令行参数来自定义其行为:The server supports the following command line arguments:
参数 | 说明 | 默认值 |
---|---|---|
--ws <url> | WebSocket 服务器地址,启用 WebSocket 连接模式 | 无 |
--mcp-js <路径> | MCP JavaScript 配置文件路径(支持 configureMcp 或 mcpPlugin ) | 无 |
--mcp-config <路径/json字符串> | MCP JSON 配置文件路径或 JSON 字符串 | 无 |
--server-name <name> | 服务器名称 | mcp_server_exe |
| --port <端口>
| 服务器监听端口 | 3000 |
| --transport <模式>
| 传输模式,支持 sse
或 stdio
(非 WS 模式下生效) | sse |
| --cronjob <路径/json>
| 定时任务配置文件路径或 JSON 字符串 | 无 |
| --cursor-link
| 启动后在 Cursor 中快捷接入(SSE 模式) | 关闭 |
| --log-level <level>
| 日志级别:TRACE/DEBUG/INFO/WARN/ERROR/FATAL/OUTPUT | INFO |
| --version <version>
--description <desc>
--author <author>
--license <license>
--homepage <url>
| 元信息 | - |
提示:若提供 --ws
则优先使用 WebSocket 模式;否则未显式指定时默认使用 sse
。
配置文件格式 | Configuration File Format
服务器支持使用配置文件同时配置服务器参数和 MCP 功能:
自动重载 | Auto Reload
- 监听
--mcp-config
文件变更:自动重新解析并重启服务(含工具链/命名空间/工具白名单等) - 监听
--mcp-js
文件变更:自动重新加载自定义configureMcp
/mcpPlugin
开发指南 | Development Guide
安装 | Installation
构建 | Build
运行 | Run
打包 | Packaging
打包后的可执行文件将生成在 executables
目录中。
日志 | Logging
- 通过
--log-level
控制最小输出级别(默认INFO
) - 控制台带时间戳/分类/颜色输出;
OUTPUT
级别用于原样输出供工具解析
作为库使用 | Library API
自 v0.11.x 起,提供稳定导出:McpRouterServer
。
- 类型声明输出于
dist/index.d.ts
,通过types
/exports
自动暴露。 - CLI 仍通过
bin/cli.js
提供,库与 CLI 可并行使用。
📝 许可证 | License
MIT
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A powerful executable server for running Model Context Protocol services that supports tool chain execution, multiple MCP services management, and a pluggable tool system for complex automation workflows.
Related MCP Servers
- AsecurityAlicenseAqualityA dynamic service that creates and manages Model Context Protocol (MCP) servers, allowing users to spawn, customize, and control multiple MCP servers as child processes.Last updated -5091MIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that provides structured workflow tools for managing software development projects through different complexity levels, offering specialized modes for project planning, design, implementation, and documentation.Last updated -5321
- AsecurityAlicenseAqualityA comprehensive Model Context Protocol server providing access to 70+ IT tools for developers and system administrators, including encoding/decoding, text manipulation, hashing, and network utilities.Last updated -7633910TypeScriptMIT License
- -securityFlicense-qualityA feature-rich Model Context Protocol server built with FastMCP that provides various tools including basic utilities, network services, file operations, encryption tools, and system information functions.Last updated -