REST API → MCP Server Bridge

Turn any REST API into an MCP server for Claude, Cursor, and other AI assistants.

⭐ View on GitHub Get Started →

How It Works

🌐

Your REST API

Any HTTP API: SaaS, internal backend, or third-party service

🔌

MCP Bridge

Pydantic validation, error handling, dual-format responses

🤖

AI Assistant

Claude, Cursor, or any MCP-compatible client

The Tools

A complete REST API → MCP pattern with 4 tools demonstrating CRUD operations and real-world patterns.

GET

api_list_posts

List with filtering + pagination

GET

api_get_post

Fetch with optional related data

POST

api_create_post

Create with validated input

PATCH

api_update_post

Partial updates with existence checks

Quick Start

Get the server running in under 2 minutes. All tests pass.

git clone https://github.com/BryceEWatson/mcp-api-bridge.gitcd mcp-api-bridgeuv pip install -e ".[dev]"pytest tests/ -v  # 74 tests pass

✓ Ready to use: All dependencies installed. The server starts immediately with python -m api_bridge_mcp.server

Adapt For Your API

The entire value of this project is the repeatable pattern. You're not locked into JSONPlaceholder. Swap one file and everything else is reusable MCP scaffolding.

The Key Insight

"Swap the API client (one file) to point at your REST API. The MCP tools, validation, and response formatting are all reusable."

What You Change

  1. Update api_client.py: base URL, auth headers
  2. Replace Pydantic models: your domain (orders, users, etc.)
  3. Register new tools: same @mcp.tool pattern
  4. Update Claude Desktop config

See the README for full step-by-step examples with actual code snippets.

# Before (JSONPlaceholder)
- base_url = "https://jsonplaceholder.typicode.com"
- class Post(BaseModel): ...

# After (Your API)
+ base_url = "https://api.your-service.com/v1"
+ class Order(BaseModel): ...
+ headers = {"Authorization": "Bearer YOUR_KEY"}

74 tests ensure correctness through the refactor.

Input validation, pagination, error handling, and dual-format responses all stay the same.