# Api To Mcp

> Convert any API documentation into an MCP server for Cursor

- **Type:** MCP server
- **Install:** `agentstack add mcp-portoaj-api-to-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [portoaj](https://agentstack.voostack.com/s/portoaj)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [portoaj](https://github.com/portoaj)
- **Source:** https://github.com/portoaj/api-to-mcp

## Install

```sh
agentstack add mcp-portoaj-api-to-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

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

```bash
pip install apitomcp
```

Or with [uv](https://docs.astral.sh/uv/):

```bash
uv pip install apitomcp
```

## Quickstart

```bash
# 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

1. **Scrapes** API documentation (handles multi-page docs, finds all endpoints)
2. **Generates** OpenAPI 3.1 specs using LLMs (parallel processing for speed)
3. **Detects** authentication requirements (OAuth2, Bearer tokens, API keys)
4. **Creates** MCP servers that Cursor can use as tools
5. **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 ` | Run a server (typically used by Cursor or Claude Desktop, not manually) |

## Example

```bash
$ apitomcp generate

# Enter: https://developer.themoviedb.org/docs/
# Enter your API Read Access Token from https://www.themoviedb.org/settings/api
```

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 settings
- `servers//` - Generated server files

## Limitations

This is a work in progress. The LLM-based operation extraction and auth detection aren't perfect—some APIs may need manual tweaking of the generated spec. If you run into issues or have improvements, Issues/ PRs are welcome!

## Contributing

Contributions are welcome! If you find a bug or have a feature request, please [open an issue](https://github.com/portoaj/api-to-mcp/issues). Pull requests are also appreciated—I'll review them as time allows.

## Author

Built by [@andrew_masek_](https://x.com/andrew_masek_)

## License

MIT

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [portoaj](https://github.com/portoaj)
- **Source:** [portoaj/api-to-mcp](https://github.com/portoaj/api-to-mcp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-portoaj-api-to-mcp
- Seller: https://agentstack.voostack.com/s/portoaj
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
