MCP服务器从注册到销毁的完整管理流程
OpenClaw通过Gateway管理MCP服务器的生命周期。服务器配置在`mcpServers`中,支持stdio和http两种传输模式。Gateway自动处理健康检查和故障转移,确保Agent始终有可用的工具服务。
```json
{{
"mcpServers": {{
"github": {{
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"transport": "stdio",
"healthCheck": {{
"interval": 30000,
"timeout": 5000,
"retries": 3
}}
}},
"custom-api": {{
"url": "https://api.example.com/mcp",
"transport": "http",
"headers": {{
"Authorization": "Bearer ${{API_TOKEN}}"
}}
}}
}}
}}
```