MCP Server.exe 标志

MCP Server.exe

社区
shadowcz007

小智 & Cursor 的 MCP 启动器 - MCP For Cursor&xiaozhi。打包成可执行文件。Turn MCP server into an executable file

发布者shadowcz007
代码仓库mcp_server_exe
语言TypeScript
复刻数
28
星标数
164
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    MCP Server.exe 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 164 个 Star 和 28 个 Fork。

MCP EXE

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

bash
# 推荐:通过 CLI 运行(无需本地构建)
npx mcp_exe --mcp-config ./examples/mcp.json

# 或运行打包后的可执行文件(Windows/macOS)
./executables/mcp_server-win-x64.exe --mcp-config ./examples/mcp.json

🎯 主要使用场景 | 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.

xiaozhi-mcp

bash
# 使用配置文件连接到 xiaozhi.me / Start in WebSocket mode
npx mcp_exe --ws wss://api.xiaozhi.me/mcp/?token=...xxx --mcp-config ./examples/mcp-sse.json

配置示例 | Configuration Example (mcp-sse.json):

json
{
    "mcpServers": {
        "Model Server sse": {
            "url": "http://127.0.0.1:3000"
        }
    },
    "serverInfo": {
        "serverName": "ws-client-mcp-server",
        "version": "1.0.0",
        "description": "WebSocket 客户端的 MCP 服务器实例",
        "author": "shadow"
    }
}

WebSocket 模式特性 | WebSocket Mode Features:

  • 支持实时双向通信 | Support real-time bidirectional communication
  • 自动重连机制 | Automatic reconnection mechanism
  • 多服务统一管理 | Unified management of multiple services
  • 兼容标准 MCP 协议 | Compatible with standard MCP protocol

相关项目可视化xiaozhi-mcp启动器

2. 快速启动独立服务 | Quick Start Standalone Service

最简单的使用方式 - 双击运行,或使用 npx 即可启动一个标准的 MCP 服务。

The simplest way - double-click to run, or start via npx.

bash
# 双击运行 mcp_server.exe,或通过命令行启动
./executables/mcp_server-win-x64.exe
# 或
npx mcp_exe

默认配置 | 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.

bash
npx mcp_exe --mcp-config ./examples/mcp.json

配置示例 | Configuration Example (mcp.json):

json
{
  "mcpServers": {
    "Model Server sse": { "url": "http://127.0.0.1:9090" },
    "Model Server - stdio": { "command": "xxx", "args": ["--transport", "stdio"] }
  },
  "serverInfo": { "serverName": "dynamic-mcp-server" },
  "tools": [],
  "namespace": "."
}
  • 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.

bash
npx mcp_exe --mcp-config ./examples/product-hunt/mcp-tools.json

配置示例 | Configuration Example(节选,自定义按需调整):

json
{
  "toolChains": [
    {
      "name": "product_hunt_news",
      "description": "get product hunt news",
      "steps": [
        { "toolName": "get_product_hunt_url", "args": {} },
        { "toolName": "load_product_hunt_js_code", "args": {} },
        { "toolName": "browser_navigate", "args": {}, "outputMapping": { "url": "content.0.text" }, "fromStep": 0 },
        { "toolName": "browser_execute_javascript", "args": {}, "outputMapping": { "code": "content.0.text" }, "fromStep": 1 },
        { "toolName": "browser_close", "args": {} }
      ],
      "output": { "steps": [3] }
    }
  ]
}

工具链特性 | 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.

bash
npx mcp_exe --mcp-js ./examples/custom-mcp-config.js

配置示例 | Configuration Example (custom-mcp-config.js):

javascript
module.exports = {
  // 推荐导出名:configureMcp(也兼容 mcpPlugin)
  configureMcp: function(server, ResourceTemplate, z) {
    server.tool('myTool', '自定义工具示例', { /* zod schema */ }, async (args) => ({ content: [{ type: 'text', text: 'ok' }] }))
    server.resource('custom-echo', new ResourceTemplate('custom-echo://{message}', { list: undefined }), async (uri, { message }) => ({ contents: [{ uri: uri.href, text: message }] }))
    server.prompt('custom-prompt', { /* zod */ }, ({ message }) => ({ messages: [{ role: 'user', content: { type: 'text', text: message } }] }))
  }
}

6. 定时任务模式 | Cronjob Mode

使用 --cronjob 定时执行工具。目前支持的操作:listTools、callTool。任务会在启动时立即执行一次,并按 schedule 周期执行,可通过桌面气泡/邮件/ntfy 推送结果。

bash
# 示例:结合自定义工具与定时任务
npx mcp_exe --cronjob ./examples/cronjob.json --mcp-js ./examples/product-hunt/custom-mcp-config.js

配置示例 | Configuration Example(examples/cronjob.json):

json
{
  "tasks": [
    {
      "schedule": "*/30 * * * * *",
      "operations": [
        { "type": "callTool", "name": "get_product_hunt_url", "arguments": {} }
      ],
      "notify": [
        { "type": "desktop", "title": "任务执行结果", "icon": "" }
      ]
    }
  ]
}

通知支持 | Notifications:

  • desktop: 系统气泡(需本地桌面环境)
  • email: 发送邮件(需提供 to、subject 等)
  • ntfy: 推送到 ntfy(需提供 url、topic、tags、priority)

注意:定时任务直接调用已组合的工具(含远端 SSE/本地 stdio 工具),无需在任务中指定传输。

7. 嵌入式集成 | Embedded Integration

作为独立进程集成到任何应用程序中。

Integrate as a standalone process into any application.

javascript
// Node.js 示例 | Node.js Example
const { spawn } = require('child_process')

const mcpServer = spawn('./executables/mcp_server-win-x64.exe', [
  '--port', '3000',
  '--transport', 'stdio'
])

mcpServer.stdout.on('data', (data) => {
  // 处理 MCP 服务器的输出
})

mcpServer.stdin.write(JSON.stringify({
  // 发送请求到 MCP 服务器
}))

📚 详细文档 | 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 功能:

javascript
module.exports = {
  // MCP 配置函数 | MCP configuration function
  configureMcp: function(server, ResourceTemplate, z) {
    // 配置资源和工具 | Configure resources and tools
  },
  // 可选:提供额外的 mcp 配置对象
  mcpConfig: { /* mcpServers/tools/toolChains/namespace */ }
}

自动重载 | Auto Reload

  • 监听 --mcp-config 文件变更:自动重新解析并重启服务(含工具链/命名空间/工具白名单等)
  • 监听 --mcp-js 文件变更:自动重新加载自定义 configureMcp/mcpPlugin

开发指南 | Development Guide

安装 | Installation

bash
npm install

构建 | Build

bash
yarn build # 或 npm run build

运行 | Run

bash
npm start
# 或开发模式(SSE):
npm run dev
# WebSocket 开发:
npm run dev-ws
# Cronjob 开发:
npm run dev-cronjob

打包 | Packaging

bash
# Windows 打包
npm run package-win

# macOS 打包(Intel/Apple Silicon)
npm run package-mac-intel
npm run package-mac-arm

打包后的可执行文件将生成在 executables 目录中。

日志 | Logging

  • 通过 --log-level 控制最小输出级别(默认 INFO)
  • 控制台带时间戳/分类/颜色输出;OUTPUT 级别用于原样输出供工具解析

作为库使用 | Library API

自 v0.11.x 起,提供稳定导出:McpRouterServer。

js
// CommonJS
const { McpRouterServer } = require('mcp_exe');

(async () => {
  const server = new McpRouterServer({ name: 'my-app' }, { transportType: 'sse', port: 3000 });
  await server.importMcpConfig(require('./mcp.json'), null);
  await server.start();
})();
ts
// TypeScript / ESM
import { McpRouterServer } from 'mcp_exe';

const server = new McpRouterServer({ name: 'my-app' }, { transportType: 'stdio' });
await server.importMcpConfig(mcpJson, null);
await server.start();
  • 类型声明输出于 dist/index.d.ts,通过 types/exports 自动暴露。
  • CLI 仍通过 bin/cli.js 提供,库与 CLI 可并行使用。

📝 许可证 | License

MIT

安装

TypingMind
{
  "mcpServers": {
    "mcp-server-exe": {
      "command": "./mcp_server-win-x64.exe",
      "args": [
        "--port",
        "3000",
        "--mcp-config",
        "{{config.MCP_CONFIG_PATH}}"
      ],
      "env": {
        "MCP_CONFIG_PATH": "<MCP_CONFIG_PATH>"
      }
    }
  }
}

将 MCP Server.exe MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 MCP Server.exe 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 MCP Server.exe 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 MCP Server.exe MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "mcp-server-exe": {
      "command": "npx",
      "args": [
        "-y",
        "mcp_exe"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 MCP Server.exe MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 MCP Server.exe MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 MCP Server.exe 帮我完成这项任务吗?
MCP Server.exe
当然。我已阅读。
以下是我使用 MCP Server.exe 得到的结果。

常见问题

MCP Server.exe MCP 服务器有什么用途?

MCP Server.exe 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 MCP Server.exe MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 MCP Server.exe,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 MCP Server.exe MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 MCP Server.exe 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 MCP Server.exe MCP 连接到 TypingMind?

MCP Server.exe 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

MCP Server.exe MCP 在 TypingMind 中提供哪些工具?

MCP Server.exe 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 MCP Server.exe MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 MCP Server.exe 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇