### Local Development Setup Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Installs dependencies and starts the local Cloudflare Worker for development. Use `wrangler dev` to run the server locally. ```bash # 1. Install dependencies npm install # 2. Start the local worker (default: http://localhost:8787) npx wrangler dev ``` -------------------------------- ### Run Local Development Server Source: https://github.com/janwilmake/openapi-mcp-server/blob/main/README.md Use this command to start the local development server for the OpenAPI MCP Server. Ensure you have Wrangler installed. ```bash wrangler dev ``` -------------------------------- ### Run MCP Inspector Source: https://github.com/janwilmake/openapi-mcp-server/blob/main/README.md After starting the server, use this command to run the MCP inspector for testing. This requires the @modelcontextprotocol/inspector package to be installed. ```bash npx @modelcontextprotocol/inspector ``` -------------------------------- ### GET /mcp - Server Info Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt A plain GET request to the /mcp endpoint returns server initialization information. This is useful for health checks and initial client probing before establishing a full MCP session. ```bash curl https://openapi-mcp.openapis.com/mcp ``` ```json { "protocolVersion": "2025-06-18", "capabilities": { "tools": {} }, "serverInfo": { "name": "openapi-mcp-server", "version": "2.2.0", "title": "OpenAPI MCP Server", "websiteUrl": "https://openapisearch.com", "description": "Explore and interact with OpenAPI specifications through MCP." }, "instructions": "Use 'getApiOverview' first to understand an API's structure, then use 'getApiOperation' to get details about specific endpoints." } ``` -------------------------------- ### GET /mcp - Server Info & Initialization Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt A plain GET request to the /mcp endpoint returns the server's initialization result as JSON. This is useful for health checks and initial client probing. ```APIDOC ## GET /mcp ### Description Retrieves server information and initialization details without requiring a JSON-RPC envelope. Useful for health checks and initial client probing. ### Method GET ### Endpoint /mcp ### Response #### Success Response (200) - **protocolVersion** (string) - The supported protocol version. - **capabilities** (object) - Describes the server's capabilities. - **serverInfo** (object) - Contains information about the server. - **name** (string) - The name of the server. - **version** (string) - The version of the server. - **title** (string) - The title of the server. - **websiteUrl** (string) - The website URL of the server. - **description** (string) - A description of the server. - **instructions** (string) - Instructions for using the server's tools. ### Response Example ```json { "protocolVersion": "2025-06-18", "capabilities": { "tools": {} }, "serverInfo": { "name": "openapi-mcp-server", "version": "2.2.0", "title": "OpenAPI MCP Server", "websiteUrl": "https://openapisearch.com", "description": "Explore and interact with OpenAPI specifications through MCP." }, "instructions": "Use 'getApiOverview' first to understand an API's structure, then use 'getApiOperation' to get details about specific endpoints." } ``` ``` -------------------------------- ### POST /mcp - Call getApiOverview with Provider ID Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Calls the 'getApiOverview' tool to retrieve a high-level summary of an API identified by a provider ID (e.g., 'stripe'). The response is a condensed text listing of endpoints, capped at 250,000 characters. This example pipes the output to 'head -20' for brevity. ```bash # Using a known openapisearch.com identifier curl -s -X POST https://openapi-mcp.openapisearch.com/mcp \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "getApiOverview", "arguments": { "id": "stripe" } } }' | jq -r '.result.content[0].text' | head -20 ``` -------------------------------- ### getApiOverview - Get High-Level API Overview Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Resolves an API provider identifier or URL, converts Swagger to OpenAPI 3.x if necessary, and returns a condensed listing of all endpoints with their methods, paths, and summaries. ```APIDOC ## getApiOverview ### Description Provides a high-level overview of an API by resolving a provider identifier or URL. It converts Swagger 2.x to OpenAPI 3.x and returns a plain-text summary of endpoints, including HTTP method, path, query parameters, and a summary. The response is capped at 250,000 characters. ### Method POST ### Endpoint /mcp ### Parameters #### Request Body - **jsonrpc** (string) - Required - Must be "2.0". - **id** (integer | string) - Required - An identifier for the request. - **method** (string) - Required - Must be "tools/call". - **params** (object) - **name** (string) - Required - Must be "getApiOverview". - **arguments** (object) - **id** (string) - Required - The provider identifier (e.g., "stripe") or a direct URL to a raw OpenAPI file. ### Request Example (using identifier) ```json { "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "getApiOverview", "arguments": { "id": "stripe" } } } ``` ### Request Example (using URL) ```json { "jsonrpc": "2.0", "id": 4, "method": "tools/call", "params": { "name": "getApiOverview", "arguments": { "id": "https://petstore3.swagger.io/api/v3/openapi.json" } } } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - "2.0". - **id** (integer | string) - The identifier of the request. - **result** (object) - **content** (array) - An array containing the overview content. - **text** (string) - The plain-text overview of the API endpoints. ### Response Example (truncated text output) ``` Below is an overview of the stripe openapi in simple language. This API contains 312 endpoints. For more detailed information of an endpoint, visit https://oapis.org/summary/stripe/[idOrRoute] Stripe API v1 - https://api.stripe.com ... ``` ``` -------------------------------- ### Get API Operation by operationId Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Fetches a specific API operation using its operationId. Ensure the 'id' parameter correctly identifies the OpenAPI document. ```bash # Look up an operation by operationId curl -s -X POST https://openapi-mcp.openapisearch.com/mcp \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 5, "method": "tools/call", "params": { "name": "getApiOperation", "arguments": { "id": "stripe", "operationIdOrRoute": "listCharges" } } }' | jq -r '.result.content[0].text' ``` -------------------------------- ### Get API Operation by Route Path Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Fetches a specific API operation using its route path. The 'id' parameter must point to a valid OpenAPI document. ```bash # Look up an operation by route path curl -s -X POST https://openapi-mcp.openapisearch.com/mcp \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 6, "method": "tools/call", "params": { "name": "getApiOperation", "arguments": { "id": "https://petstore3.swagger.io/api/v3/openapi.json", "operationIdOrRoute": "/pet/{petId}" } } }' | jq -r '.result.content[0].text' ``` -------------------------------- ### GetApiOperation by Operation ID Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Fetches and dereferences an OpenAPI document, then extracts a specific operation using its `operationId`. This is useful for getting precise schema details for a known operation. ```APIDOC ## getApiOperation (by operationId) ### Description Fetches, converts, and dereferences the OpenAPI document, then extracts exactly one operation (matched by `operationId`) and returns it as a self-contained YAML fragment with all `$ref` pointers resolved. ### Method POST ### Endpoint https://openapi-mcp.openapisearch.com/mcp ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, typically "2.0" - **id** (integer) - Required - Request ID - **method** (string) - Required - Method name, must be "tools/call" - **params** (object) - Required - Parameters for the method call - **name** (string) - Required - The name of the tool to call, must be "getApiOperation" - **arguments** (object) - Required - Arguments for the "getApiOperation" method - **id** (string) - Required - Identifier for the OpenAPI specification (e.g., "stripe", "github") - **operationIdOrRoute** (string) - Required - The `operationId` of the operation to retrieve ### Request Example ```json { "jsonrpc": "2.0", "id": 5, "method": "tools/call", "params": { "name": "getApiOperation", "arguments": { "id": "stripe", "operationIdOrRoute": "listCharges" } } } ``` ### Response #### Success Response (200) - **result** (object) - The result of the JSON-RPC call - **content** (array) - Array containing the operation details - **text** (string) - YAML fragment of the resolved OpenAPI operation ``` -------------------------------- ### Configure MCP Clients Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Instructions for adding the hosted OpenAPI MCP Server to MCP-compatible clients like Claude Desktop and Cursor. ```APIDOC ## Configuring Clients (Claude Desktop / Cursor) ### Description Add the hosted MCP server to any MCP-compatible client using its public URL. No authentication is required. ### Claude Desktop Configuration Add the following to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS): ```jsonc { "mcpServers": { "openapi": { "url": "https://openapi-mcp.openapisearch.com/mcp" } } } ``` ### Cursor Configuration Add the following to `.cursor/mcp.json` inside a project (or global `~/.cursor/mcp.json`): ```jsonc { "mcpServers": { "openapi": { "url": "https://openapi-mcp.openapisearch.com/mcp" } } } ``` ``` -------------------------------- ### Local Development with Wrangler Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Instructions for running the OpenAPI MCP Server locally using Cloudflare's Wrangler and testing it with the MCP Inspector or curl. ```APIDOC ## Local Development & Testing ### Description Run the server locally as a Cloudflare Worker using `wrangler dev` and interact with it via the MCP Inspector or `curl`. ### Steps 1. **Install dependencies**: ```bash npm install ``` 2. **Start the local worker** (default: `http://localhost:8787`): ```bash npx wrangler dev ``` 3. **Open the MCP Inspector** in a separate terminal: ```bash npx @modelcontextprotocol/inspector ``` Then enter `http://localhost:8787/mcp` as the MCP URL in the inspector UI. 4. **Alternatively, test directly with curl** against the local server: ```bash curl -s -X POST http://localhost:8787/mcp \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "getApiOverview", "arguments": { "id": "github" } } }' | jq '.result.content[0].text' ``` ``` -------------------------------- ### POST /mcp - List Available Tools Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Requests a list of available tools using the 'tools/list' method via JSON-RPC 2.0. The server exposes 'getApiOverview' and 'getApiOperation', with descriptions dynamically updated from openapisearch.com. ```bash curl -s -X POST https://openapi-mcp.openapisearch.com/mcp \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} }' | jq '.result.tools[].name' ``` -------------------------------- ### POST /mcp - Initialize MCP Session Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Initiates an MCP session by sending an 'initialize' method via JSON-RPC 2.0 POST request. Requires 'protocolVersion' and 'clientInfo' in the parameters. The response includes server capabilities and information. ```bash curl -s -X POST https://openapi-mcp.openapisearch.com/mcp \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2025-06-18", "clientInfo": { "name": "my-client", "version": "1.0" } } }' ``` ```json # Expected response shape: # { # "jsonrpc": "2.0", # "id": 1, # "result": { # "protocolVersion": "2025-06-18", # "capabilities": { "tools": {} }, # "serverInfo": { "name": "openapi-mcp-server", "version": "2.2.0", ... } # } # } ``` -------------------------------- ### POST /mcp - Call getApiOverview with Direct URL Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Calls the 'getApiOverview' tool with a direct URL to a raw OpenAPI file. The server transparently converts Swagger 2.x to OpenAPI 3.x before processing. The output includes the full JSON response. ```bash # Using a direct URL to a raw OpenAPI file curl -s -X POST https://openapi-mcp.openapisearch.com/mcp \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 4, "method": "tools/call", "params": { "name": "getApiOverview", "arguments": { "id": "https://petstore3.swagger.io/api/v3/openapi.json" } } }' | jq '.result' ``` ```text # Example successful text output (truncated): # "Below is an overview of the stripe openapi in simple language. # This API contains 312 endpoints. For more detailed information # of an endpoint, visit https://oapis.org/summary/stripe/[idOrRoute] # # Stripe API v1 - https://api.stripe.com # ... ``` -------------------------------- ### tools/list - Enumerate Available Tools Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt This method enumerates the tools exposed by the server, namely `getApiOverview` and `getApiOperation`. Tool descriptions are dynamically updated with known API identifiers. ```APIDOC ## tools/list ### Description Enumerates the available tools provided by the server, which include `getApiOverview` and `getApiOperation`. The descriptions for these tools are dynamically enriched with information from `openapisearch.com`. ### Method POST ### Endpoint /mcp ### Parameters #### Request Body - **jsonrpc** (string) - Required - Must be "2.0". - **id** (integer | string) - Required - An identifier for the request. - **method** (string) - Required - Must be "tools/list". - **params** (object) - Optional - This method does not require any parameters. ### Request Example ```json { "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - "2.0". - **id** (integer | string) - The identifier of the request. - **result** (object) - **tools** (array) - A list of available tools. - **name** (string) - The name of the tool. - **description** (string) - A description of the tool. ### Response Example (truncated output of tool names) ```bash curl -s -X POST https://openapi-mcp.openapisearch.com/mcp \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} }' | jq '.result.tools[].name' # "getApiOverview" # "getApiOperation" ``` ``` -------------------------------- ### Configure Claude Desktop MCP Server Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Adds the public OpenAPI MCP server URL to Claude Desktop's configuration. This allows Claude Desktop to use the server for API discovery. ```jsonc // Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) { "mcpServers": { "openapi": { "url": "https://openapi-mcp.openapisearch.com/mcp" } } } ``` -------------------------------- ### Testing Local Worker with Curl Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Tests the locally running MCP server by calling the `getApiOverview` tool. Ensure the server is running via `wrangler dev`. ```bash # 4. Or test directly with curl against the local server curl -s -X POST http://localhost:8787/mcp \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "getApiOverview", "arguments": { "id": "github" } } }' | jq '.result.content[0].text' ``` -------------------------------- ### Configure Cursor MCP Server Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Adds the public OpenAPI MCP server URL to Cursor's configuration. This enables Cursor to integrate with the MCP server for API functionalities. ```jsonc // Cursor — .cursor/mcp.json inside a project (or global ~/.cursor/mcp.json) { "mcpServers": { "openapi": { "url": "https://openapi-mcp.openapisearch.com/mcp" } } } ``` -------------------------------- ### GetApiOperation by Route Path Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt Fetches and dereferences an OpenAPI document, then extracts a specific operation using its route path. This is useful when the `operationId` is unknown but the endpoint path is known. ```APIDOC ## getApiOperation (by route path) ### Description Fetches, converts, and dereferences the OpenAPI document, then extracts exactly one operation (matched by literal path) and returns it as a self-contained YAML fragment with all `$ref` pointers resolved. ### Method POST ### Endpoint https://openapi-mcp.openapisearch.com/mcp ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, typically "2.0" - **id** (integer) - Required - Request ID - **method** (string) - Required - Method name, must be "tools/call" - **params** (object) - Required - Parameters for the method call - **name** (string) - Required - The name of the tool to call, must be "getApiOperation" - **arguments** (object) - Required - Arguments for the "getApiOperation" method - **id** (string) - Required - Identifier for the OpenAPI specification (e.g., "https://petstore3.swagger.io/api/v3/openapi.json") - **operationIdOrRoute** (string) - Required - The literal route path of the operation to retrieve (e.g., "/pet/{petId}") ### Request Example ```json { "jsonrpc": "2.0", "id": 6, "method": "tools/call", "params": { "name": "getApiOperation", "arguments": { "id": "https://petstore3.swagger.io/api/v3/openapi.json", "operationIdOrRoute": "/pet/{petId}" } } } ``` ### Response #### Success Response (200) - **result** (object) - The result of the JSON-RPC call - **content** (array) - Array containing the operation details - **text** (string) - YAML fragment of the resolved OpenAPI operation ``` -------------------------------- ### POST /mcp - JSON-RPC 2.0 Message Dispatch Source: https://context7.com/janwilmake/openapi-mcp-server/llms.txt All MCP interactions are performed via POST requests containing JSON-RPC 2.0 payloads. This endpoint handles various methods including initialization, ping, and tool calls. ```APIDOC ## POST /mcp ### Description Dispatches JSON-RPC 2.0 messages for MCP interactions. Supports methods like `initialize`, `ping`, `notifications/initialized`, `prompts/list`, `resources/list`, `tools/list`, and `tools/call`. ### Method POST ### Endpoint /mcp ### Parameters #### Request Body - **jsonrpc** (string) - Required - Specifies the JSON-RPC protocol version, must be "2.0". - **id** (integer | string) - Required - An identifier for the request. - **method** (string) - Required - The name of the method to call. - **params** (object) - Optional - Parameters for the method call. ### Request Example (initialize) ```json { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2025-06-18", "clientInfo": { "name": "my-client", "version": "1.0" } } } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - "2.0". - **id** (integer | string) - The identifier of the request. - **result** (object) - The result of the method call. #### Response Example (initialize) ```json { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2025-06-18", "capabilities": { "tools": {} }, "serverInfo": { "name": "openapi-mcp-server", "version": "2.2.0", ... } } } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.