Conntect OpenAPI Files to AI via Apidog MCP Server
Configuring the MCP Client
Prerequisites
Common Configuration Steps
Prepare OpenAPI File
Configure MCP in IDE
Add this JSON configuration to your IDE's MCP config file:Where A remote URL (e.g., A local file path (e.g.,
macOS / Linux
Windows
{
"mcpServers": {
"API specification": {
"command": "npx",
"args": [
"-y",
"apidog-mcp-server@latest",
"--oas=<oas-url-or-path>"
]
}
}
}
<oas-url-or-path>
can be:https://petstore.swagger.io/v2/swagger.json
)~/data/petstore/swagger.json
)Configuring MCP in Cursor
Edit MCP Config File
Open Cursor editor, click the settings icon (top-right), select "MCP" from the left menu, then click "+ Add new global MCP server".
Add Configuration
In the opened
mcp.json
file, add the following configuration (remember to replace https://petstore.swagger.io/v2/swagger.json
with your actual OpenAPI file path or URL):macOS / Linux
Windows
{
"mcpServers": {
"API specification": {
"command": "npx",
"args": [
"-y",
"apidog-mcp-server@latest",
"--oas=https://petstore.swagger.io/v2/swagger.json"
]
}
}
}
Verify Configuration
Test the connection by asking the AI (in Agent mode):If the AI returns correct API information in your OpenAPI file, the connection is successful. 
Please fetch API documentation via MCP and tell me how many endpoints exist in the project
Important Notes
--oas
parameter.<API address of the on-premise server, starting with http:// or https://>
" Additionally, ensure network access to www.npmjs.com
properly.{
"mcpServers": {
"API specification": {
"command": "npx",
"args": [
"-y",
"apidog-mcp-server@latest",
"--oas=<oas-url-or-path>",
// Required for on-premise deployment:
"--apifox-api-base-url=<API address of the on-premise server, starting with http:// or https://>"
]
}
}
}
Connecting Other Data Resources to AI
FAQs
Modified atย 2025-03-28 11:21:40