本指南说明开发者如何将兼容 MCP 的 IDE(Cursor / VS Code + Cline)连接到 Cobre 的公开 API 文档,从而使 IDE 的 AI 智能体能够读取 OpenAPI Specification(OAS)并生成准确的代码、DTO、文档等内容。
您将获得什么(为何重要)#
配置 MCP 后,您的 AI IDE 可以拉取与 Cobre 文档中相同的 API 详情,并利用这些信息:为特定 endpoint(鉴权、payouts、webhooks 等)搭建完整流程
前提条件#
3.
可运行 npx 的网络访问(必须能访问 npm 仓库)
第 1 步 — 添加 Cobre 的 MCP 服务器配置#
{
"mcpServers": {
" - Cobre API Documentation": {
"command": "npx",
"args": [
"-y",
"apidog-mcp-server@latest",
"--site-id=760877"
]
}
}
}
该配置使用 Published Documentation 数据源,并通过 site-id=760877 直接指向 Cobre 的公开 API 文档。无需 token。
Cursor 配置(快捷路径)#
3.
点击 Add new global MCP server
VS Code + Cline 配置(快捷路径)#
第 2 步 — 验证 MCP 是否可用#
基本连通性测试#
“Please fetch API documentation via MCP and tell me how many endpoints exist.”
基于 endpoint 的开发#
“Using MCP, generate example requests and responses for /v1/... and produce a typed TypeScript client method.”
DTO / schema 生成#
“Use MCP to generate Java/Kotlin/TypeScript models for the schemas used by <endpoint>.”
Schema 同步 / 重构#
“Compare the current DTO in this repository with the MCP schema and add any missing fields with documentation comments.”
强烈建议:将 MCP 与 Cobre 的 LLM 文档索引结合使用#
若需要更广的集成指引(流程、说明、集成步骤),还可以让 AI 阅读:https://docs.cobre.com/llms.txt
这会提供 Markdown 格式的结构化文档导航。用 MCP 做精确的 OpenAPI schema 校验(字段、枚举、必填参数、错误码)。
“Usign the MCP and the llms.txt in https://docs.cobre.com/llms.txt with the extended Cobre's documentation, create a flow to demostrate how to send a payment to a Bre-B key.”
刷新缓存的 API 规范#
MCP 配置会为性能在本地缓存规范。若 Cobre 更新了文档,您可能需要让 AI 刷新/重新加载 MCP。若您认为文档已变更(新字段、枚举更新、参数变更):“Refresh MCP and reload the latest API specification.”
由于 MCP 在本地缓存规范,刷新可确保您使用的是最新版本。
常见问题排查#
Windows 上的 npx 问题#
{
"mcpServers": {
" - Cobre API Documentation": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"apidog-mcp-server@latest",
"--site-id=760877"
]
}
}
}
公司网络限制#
返回过时字段#
推荐的 Cobre 集成“黄金流程”#
1
从业务目标开始
示例:
“I need to create beneficiaries and send payouts. What endpoints and sequence should I use?”
3
用 MCP 强制正确性
“Now use MCP to validate required fields, enums, and error responses for each endpoint.”
4
根据 MCP 生成代码
“Generate a service class and unit tests using the MCP-derived schemas.”
对团队高价值的用例#
Modified at 2026-08-19 22:51:12