MCP Server for Turning OpenAPI Specifications into a MCP Resource (github.com)

🤖 AI Summary
A new MCP (Model Context Protocol) server package exposes REST APIs described by OpenAPI specs as MCP resources so LLMs can discover and invoke API endpoints natively. You can run it instantly with npx @ivotoby/openapi-mcp-server (CLI) or embed the OpenAPIServer class in Node.js apps. It supports two transports: stdio (default) for direct integration with clients like Claude Desktop or Cursor, and an HTTP transport (with session management via Mcp-Session-Id and Server-Sent Events for streaming tool execution/results). The server accepts OpenAPI specs from a URL, local file, stdin, or inline string, parses JSON/YAML automatically, and configures endpoints via env vars/CLI flags (API_BASE_URL, OPENAPI_SPEC_PATH, API_HEADERS, etc.). This matters because it turns arbitrary OpenAPI-described services into discoverable, LLM-accessible tools, enabling more reliable tool use, composable API calls, and safer automation in agentic workflows. Developers get fine-grained control: tool loading modes (all, dynamic meta-tools, explicit), filters by tag/resource/method, custom AuthProvider hooks, and container-friendly spec loading. HTTP mode validates Origin headers and binds to localhost by default to reduce exposure; consider extra auth if you expose it externally. Overall, the project lowers the friction for integrating real APIs into model-driven applications while offering extensibility for production deployments.
Loading comments...
loading comments...