loading…
Search for a command to run...
loading…
Discovers, inspects, and executes requests against OpenAPI or Swagger APIs directly from documentation URLs or specification files. It enables users to trace pa
Discovers, inspects, and executes requests against OpenAPI or Swagger APIs directly from documentation URLs or specification files. It enables users to trace parameter usage across an API and perform authenticated HTTP requests through a structured toolset.
@rekl0w/mcp-openapi-discovery is a TypeScript MCP server that can:
It is designed for documentation-first API workflows where you want an MCP client to move from "find the spec" to "understand the endpoint" to "call the endpoint".
Published package:
Release resources:
Many APIs expose documentation pages, but not always the raw spec URL directly. This server helps bridge that gap by discovering the OpenAPI document behind a docs page and turning it into callable MCP tools.
It is especially useful for:
openapi.json, swagger.json, openapi.yaml, or swagger.yamlspecId for each detected spec so later tools can work without re-exposing the full documentspecId-based tools can survive process restartsuserId, accountId, or teamId appear across parameters and schemas$ref files and remote schema references into a local in-memory document before analysisdetect_openapi: detects the OpenAPI document behind a docs page or spec URL and returns a summarylist_endpoints: lists endpoints with optional filteringsearch_endpoints: searches cached endpoints for a detected spec using server-side weighted scoringsuggest_call_sequence: suggests a likely prerequisite call chain for a target endpoint or a natural-language goalget_endpoint_details: returns request / response details for a single endpointtrace_parameter_usage: traces where a parameter or field is used across parameters, request bodies, and response bodiesfind_related_endpoints: finds endpoints related to a source endpoint through shared resources, identifiers, and path structurecall_endpoint: executes a real request against an endpoint discovered from the OpenAPI documentInstall from npm:
npm i @rekl0w/mcp-openapi-discovery
Or install project dependencies when working from source:
npm install
npm run build
Run the stdio MCP server after building:
node dist/index.js
For development:
npm run dev
The easiest way to use the published package in MCP clients is to let the client auto-install and run it through npx.
npxIf your MCP client supports a command + args stdio server definition, use:
{
"command": "npx",
"args": ["-y", "@rekl0w/mcp-openapi-discovery"]
}
This is usually the cleanest setup for clients such as VS Code and Cursor-like MCP clients because the package is downloaded automatically when the server starts.
.vscode/mcp.json)VS Code supports mcp.json and can run local MCP servers through npx.
{
"servers": {
"openapi-discovery": {
"command": "npx",
"args": ["-y", "@rekl0w/mcp-openapi-discovery"]
}
}
}
For MCP clients that use a JSON config with mcpServers, a typical setup looks like this:
{
"mcpServers": {
"openapi-discovery": {
"command": "npx",
"args": ["-y", "@rekl0w/mcp-openapi-discovery"]
}
}
}
If you prefer to run the local build directly instead of using npm, point your MCP client at dist/index.js.
Add this to %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"openapi-discovery": {
"command": "node",
"args": ["C:/absolute/path/to/project/dist/index.js"]
}
}
}
Use an absolute path. On Windows, either forward slashes or escaped backslashes work.
https://example.com/docsspecId, and search only the most relevant endpointsspecId, and reuse it across restarts via persistent cachehttps://api.example.com/openapi.jsonPUT /users/{id} endpointPOST endpoints tagged with usersuserId appears across the APIGET /users/{id}POST /orders request with a JSON payloadBeyond plain endpoint listing, this server can help answer questions like:
userId used?”GET /users/{id}?”This now combines structured analysis with lightweight server-side endpoint search. Instead of only doing natural-language similarity on the client, the server can inspect and score:
userId, accountId, teamId, or entity-specific id fieldsspecId + search_endpoints flowRun detect_openapi first and keep the returned specId.
Then call search_endpoints with that specId and a natural-language query such as:
create user emailrefresh bearer tokenorder status updateThe server builds a searchable text index per endpoint from:
This keeps endpoint retrieval on the server side and returns only the top matches.
The search scorer also adds intent-aware bonuses so queries like add order, login token, or edit product can still match createOrder, auth endpoints, and PATCH/PUT style operations without embeddings.
suggest_call_sequence flowUse suggest_call_sequence when the hard part is not finding the endpoint, but figuring out the order of dependent calls.
It can work in two modes:
targetMethod + targetPathgoalThe server analyzes:
categoryId, attributeId, fileId, or parentIdid, accessToken, or resource-specific identifiersThis makes it possible to suggest chains like:
Detected specs are cached to disk and keyed by both normalized input URL and specId.
That means search_endpoints and suggest_call_sequence can keep working even after the process restarts, as long as the cached spec is still within the cache TTL.
If needed, you can override the cache directory with the MCP_OPENAPI_DISCOVERY_CACHE_DIR environment variable.
Use trace_parameter_usage when you want to follow a field such as userId across the API surface.
Use find_related_endpoints when you already know one endpoint and want to discover nearby or dependent endpoints, such as child resources or endpoints using the same identifiers.
The call_endpoint tool can execute actual API calls, not just describe them.
Supported auth strategies:
basicbearerapiKeyoauth2-passwordoauth2-client-credentialsautoIn auto mode, the tool inspects the endpoint’s effective OpenAPI security requirements and tries to apply the most appropriate authentication strategy from the credentials you provide.
application/x-www-form-urlencodedmultipart/form-datarawBodyYou can also override the outgoing content type explicitly with contentType.
call_endpoint inputs{
"url": "https://orders.example.com/openapi.json",
"method": "POST",
"path": "/orders",
"body": {
"productId": 42,
"quantity": 3
},
"auth": {
"apiKey": "your-api-key"
}
}
{
"url": "https://auth.example.com/openapi.json",
"method": "GET",
"path": "/me",
"auth": {
"username": "demo",
"password": "super-secret",
"clientId": "client",
"clientSecret": "client-secret",
"scopes": ["profile"]
}
}
{
"url": "https://api.example.com/openapi.json",
"method": "GET",
"path": "/users/{id}",
"pathParams": {
"id": 123
},
"query": {
"include": ["roles", "permissions"]
}
}
{
"url": "https://api.example.com/openapi.json",
"method": "GET",
"path": "/profile",
"auth": {
"strategy": "bearer",
"token": "your-access-token"
}
}
Run the full verification suite with:
npm run check
This runs:
@modelcontextprotocol/sdk v1$ref supportspecIdvitestIssues and pull requests are welcome.
If you want to contribute:
npm run checkMIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-openapi-discovery": {
"command": "npx",
"args": []
}
}
}