home / mcp / openapi mcp server

OpenAPI MCP Server

Unified MCP server that generates tools from multiple OpenAPI specs with per-API base URLs and auth

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "agarwal-saurabh-multiapimcpserver": {
      "command": "fastmcp-openapi",
      "args": [
        "--spec",
        "https://api.example.com/openapi.json",
        "--auth-header",
        "Bearer your-token"
      ],
      "env": {
        "OPENAI_API_KEY": "your-openai-api-key"
      }
    }
  }
}

FastMCP OpenAPI creates MCP tools from OpenAPI specifications, letting you query diverse APIs through a unified MCP server. You can load multiple APIs, authenticate requests, and test interactions with MCP Inspector or LangChain agents. It streamlines how AI agents discover and call REST endpoints by turning OpenAPI definitions into strongly typed MCP tools.

How to use

You run a single MCP server that exposes tools representing the operations defined in one or more OpenAPI specifications. Each operation becomes an MCP tool with parameters validated against the OpenAPI schema. You then query these tools from your MCP client or AI agent just like you would call any other MCP tool. When you structure your requests, you can specify per-API base URLs and authentication headers so that each API is accessed with its intended credentials. If you load multiple APIs, tool names are prefixed to avoid collisions so you can clearly differentiate which API a tool belongs to.

How to install

Prerequisites ensure you have the runtime environments needed to run the MCP server and test it with the Inspector or LangChain.

Install the MCP server package with Python’s package manager.

Additional sections

Configuration, security, examples, and troubleshooting are covered here so you can configure per-API settings, run tests with MCP Inspector, and integrate with LangChain.

Available tools

petstore_getPetById

Tool for retrieving a Pet by its ID from the Petstore API, including parameter validation against the OpenAPI schema and proper authentication.

github_getUser

Tool for fetching a GitHub user profile, with parameter validation and authentication as required by the API.

local_createItem

Tool for creating an item in a local API, using the corresponding OpenAPI spec to validate input.