一个通过单一接口聚合多个MCP资源服务器的MCP网关。
网关按照以下顺序查找配置文件:
MCP_CONFIG_PATH~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonconfig.json网关可以从您的Claude桌面配置中读取proxyBatchMcpServers部分:
{
"mcpServers": {
"mcp-gateway": {
"command": "npx",
"args": [
"-y",
"@thinkware/mcp-gateway"
]
}
},
"proxyBatchMcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop",
"/path/to/other/allowed/dir"
],
"toolOverrides": {
"read_file": {
"enabled": true,
"description": "读取文件的全部内容\n输入:路径(字符串)\n以UTF-8编码读取整个文件的内容"
},
"read_multiple_files": {
"enabled": false
}
}
},
"server-1": {
"command": "/path/to/server1/build/index.js",
"toolOverrides": {
"some_tool": {
"enabled": true,
"description": "自定义描述"
}
}
}
}
}
| 选项 | 类型 | 描述 | 必需 |
|---|---|---|---|
command | 字符串 | 服务器可执行文件的路径 | 是(对于命令服务器) |
args | 字符串数组 | 命令参数 | 否 |
env | 对象 | 环境变量 | 否 |
url | 字符串 | SSE端点URL | 是(对于SSE服务器) |
toolOverrides | 对象 | 工具定制 | 否 |
| 选项 | 类型 | 描述 | 默认值 |
|---|---|---|---|
enabled | 布尔值 | 启用/禁用工具 | true |
description | 字符串 | 自定义工具描述 | 原始描述 |
disabled | 布尔值 | 禁用整个工具 | false |
{
"mcpServers": {
"mcp-gateway": {
"command": "npx",
"args": [
"-y",
"@thinkware/mcp-gateway"
],
"env": {
"MCP_GATEWAY_LOG_FILE": "/path/to/logs/mcp-gateway.log"
}
}
}
}
# 安装依赖
npm install
# 开发模式自动重建
npm run dev
# 构建
npm run build