接口说明 / 门铃哥哥 / MCP
门铃哥哥对齐 Model Context Protocol,支持三种传输,工具以 mcp__<server>__<tool> 注册进 Agent 工具环。
| 传输 | 配置 | 协议 |
|---|---|---|
| stdio | command + args(可选 env / cwd) | 子进程 |
| HTTP + SSE | 仅 url | 2024-11-05 |
| Streamable HTTP | url + transport: "streamable-http" | 2025-03-26 |
优先读工程级,再与用户级合并;同名 server 由工程级覆盖用户级。
| 级别 | 路径 |
|---|---|
| 工程 | <workspace>/.menling-gege/mcp.json |
| 用户 | ~/.menling-gege/mcp.json |
{
"mcpServers": {
"echo": {
"command": "python",
"args": ["examples/mcp/echo_server.py"],
"env": {}
},
"echo-sse": {
"url": "https://mcp.example.com/sse",
"bearer": "demo-token"
},
"echo-http": {
"url": "https://mcp.example.com/mcp",
"transport": "streamable-http",
"headers": { "Authorization": "Bearer demo-token" }
}
}
}
| 字段 | 说明 |
|---|---|
command + args + env / cwd | stdio 子进程 |
url | 默认按 HTTP+SSE 连接 |
url + transport | sse / streamable-http;也可写 type: "http" |
headers | 所有请求自动携带 |
bearer / token | 简写,自动加 Authorization: Bearer … |
disabled | 跳过该 server |
timeout | 该 server 会话默认超时(秒) |
~/.menling-gege/ 下,不要写进仓库、安装包或公开配置。连接成功后自动探测,不支持则静默为空。Agent 工具:
| 工具 | 参数 |
|---|---|
mcp_list_resources | 可选 server |
mcp_read_resource | server + uri |
mcp_list_prompts | 可选 server |
mcp_get_prompt | server + name,可选 arguments |
远端 MCP 需要 OAuth 时,可在该 server 下加 auth:
"my-oauth-mcp": {
"url": "https://mcp.example.com/sse",
"auth": {
"type": "oauth",
"authorizationUrl": "https://auth.example.com/authorize",
"tokenUrl": "https://auth.example.com/token",
"clientId": "your-client-id",
"scopes": ["mcp"],
"redirectPort": 8768
}
}
oauth_needed,界面提示「该 MCP 需授权」。http://127.0.0.1:<port>/callback,仅监听本机。