MCP 快速开始
当你已经有 MCP server URL 或本地 stdio server 命令时,优先使用这条主路径。
远程 HTTP Server
使用位置 URL 形式添加远程 server:
iac-code mcp add --transport http yuque https://mcp.example.com/yuque/mcp
如果 server 使用 OAuth,请启动授权流程:
iac-code mcp auth yuque
授权完成后运行有界 health check:
iac-code mcp get yuque --check
Stdio Server
对于 stdio server,请将 subprocess 命令放在 -- 后。远程 HTTP server 不需要 wrapper:按上文用 --transport http 添加即可。
iac-code mcp add local-files --scope user -- npx -y @modelcontextprotocol/server-filesystem ./templates
然后在不连接 server 的情况下查看配置:
iac-code mcp get local-files --config-only