本地代理服务

一个本地代理,将运行在您机器上的私有MCP服务器(stdio进程、localhost URL)通过出站隧道连接到MCP Central。

  • by BitsDiver
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 BitsDiver/mcp-central-agent

使用说明

mcp中心代理

一个本地代理,将计算机上运行的私有MCP服务器(stdio进程、localhost URL)连接到 MCP中央 通过出站隧道。

概述

MCP Central是一个云托管的MCP代理,但一些MCP服务器在本地运行:

  • stdio 过程(例如。 npx @modelcontextprotocol/server-github)
  • 上的HTTP服务器 localhost / 192.168.x.x / *.local

mcp中心代理 通过以下方式解决此问题:

  1. 在您的计算机上作为轻量级Node.js进程运行
  2. 通过Socket将出站连接到MCP Central。IO(无需端口转发)
  3. 将工具调用转发到本地MCP服务器并返回结果

快速开始

1.在MCP Central中创建本地代理

首选 端点 → 添加本地代理,输入名称,然后复制生成的API密钥。

2.初始化配置

npx mcp-central-agent init

回答提示:

  • 服务器URL: https://your-mcp-central.example.com
  • 代理名称: My Laptop
  • API密钥: agent_xxxxxxxxxx... (从步骤1开始)

这创造了 mcp-agent.json 在当前目录中。

3.启动代理

npx mcp-central-agent start

代理连接到MCP Central并接收分配给它的端点列表。它启动每个本地MCP服务器并向MCP Central通告其工具。

配置文件

mcp-agent.json:

{
  "serverUrl": "https://your-mcp-central.example.com",
  "agentName": "My Laptop",
  "apiKey": "agent_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
字段 描述
serverUrl MCP Central服务器的基本URL
agentName 必须与UI中创建的代理名称匹配
apiKey MCP Central生成的密钥(切勿共享)

端点由MCP Central UI管理——代理在连接时会自动接收它们。

支持的交通工具

运输 说明
stdio 生成本地进程(例如。 npx @modelcontextprotocol/server-fs)
streamable-http 连接到本地HTTP MCP服务器
sse 连接到本地SSE MCP服务器

CLI参考

mcp-central-agent init [--output <path>]   Create config file interactively
mcp-central-agent start [--config <path>]  Start the agent

安全

  • API密钥是每个代理的唯一机密。保持私密。
  • 流量仅用于出站,不需要入站端口。
  • IP白名单可在MCP Central中配置。
  • 密钥以SHA-256哈希存储在数据库中;MCP Central在创建后永远不会看到或存储纯文本密钥。