https://github.com/javaaidev/openapi-mcp-server
Convert OpenAPI spec to MCP server
https://github.com/javaaidev/openapi-mcp-server
kotlin mcp mcp-server openapi
Last synced: 19 days ago
JSON representation
Convert OpenAPI spec to MCP server
- Host: GitHub
- URL: https://github.com/javaaidev/openapi-mcp-server
- Owner: JavaAIDev
- License: mit
- Created: 2025-08-30T11:36:49.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-11-10T07:40:05.000Z (6 months ago)
- Last Synced: 2025-11-10T09:20:25.684Z (6 months ago)
- Topics: kotlin, mcp, mcp-server, openapi
- Language: Kotlin
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# OpenAPI MCP Server
Convert OpenAPI spec to MCP server, OpenAPI operations as tools.
This MCP server uses `stdio` transport.
## CLI Options
When running the MCP server, an OpenAPI spec is required. It can be either a file path or URL.
The MCP server also provides options to filter operations to be converted as MCP tools. Filter conditions of the same type are combined using `OR`, while filter conditions of different types are combined using `AND`.
Currently supported filter conditions:
| Condition | CLI option | Example |
|--------------|--------------------------|-------------------------------|
| HTTP method | `--include-http-method` | `--include-http-method=GET` |
| Path | `--include-path` | `--include-path=/holidays` |
| Operation Id | `--include-operation-id` | `--include-operation-id=Root` |
| Tag | `--include-tag` | `--include-tag=info` |
The HTTP requests sent to the API can be customized by specifying query parameters and headers.
| Option | CLI option | Example |
|-------------|--------------------------|-----------------------------|
| Query Param | `--query-param` | `--query-param=k1=v1,k2=v2` |
| Header | `--header` | `--header=h1=v1,h2=v2` |
You can run the JAR file to see the CLI help.
```
Usage: openapi-mcp [-hV] [--header=[,...]]...
[--include-http-method=[,
...]]...
[--include-operation-id=[,
...]]... [--include-path=
[,...]]... [--include-tag=[,
...]]... [--query-param=[,
...]]...
Run OpenAPI MCP server
File path or URL of OpenAPI spec
-h, --help Show this help message and exit.
--header=[,...]
Headers (comma separated with format a=b)
--include-http-method=[,...]
Include operations with HTTP methods (comma separated)
--include-operation-id=[,...]
Include operations with id (comma separated)
--include-path=[,...]
Include operations with paths (comma separated)
--include-tag=[,...]
Include operations with tags (comma separated)
--query-param=[,...]
Query params (comma separated with format a=b)
-V, --version Print version information and exit.
```
## How to Run
### Standalone JAR file
Download latest [release JAR file](https://github.com/JavaAIDev/openapi-mcp-server/releases) and run it using `java -jar`.
```sh
java -jar openapi-mcp-server-0.1.4-all.jar https://api.apis.guru/v2/specs/exchangerate-api.com/4/openapi.json
```
### Container
Use Docker or Podman to run the container.
```sh
docker run -i ghcr.io/javaaidev/openapi-mcp-server https://api.apis.guru/v2/specs/exchangerate-api.com/4/openapi.json
```