Apidog MCP Server 使 Cursor 等 AI 驱动的 IDE 能够直接访问并处理你的 API 规范,从而加速开发并简化工作流。Apidog MCP Server 目前处于 beta 阶段。本文档将定期更新新功能和改进。
你可以用 Apidog MCP Server 做什么?#
借助 Apidog MCP Server,AI 助手可以:工作原理#
配置完成后,Apidog MCP Server 会自动读取所有 API 规范数据并将其缓存在本地。随后 AI 可以无缝检索并使用这些数据。"Use MCP to fetch the API specification and generate Java records for the 'Product' schema and related schemas"
"Based on the API specification, add the new fields to the 'Product' DTO"
"Add comments for each field in the 'Product' class based on the API specification"
"Generate all the MVC code related to the endpoint '/users' according to the API specification"
API 规范会缓存在本地。如果 Apidog 中的数据发生变化,请让 AI 刷新,以确保它读取最新更新。
前提条件#
在设置 Apidog MCP Server 之前,请确保你具备:Node.js(版本 18 或更高,最好是最新的 LTS 版本)
选择你的数据源#
Apidog MCP Server 支持三种不同的数据源。请选择符合你需求的配置方法:私有化部署配置#
对于私有化部署,无论你选择哪种数据源,都需要将服务器的 API 地址添加到配置中:{
"mcpServers": {
"API specification": {
"command": "npx",
"args": [
"-y",
"apidog-mcp-server@latest",
"--apidog-api-base-url=<your-server-url>"
]
}
}
}
将 <your-server-url> 替换为你的私有化部署服务器的 API 地址(以 http:// 或 https:// 开头)。确保你的环境可以正常访问 www.npmjs.com。
帮助与支持#
Apidog MCP Server 目前处于 beta 阶段。我们很乐意听取你的反馈和建议!