
Openapi Mcp
io.github.Asthanaji05Published by GitHub account Asthanaji05v0.1.1Updated Oct 24, 2026
Turn any OpenAPI 3 spec into a working MCP server. One file, local (stdio) or remote (HTTP).
Overview
Turns any OpenAPI 3 spec into an MCP server, exposing each API endpoint as a tool an assistant can call over stdio or HTTP.
- What you can do
- Load an OpenAPI 3 spec from a URL or local file and build one tool per operation, named by operationId.
- Call API endpoints: each tool call makes the real HTTP request and returns the status plus response body.
- Filter which endpoints are exposed with a regex on tool names, for example to keep only read-only operations.
- Authenticate upstream calls from environment variables: bearer, basic, API keys, or OAuth2 client-credentials and refresh-token grants.
- Serve the tools locally over stdio or as a self-hosted HTTP endpoint.
- When to use it
- Use it when an API you already have an OpenAPI 3 spec for should be callable by an AI client without writing per-endpoint code. It suits small public APIs or internal services where you want a quick, dependency-free bridge, and you can hand-write a short spec for APIs that only have HTML docs.
- Requirements
- Node.js 18 or newer; the server is a single script run with node. A spec as a URL or local JSON file (YAML needs the yaml package). Credentials as environment variables when the API needs them: API_TOKEN, OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET, OAUTH_REFRESH_TOKEN, optionally OAUTH_TOKEN_URL, OAUTH_SCOPE, API_HEADERS. HTTP mode requires MCP_AUTH_TOKEN for client access.
Installation
In SourceWeft
- Open Openapi Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
OpenAPI MCP
Turn any OpenAPI 3 spec into a working MCP server. One file, about 130 lines, no dependencies.
Every API endpoint becomes a tool that an AI client (Claude, Cursor, etc.) can call. There is no code generation and no per-endpoint files. The spec is read at startup, and the tools are built in memory.
Quick start
Requires Node 18 or newer.
It prints openapi-mcp: 4 tools from "Animechan" -> ... and then waits silently for an MCP client. That is normal: it talks JSON-RPC over stdin/stdout and is not meant to be read by humans.
Use it with an AI client
Claude Desktop (local mode)
Add this to ~/Library/Application Support/Claude/claude_desktop_config.json, then restart the app:
If the client can't find node, use the full path from which node.
Claude Code (remote mode)
Start the server, then register it:
Then ask in plain English: "give me a random quote from Naruto".
Two modes
In HTTP mode, clients send JSON-RPC messages as POST http://host:<port>/mcp. Put --http <port> last.
Test it by hand:
Options
Big APIs can have hundreds of endpoints. Too many tools makes the model choose worse, so use TOOL_FILTER to keep the useful ones.
Authentication
The server reads securitySchemes from the spec and puts your secret in the right place. You only supply the secret as an environment variable:
Example for Claude Desktop:
Notes:
- If the spec declares a security scheme but no credentials are set, a warning is printed to stderr at startup.
- If the spec lists several schemes, the first one in the top-level
securitylist is used (or the first one defined). Per-endpointsecurityoverrides are not applied, so the secret is sent on every call. - OAuth client credentials are sent as HTTP Basic auth to the token endpoint.
- The OAuth browser login (authorization-code flow) is not built in. Get a token or refresh token once with your provider's tools, then pass it in.
- If a provider rotates refresh tokens, the new one is kept in memory only, so it is lost on restart.
How it works
- Load the spec and resolve
$refpointers. - Build tools: each operation becomes one MCP tool.
operationIdis the name,summarythe description, and parameters plus request body the input schema. - Call: a tool call makes the real HTTP request and returns
HTTP <status>followed by the response body (cut at 50,000 characters). - Serve the tools over JSON-RPC 2.0, via stdio or HTTP.
APIs without an OpenAPI spec
Many small public APIs only have HTML docs. For those, write a small spec by hand (see sample/animechan.openapi.json, 4 tools in about 35 lines), then run it the same way.
Limitations
- OpenAPI 3 only. Convert Swagger 2.0 specs first.
- JSON request bodies only. No file uploads.
- Auth: bearer, basic, API keys, and OAuth2 client-credentials or refresh-token. There is no interactive OAuth login, and one scheme is used per API.
- HTTP mode speaks plain HTTP (put HTTPS in front when deploying) and has no streaming, batch requests, or OAuth for clients connecting to the server (it only supports the
MCP_AUTH_TOKENbearer token). Some remote clients may require these. - HTTP mode speaks plain HTTP (put HTTPS in front when deploying) and has no streaming, batch requests, or OAuth. Some remote clients may require these.
- If you deploy remotely, every user shares your server's IP, so upstream rate limits apply to all of them. Set
MCP_AUTH_TOKEN, or anyone who finds the URL can use your API key.
Contributing
Issues and pull requests are welcome. The goal is to stay small and readable, so please keep new features to a few lines each.
Source: README.md at commit 0990a08
Tools
0Version history
1- v0.1.1LatestOct 12, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.