MCP ExplorerExplorer

Openapi Fetch Mcp

@makomorion 9 months ago
4 MIT
FreeCommunity
AI Systems
A CLI tool that converts OpenAPI endpoints into Model Context Protocol (MCP) tools, allowing seamless API integration with MCP-compatible clients.

Overview

What is Openapi Fetch Mcp

openapi-fetch-mcp is a CLI tool that converts OpenAPI endpoints into Model Context Protocol (MCP) tools, enabling seamless API integration with MCP-compatible clients.

Use cases

Use cases for openapi-fetch-mcp include integrating third-party APIs into applications, creating MCP tools for existing OpenAPI specifications, and facilitating API requests in a structured manner.

How to use

To use openapi-fetch-mcp, you can run it via the command line using ‘npx openapi-fetch-mcp’. You need to set environment variables for API_URL, CUSTOM_HEADERS, and either OPENAPI_URL or OPENAPI_FILE_PATH depending on whether you are using a remote or local OpenAPI specification.

Key features

Key features of openapi-fetch-mcp include fetching OpenAPI YAML from a URL or local file, registering each GET endpoint as an MCP tool, and supporting custom headers and environment variable configuration.

Where to use

openapi-fetch-mcp can be used in any environment where API integration is required, particularly in applications that need to communicate with MCP-compatible clients.

Content

openapi-fetch-mcp

A CLI tool to register OpenAPI endpoints as Model Context Protocol (MCP) tools. You can make API requests through an MCP client such as Cursor.

https://github.com/user-attachments/assets/b8f7e7f9-ca8f-475a-84fc-609e03c7ae96

Features

  • Fetches OpenAPI YAML from a URL or local file (Currently, only YAML format is supported)
  • Registers each GET endpoint as an MCP tool (This library only supports GET requests for safety reasons)
  • Supports custom headers and environment variable configuration

Cursor MCP setting

When using a local OpenAPI spec

When using a remote OpenAPI spec

Environment Variables

  • OPENAPI_URL: URL to the OpenAPI YAML file (optional if using OPENAPI_FILE_PATH)
  • OPENAPI_FILE_PATH: Path to the local OpenAPI YAML file (optional if using OPENAPI_URL)
  • API_URL: Base URL for the API server
  • CUSTOM_HEADERS: (optional) JSON string for custom headers, e.g. ‘{“Authorization”:“Bearer …”}’

Example (Using PokeAPI)

License

MIT

Author

makomori

日本語

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers