OpenAPI MCP Server
Exposes an MCP server over HTTP that allows searching and executing OpenAPI operations from any OpenAPI spec URL, with session variable storage.
README
OpenAPI MCP Server (Hono + Node.js)
This project exposes an MCP server over HTTP using Hono at /mcp.
It gives three tools:
api_search: find operations from an OpenAPI specapi_execute: call one operation byoperationId(ormethod + path)session: store and read session variables (token, ids, etc.)
Requirements
- Node.js 18+ installed
Install
npm install
Run
npm run dev
Server endpoints:
http://localhost:3000/http://localhost:3000/healthhttp://localhost:3000/mcp
Configure environment (optional)
OPENAPI_SPEC_URL: OpenAPI JSON URL (default:https://ag.nischal-dahal.com.np/api-docs-json)OPENAPI_SERVER_FILE_CACHE=1: optional, enable server-side file cache (disabled by default)API_BASE_URL: override API base URL used for executionPORT: HTTP server port (default3000)
If the spec URL is temporarily unavailable (for example 502), the MCP server stays alive and returns a structured tool error with recovery hints instead of crashing.
Set OpenAPI URL via request headers (recommended)
You can provide spec configuration without session storage:
?url=query param on MCP endpoint (recommended for static MCP config)urlheader on MCP requestauthorization: optional auth header used when fetching the spec URL
Example:
POST /mcp?url=api.example.com/openapi.json
authorization: Bearer YOUR_TOKEN
Use with an MCP client
Add an MCP server entry that points to this URL:
{
"mcpServers": {
"openapi-hono": {
"url": "https://dx.lexicon.website/mcp?url=https://ag.nischal-dahal.com.np/api-docs-json"
}
}
}
Where to set the OpenAPI spec URL
You can set the spec URL in three ways:
- MCP URL query (recommended): configure
.../mcp?url=...in your MCP client.
https://your-domain/mcp?url=https://your-api.com/openapi.json
- Per request override: pass
urlinapi_searchorapi_executearguments.
{
"name": "api_search",
"arguments": {
"query": "users list",
"url": "api.example.com/openapi.json"
}
}
Typical usage flow
- Find operations:
{
"name": "api_search",
"arguments": {
"query": "login auth token",
"limit": 10
}
}
- Execute operation:
{
"name": "api_execute",
"arguments": {
"operationId": "auth_login",
"body": {
"email": "user@example.com",
"password": "secret"
},
"extractVariables": {
"token": "$.data.token"
}
}
}
- Reuse stored session token automatically (or inspect with
sessiontool):
{
"name": "session",
"arguments": {
"action": "getVariables"
}
}
Note: only auth/token data is stored in session; OpenAPI URL is not read from session anymore.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.