Apifox MCP Server logo

Apifox MCP Server

by apifox

Apifox MCP Server provides API documentation from Apifox projects as a data source for AI-powered IDE tools like Cursor, enabling AI to directly access and utilize API documentation data. Developers can use AI assistants to generate/modify code based on API documentation and search for API documentation content.

View on GitHub

Last updated: N/A

What is Apifox MCP Server?

Apifox MCP Server is a tool that allows AI-powered IDEs to access API documentation from Apifox projects. It caches the API documentation locally, enabling AI to generate code, modify existing code, and search for specific information within the documentation.

How to use Apifox MCP Server?

  1. Install Node.js (>= 18).
  2. Install a supported IDE (Cursor or VSCode with Cline).
  3. Generate an Apifox Access Token.
  4. Get the Apifox Project ID.
  5. Configure the IDE with the provided JSON configuration, replacing <access-token> and <project-id> with your actual values.
  6. Tell the AI what you want to do with the API documentation, such as generating code or adding comments.

Key features of Apifox MCP Server

  • Provides API documentation to AI-powered IDEs

  • Caches API documentation locally for faster access

  • Supports generating code from API documentation

  • Supports modifying existing code based on API documentation

  • Supports searching API documentation content

  • Supports Swagger/OAS files

Use cases of Apifox MCP Server

  • Generating code from API documentation

  • Modifying existing code based on API documentation

  • Adding comments to code based on API documentation

  • Generating MVC code for APIs

  • Searching for specific information within API documentation

FAQ from Apifox MCP Server

How do I update the API documentation data?

Tell the AI to refresh the API documentation data if the data in Apifox has been updated.

What if the configuration doesn't work on Windows?

Use the provided Windows-specific configuration.

What if I want to use API documentation from multiple projects?

Add multiple MCP Server configurations in the IDE, each with a different <project-id>.

How do I avoid exposing my APIFOX_ACCESS_TOKEN?

Set APIFOX_ACCESS_TOKEN as an environment variable on each developer's machine instead of including it in the configuration file.

How do I use the MCP server with a private deployment of Apifox?

Add the --apifox-api-base-url parameter to the IDE's MCP configuration, specifying the API address of your private deployment.