API Docs MCP server for API documentation

API Docs MCP server for API documentation

api-docs-mcp•byelifuzz

An MCP server that loads GraphQL, OpenAPI/Swagger, and gRPC schemas from local files or remote URLs, caches them, and exposes tools for listing and searching API documentation.

License: Apache 2.0 License•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Loads GraphQL, OpenAPI/Swagger, and gRPC schemas from local files or remote URLs.
  • •Provides an api_docs tool that lists available API methods across configured sources.
  • •Provides an api_search tool that returns detailed request, response, and error documentation for a specific API resource.
  • •Caches API schema information and refreshes it periodically.

BEST FOR

  • •Retrieving documentation for OpenAPI-based APIs such as a Petstore schema.
  • •Retrieving GraphQL schema documentation.
  • •Working with documentation across multiple API sources at once.

ABOUT API-DOCS-MCP

API Docs MCP server for API documentation is cataloged as an MCP server attributed to elifuzz. An MCP server that loads GraphQL, OpenAPI/Swagger, and gRPC schemas from local files or remote URLs, caches them, and exposes tools for listing and searching API documentation. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Apache 2.0 License. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for API Docs MCP server for API documentation are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How are API sources configured for the server?

Sources are configured through the API_SOURCES environment variable, a JSON array of FileSource or UrlSource objects.

Can the server fetch schemas from remote endpoints?

Yes, it supports remote URL sources for GraphQL endpoints, OpenAPI/Swagger endpoints, and gRPC endpoints including gRPC reflection.

上游原版 README

在 GitHub 查看同一版本原文

README.md · fefca5d439ec · 采集于 2026-11-13 12:20:19 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

API Docs MCP

Model Context Protocol (MCP) server that provides tools for interacting with API documentation. Supports GraphQL, OpenAPI/Swagger, and gRPC specifications, fetching schema definitions from various sources (local files or remote URLs), caching them, and exposing them through a set of tools.

Table of Contents

MCP Platforms

mcp.so

Features

  • Dynamic Tool Registration: Automatically discovers and registers tools from a specified directory.
  • API Documentation Retrieval: Provides tools to list available API methods (api_docs) and retrieve detailed documentation for specific methods (api_search).
  • Schema Caching: Caches API schema information to reduce redundant fetches and improve performance.
  • Multiple Source Support:
    • GraphQL: Supports loading GraphQL schemas from graphql / gql files or json introspection results (local files or remote URLs).
    • OpenAPI/Swagger: Supports loading OpenAPI/Swagger yaml / yml / json schemas from local files or remote URLs.
    • gRPC: Supports loading gRPC schemas from proto files or via gRPC reflection from remote URLs.
  • Environment-based Configuration: Configures API sources via the API_SOURCES environment variable, allowing flexible deployment and management.
  • Automatic Cache Refresh: Periodically refreshes cached schema data to ensure up-to-date documentation.

Example Use Cases

OpenAPI Petstore retrieval docs

GraphQL retrieval docs

Multiple Sources retrieval docs

Architecture

The api-docs-mcp project is designed as an MCP server that integrates with various API documentation sources.

graph TD
    mcpServer[MCP Server] e1@--> tools(Tools:<br/>api_docs / api_search);
    tools e2@--> cacheManager{Cache Manager};
    cacheManager e3@--> configuration[Configuration:<br/>API_SOURCES env var];
    configuration e4@--> schemaSources{Schema Sources};
    schemaSources e5@-- FileSource--> localFiles(Local Files:<br/>.graphql, .json, .yaml, .proto);
    schemaSources e6@-- UrlSource--> remoteUrls(Remote URLs:<br/>GraphQL Endpoints, OpenAPI/Swagger Endpoints, gRPC Endpoints);
    localFiles e7@--> processor[Schema Processors];
    remoteUrls e8@--> processor;
    processor e9@--> cacheManager;
    processor e10@--> openAPIProcessor(OpenAPI Processor:<br/>OpenAPI/Swagger);
    processor e11@--> graphQLProcessor(GraphQL Processor);
    processor e12@--> grpcProcessor(gRPC Processor)
    cacheManager e13@--Cached Data--> tools;

    subgraph Core Components
        mcpServer
        tools
        cacheManager
        configuration
    end

    subgraph Data Flow
        schemaSources
        localFiles
        remoteUrls
        processor
        openAPIProcessor
        graphQLProcessor
        grpcProcessor
    end

    e1@{ animate: true }
    e2@{ animate: true }
    e3@{ animate: true }
    e4@{ animate: true }
    e5@{ animate: true }
    e6@{ animate: true }
    e7@{ animate: true }
    e8@{ animate: true }
    e9@{ animate: true }
    e10@{ animate: true }
    e11@{ animate: true }
    e12@{ animate: true }
    e13@{ animate: true }

Flow of Operations:

  1. Server Initialization: The index.ts entry point initializes the MCP server and dynamically registers tools defined in the src/tools directory.
  2. Configuration Loading: The CacheManager loads API source configurations from the API_SOURCES environment variable via src/utils/config.ts.
  3. Schema Fetching & Caching:
    • Based on the configured sources (file-based or URL-based), the CacheManager fetches API schemas.
    • For file sources, it reads local files (graphql, gql, json, yaml, yml, proto).
    • For URL sources, it makes HTTP requests to GraphQL, OpenAPI, or gRPC endpoints.
    • Schemas are then processed by specialized handlers (src/api/api.ts for OpenAPI, src/gql/gql.ts for GraphQL, src/grpc/grpc.ts for gRPC).
    • The processed documentation is stored in an in-memory cache (src/utils/cache.ts) with a specified TTL (Time-To-Live).
    • The cache is periodically refreshed.
  4. Tool Usage:
    • api_docs: When invoked, this tool retrieves a list of all available API resources from the cache, filtered by source if provided.
    • api_search: When invoked with a detailName, this tool provides detailed documentation (request, response, error structures) for a specific API resource from the cache.

Installation

To set up the api-docs-mcp server, follow these steps:

  1. Clone the repository:

    git clone https://github.com/EliFuzz/api-docs-mcp.git
    cd api-docs-mcp
    
  2. Install dependencies:

    pnpm install
    
  3. Build the project:

    pnpm build
    

Configuration

The server's behavior is controlled by the API_SOURCES environment variable. This variable should contain a JSON string representing an array of SchemaSource objects. Each SchemaSource can be either a FileSource or a UrlSource.

FileSource Example

For a local GraphQL schema:

{
  "name": "MyGraphQLFile",
  "path": "/path/to/your/schema.graphql",
  "type": "gql"
}

For a local OpenAPI JSON schema:

{
  "name": "MyOpenAPIFile",
  "path": "/path/to/your/openapi.json",
  "type": "api"
}

For a local gRPC proto file:

{
  "name": "MyGrpcFile",
  "path": "/path/to/your/service.proto",
  "type": "grpc"
}

UrlSource Example

For a remote GraphQL endpoint:

{
  "name": "GitHubGraphQL",
  "method": "POST",
  "url": "https://api.github.com/graphql",
  "headers": {
    "Authorization": "Bearer YOUR_GITHUB_TOKEN"
  },
  "type": "gql"
}

For a remote OpenAPI endpoint:

{
  "name": "PetstoreAPI",
  "method": "GET",
  "url": "https://petstore.swagger.io/v2/swagger.json",
  "type": "api"
}

For a remote gRPC endpoint with reflection:

{
  "name": "MyGrpcService",
  "url": "grpc://localhost:9090",
  "type": "grpc"
}

Setting the API_SOURCES Environment Variable

You can set this in your shell before running the server:

export API_SOURCES='[{"name": "MyGraphQLFile", "path": "./example/fixtures/graphql/graphql-schema.graphql", "type": "gql"}, {"name": "PetstoreAPI", "method": "GET", "url": "https://petstore.swagger.io/v2/swagger.json", "type": "api"}]'

Or in mcp.json for MCP execution:

"api-docs-mcp": {
    "type": "stdio",
    "command": "npx",
    "args": [ "api-docs-mcp" ],
    "env": {
        "API_SOURCES": "[{\"name\": \"MyGraphQLFile\", \"path\": \"./example/fixtures/graphql/graphql-schema.graphql\", \"type\": \"gql\"}, {\"name\": \"PetstoreAPI\", \"method\": \"GET\", \"url\": \"https://petstore.swagger.io/v2/swagger.json\", \"type\": \"api\"}]"
    }
}

Usage

Once configured and running, the api-docs-mcp server exposes two primary tools: api_docs and api_search.

API Docs Tool

This tool provides a list of all available API methods from the configured sources.

Name: api_docs Description: Get a list of all available API methods. Input Schema:

{
    sourceName?: string; // The name of the API source (e.g., "GitHub") from MCP configuration environment variables. If not provided, docs from all sources will be returned.
}

Output Schema:

{
  sources: Array<{
    sourceName: string; // The name of the source API
    resources: Array<{
      resourceName: string; // The name of the API resource
      resourceType: string; // The type of the API resource (e.g., "POST", "GET", "mutation", "query")
      resourceDescription: string; // A brief description of the API resource
    }>;
  }>;
}

Output Example:

{
  "sources": [
    {
      "sourceName": "GitHubGraphQL",
      "resources": [
        {
          "resourceName": "getUser",
          "resourceType": "query",
          "resourceDescription": "Fetch a user by username"
        },
        {
          "resourceName": "createIssue",
          "resourceType": "mutation",
          "resourceDescription": "Create a new issue in a repository"
        }
      ]
    },
    {
      "sourceName": "PetstoreAPI",
      "resources": [
        {
          "resourceName": "getPetById",
          "resourceType": "GET",
          "resourceDescription": "Find pet by ID"
        },
        {
          "resourceName": "addPet",
          "resourceType": "POST",
          "resourceDescription": "Add a new pet to the store"
        }
      ]
    }
  ]
}

API Search Tool

This tool provides detailed documentation for a specific API method.

Name: api_search Description: Search for a specific API method by name and get its full definition. Input Schema:

{
  resourceName: string; // The exact resource name of the API method to search for that was provided in `api_docs` tool's output
}

Output Schema:

{
  details: Array<{
    sourceName: string; // The name of the source API
    resources: Array<{
      resourceName: string; // The name of the resource
      resourceType: "query" | "mutation" | "subscription"; // The type of GraphQL resource
      resourceDescription: string; // Context or description of the resource
      details: {
        request?: string; // The request structure or input parameters for the API method
        response?: string; // The response structure or output format for the API method
        error?: string; // Error information or error handling details for the API method
      };
    }>;
  }>;
}

Output Example:

{
  "details": [
    {
      "sourceName": "GitHubGraphQL",
      "resources": [
        {
          "resourceName": "getUser",
          "resourceType": "query",
          "resourceDescription": "Fetch a user by username",
          "details": {
            "request": "{ username: String! }",
            "response": "{ id: ID!, login: String!, name: String }",
            "error": "{ message: String!, code: Int! }"
          }
        }
      ]
    }
  ]
}

Development

Running the Server Locally

  1. Set the API_SOURCES environment variable as described in the Configuration section.

  2. Start the server:

    pnpm start
    

The server will connect to a StdioServerTransport, meaning it will communicate over standard input/output.

Project Structure

.
├── src/
│ ├── api/ # OpenAPI/Swagger schema processing
│ │ └── api.ts
│ ├── gql/ # GraphQL schema processing
│ │ └── gql.ts
│ ├── grpc/ # gRPC schema processing
│ │ └── grpc.ts
│ ├── tools/ # MCP tools definitions
│ │ ├── api_docs.ts
│ │ └── api_search.ts
│ ├── utils/ # Utility functions (cache, config, fetch, file, source)
│ │ ├── cache.ts
│ │ ├── config.ts
│ │ ├── fetch.ts
│ │ ├── file.ts
│ │ └── source.ts
│ ├── index.ts # Main entry point
│ └── server.ts # MCP server setup and tool registration
└── package.json # Project dependencies and scripts
└── README.md # This file

Contributing

Contributions are welcome! Please feel free to open issues or submit pull requests.

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for API Docs MCP server for API documentation from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/api-docs-mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools