Get the FREE Ultimate OpenClaw Setup Guide →

api

MCP server from bluechenchenchen/api-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio bluechenchenchen-api-mcp-server npx -y api-mcp-server --transport stdio --doc-url xxx

How to use

This MCP server is an API Swagger/OpenAPI documentation retrieval tool built on the Model Context Protocol (MCP). It fetches Swagger/OpenAPI specs from a provided URL, cleans and optimizes the document to reduce token usage, and exposes the information through MCP-compatible transports so IDEs can access endpoint details, parameters, and example requests/responses. The server supports multiple transport modes (stdio, http, and sse) to accommodate different integration scenarios with code editors and IDEs.

To use it, run the server with a document URL via the transport you prefer. In stdio mode (default), you can invoke it through npx api-mcp-server --doc-url <URL> and receive structured API information through standard I/O. If you need real-time updates or a RESTful interface, you can switch to http or SSE modes using --transport http or --transport sse and specify a port if needed with --port. The tool will parse the provided OpenAPI/Swagger document, extract endpoints, parameters, and response formats, and present them in a normalized MCP-friendly format suitable for IDE features like code completion and interface suggestions.

How to install

Prerequisites:

  • Node.js v16 or newer
  • npm or pnpm

Installation steps:

  1. Ensure Node.js is installed. Verify with: node -v npm -v
  2. Install dependencies and run the server using the MCP npm package. Since this server is designed to be used via npx, you can skip a global install and run directly: npx -y api-mcp-server --doc-url https://example.com/swagger.json

Optional development workflow (clone repository and run locally):

  1. git clone https://github.com/bluechenchenchen/api-mcp-server.git
  2. cd api-mcp-server
  3. pnpm install
  4. pnpm dev # for development mode
  5. pnpm build

Note: Replace https://example.com/swagger.json with your actual OpenAPI/Swagger URL. You can also switch transport modes later (stdio, http, sse) using the --transport flag.

Additional notes

Tips and common considerations:

  • The --doc-url parameter is required to fetch the OpenAPI/Swagger document.
  • Supported formats include Swagger 2.0 and OpenAPI 3.x; the tool will normalize the document for MCP consumption.
  • Transport options: stdio (default), http, and sse. Use http for a RESTful interface and sse for real-time updates.
  • If you run into CORS or network restrictions, ensure the host can access the provided doc URL from the chosen transport.
  • The npm package name for this server is api-mcp-server, so you can run it directly with npx api-mcp-server. Consider pinning a specific version in production to avoid breaking changes.
  • For debugging or inspector usage, you can run the inspector tool: npx @modelcontextprotocol/inspector

Related MCP Servers

Sponsor this space

Reach thousands of developers