Convert any API documentation into an MCP server
Project description
Convert any API documentation into an MCP server in minutes.
Point it at API docs, and it scrapes, generates an OpenAPI spec, creates a fully functional MCP server you can chat with, and installs it to Cursor or Claude Desktop.
Installation
pip install apitomcp
Or with uv:
uv pip install apitomcp
Quickstart
# Install
pip install apitomcp
# First-time setup (configure your LLM provider)
apitomcp init
# Generate an MCP server from any API docs
apitomcp generate
Restart Cursor/ Claude Desktop and start chatting with your API.
What It Does
- Scrapes API documentation (handles multi-page docs, finds all endpoints)
- Generates OpenAPI 3.1 specs using LLMs (parallel processing for speed)
- Detects authentication requirements (OAuth2, Bearer tokens, API keys)
- Creates MCP servers that Cursor can use as tools
- Handles OAuth2 token refresh automatically
Features
- Multi-page scraping - Crawls linked pages to find all API endpoints
- Parallel LLM processing - Generates specs for many endpoints simultaneously
- Smart auth detection - Analyzes docs to detect OAuth2, Bearer, or API key auth
- OAuth2 token refresh - Automatically refreshes expired tokens
- Interactive CLI - Clean prompts for configuration
- Multiple LLM providers - OpenRouter, Anthropic, OpenAI, Gemini
Commands
| Command | Description |
|---|---|
apitomcp init |
First-time setup - configure LLM provider and API key |
apitomcp generate |
Generate an MCP server from API documentation |
apitomcp list |
Show all generated servers |
apitomcp install |
Install servers to Cursor or Claude Desktop |
apitomcp delete |
Remove a generated server |
apitomcp auth |
Update LLM settings |
apitomcp output |
Export server files to current directory |
apitomcp run <name> |
Run a server (typically used by Cursor or Claude Desktop, not manually) |
Example
$ apitomcp generate
# Enter: https://developer.spotify.com/documentation/web-api
# It scrapes 150+ pages, finds 99+ API operations
# Generates OpenAPI spec in parallel
# Detects OAuth2 client credentials auth
# Prompts for your Spotify client ID and secret
Then chat with your API in Cursor:
How It Works
API Docs URL
│
▼
┌─────────────┐
│ Scraper │ BeautifulSoup + MarkItDown
│ (multi-page)│ Extracts endpoints & auth info
└─────────────┘
│
▼
┌─────────────┐
│ Generator │ LLM generates OpenAPI specs
│ (parallel) │ for each endpoint
└─────────────┘
│
▼
┌─────────────┐
│ Validator │ Validates against OpenAPI 3.1
│ │ Auto-retries on errors
└─────────────┘
│
▼
┌─────────────┐
│ Runner │ FastMCP creates tools from spec
│ │ Handles auth & token refresh
└─────────────┘
Supported LLM Providers
- OpenRouter
- Anthropic
- OpenAI
- Gemini
Requirements
- Python 3.10-3.13
- API key for one of the supported LLM providers
Configuration
Config is stored in ~/.apitomcp/:
config.json- LLM provider settingsservers/<name>/- Generated server files
Contributing
Contributions are welcome! If you find a bug or have a feature request, please open an issue. Pull requests are also appreciated—I'll review them as time allows.
Author
Built by @andrew_masek_
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apitomcp-0.1.3.tar.gz.
File metadata
- Download URL: apitomcp-0.1.3.tar.gz
- Upload date:
- Size: 6.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4097c5496b646d9ad9bd46df8dd7282dd35cd03063770373f286fcf112549884
|
|
| MD5 |
b9f5d96ecbd82d9324b9c85e030a1ef3
|
|
| BLAKE2b-256 |
9c701fe44b411c977831e3441b75ebbf6a40be54d7140817a3cb035fae167195
|
File details
Details for the file apitomcp-0.1.3-py3-none-any.whl.
File metadata
- Download URL: apitomcp-0.1.3-py3-none-any.whl
- Upload date:
- Size: 43.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87b83e2285a9d2003e773a8f592180e2d72020ad9215f0c3e228451e71c8f27c
|
|
| MD5 |
24ba296197932d25d08b800372e29aa8
|
|
| BLAKE2b-256 |
b10f856b0ab7bfbca33bb0f5ff44a2a0ed7753e7d8d63c2764b2a4319bd5a546
|