Skip to main content

API2MCP

Universal API to MCP Server Converter with LangGraph Orchestration

CI PyPI version Python versions License: MIT Coverage

Convert any REST/GraphQL API into a fully functional MCP (Model Context Protocol) server, and orchestrate intelligent multi-API workflows using LangGraph.

Features

  • 🔄 Automatic Conversion: OpenAPI, GraphQL, Postman → MCP Server
  • 🔐 Enterprise Security: OAuth 2.0, API keys, secret management
  • 🧠 Intelligent Orchestration: LangGraph-powered multi-API workflows
  • 💾 State Persistence: Checkpoint-based workflow recovery
  • 🔌 Extensible: Plugin architecture for custom integrations

Quick Start

# Install
pip install api2mcp

# Generate MCP server from OpenAPI spec
api2mcp generate --spec openapi.yaml --output ./server

# Run the server
api2mcp serve ./server

LangGraph 1.0 Orchestration

from api2mcp import MCPToolRegistry, PlannerGraph
from langchain_anthropic import ChatAnthropic
from langgraph.checkpoint.sqlite import SqliteSaver

# Register MCP servers
registry = MCPToolRegistry()
await registry.connect_server("github", github_config)
await registry.connect_server("jira", jira_config)

# Create orchestrator with official checkpointer
orchestrator = PlannerGraph(
    model=ChatAnthropic(model="claude-sonnet-4-5-20250929"),
    tool_registry=registry,
    api_names=["github", "jira"],
    checkpointer=SqliteSaver.from_conn_string("workflows.db"),
    execution_mode="mixed"  # parallel for independent steps
)

# Run complex workflow
result = await orchestrator.run(
    "Sync all GitHub bugs to Jira project SUPPORT"
)

Documentation

Development

Prerequisites

  • Python 3.11+
  • pip or any PEP 517-compatible build tool

Setup

# Clone and install in editable mode with dev dependencies
git clone https://github.com/manavghosh/api2mcp.git
cd api2mcp
pip install -e ".[dev]"

Optional extras

pip install -e ".[dev,graphql]"    # add GraphQL parser support
pip install -e ".[dev,postgres]"   # add PostgreSQL checkpointer
pip install -e ".[dev,docs]"       # add MkDocs documentation tooling

Running tests

pytest                        # run full test suite
pytest tests/unit/            # unit tests only
pytest -m "not e2e"           # skip end-to-end tests
pytest --no-cov               # skip coverage (faster)

Linting and type-checking

ruff check .                  # lint
ruff format .                 # format
mypy src/                     # type-check

Building the package

pip install build
python -m build               # produces dist/*.whl and dist/*.tar.gz

Building the documentation site

pip install -e ".[docs]"
mkdocs serve                  # live-reload preview at http://127.0.0.1:8000
mkdocs build --strict         # static build into site/

Project Structure

api2mcp/
├── src/api2mcp/         # Source code
│   ├── orchestration/   # LangGraph integration
│   │   ├── adapters/    # MCP-to-LangChain adapters
│   │   ├── graphs/      # Workflow patterns
│   │   └── state/       # State management
│   └── ...
├── tests/               # Test suite
├── docs/                # Documentation source (MkDocs)
├── examples/            # Usage examples
└── demo/                # Runnable demos

Acknowledgements

API2MCP was built with the assistance of Claude (Anthropic). The product vision, architecture decisions, specifications, and every design trade-off were directed by the project author. Claude served as the implementation tool — the same way a framework or a compiler is a tool.

Key open source projects that power API2MCP:

Project Role
LangGraph Orchestration graph engine
MCP SDK Model Context Protocol runtime
Pydantic Data validation
httpx Async HTTP client
Click CLI framework
Rich Terminal output
MkDocs Material Documentation site

Contributing

Contributions are welcome! Please read CONTRIBUTING.md and our Code of Conduct before submitting a pull request.

License

MIT License - see LICENSE for details.

Metadata

Release files for api2mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for api2mcp 0.1.0
File Size Uploaded Provenance
api2mcp-0.1.0.tar.gz 547.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for api2mcp 0.1.0
File Interpreter ABI Platform
api2mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 828.4 kB

Release files / api2mcp-0.1.0.tar.gz

Download URL api2mcp-0.1.0.tar.gz
Size 547.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9a2a39e1707aab0b5b2a21ac716e1b9fb125823e7b64bfab272ab98f0806ec3f
BLAKE2b-256 checksum
How to use checksums
c9e0b40ea35791c590609d9d777589d916d58d2f60a09cbae0ca81f4d9349959
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 11, 2026.

Transparency log

Release files / api2mcp-0.1.0-py3-none-any.whl

Download URL api2mcp-0.1.0-py3-none-any.whl
Size 281.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3811115c0f2a1ee50fd1cecb5f6ec0f71ae4fd1a3e33a5836473d559fa323834
BLAKE2b-256 checksum
How to use checksums
0424fd2408c1247c07592fdcd4594dd0d5f01e986e32722d35b066f128b6b984
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 11, 2026.

Transparency log

Security for api2mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for api2mcp-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page