
thoughtworks/mcp4openapi
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
MCP server for any openapi compliant endpoints
Обзор
This is a Proof-of-Concept project implementing a multi-purpose OpenAPI MCP Server that can be used to proxy any OpenAPI compliant API backend with an MCP Server protocol. It is POC for this article about enabling AI Economy over APIs This implementation showcases that MCP capabilities like tools and resources are a direct 1-to-1 mapping for RESTFUL APIs and can be dynamically generated based on their specifications in OpenAPI. We do not need to explicitly and specifically code/build MCP servers for RESTFUL APIs. As an added feature, this implementation allows the addition of MCP Prompts, via configuration files, to enrich the MCP tools & resources generated from the backend APIs.
README
Показан фрагмент оригинального README. Открыть оригинал.
MCP-OpenAPI Model Context Protocol wrapper for OpenAPI compliant endpoints
This is a Proof-of-Concept project implementing a multi-purpose OpenAPI MCP Server that can be used to proxy any OpenAPI compliant API backend with an MCP Server protocol. It is POC for this article about enabling AI Economy over APIs
This implementation showcases that MCP capabilities like tools and resources are a direct 1-to-1 mapping for RESTFUL APIs and can be dynamically generated based on their specifications in OpenAPI. We do not need to explicitly and specifically code/build MCP servers for RESTFUL APIs. As an added feature, this implementation allows the addition of MCP Prompts, via configuration files, to enrich the MCP tools & resources generated from the backend APIs.
The project also comes with an example OpenAPI application hosting some sample banking APIs with some manufactured data, a demo MCP Client application that provides an example use-case of an MCP Client interacting with the MCP Server proxying some sample problems between the sample banking APIs and an LLM (hosting via LMStudio).
Demo/Testing can also be done without the demo MCP application or LM Studio via integrating the MCP server with an MCP enabled tools such as Cursor IDE (tested) or Windsurf (not tested), etc.
All the above are structured under 3 separate folders under this project:
- mcp-openapi is the reference implementation of the OpenAPI MCP proxy
- mcp-test-client is the demo test client with some sample questions based on the manufactured data in the sample banking app
- sample-banking-api is the sample banking application with a number of OpenAPI endpoints and manufactured data
NOTE: This mcp-openapi app is not a replacement for https://github.com/ReAPI-com/mcp-openapi project that is enabling IDEs like Cursor to connect to open api specs to support api development.
🔄 Integration Flow
Sample Banking API ←→ MCP OpenAPI Server ←→ Demo/Test Banking MCP Client ←→ LLM via LM Studio
or
Sample Banking API ←→ MCP OpenAPI Server ←→ Cursor IDE
🏗️ Project Structure
This repository contains three applications:
🔌 mcp-openapi/
This contain the main application, a multi-purpose, configurable MCP server that automatically generates MCP tools and resources from OpenAPI specifications:
- Automatic tool/resource generation from OpenAPI specs
- Token passthrough authentication
- Addition of custom prompt templates
- Multiple deployment modes (stdio/HTTP)
Quick Start:
cd mcp-openapi
npm install
npm run build
npm run dev
The “dev” startup is pre-configured to integrate with the sample banking api app. Please refer to the README in the app folder for more details.
📊 sample-banking-api/
An example Sample banking API implementation with:
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →