How to Convert Any REST API into an MCP Server
Complete guide to converting REST APIs into MCP servers for Claude, ChatGPT, and Copilot. Transform any REST endpoint into an AI-ready tool with AnythingMCP.
Why Convert REST APIs to MCP?
The Model Context Protocol (MCP) is the standard that lets AI assistants like Claude, ChatGPT, and Copilot interact with external tools. By converting your REST API into an MCP server, you allow AI agents to call your endpoints using natural language — no custom code needed.
What You Need
- A REST API (any API with HTTP endpoints)
- Docker installed on your machine
- An MCP-compatible AI client (Claude Desktop, Claude.ai, ChatGPT, Copilot, Cursor, etc.)
Step-by-Step: Convert Your REST API
Step 1: Deploy AnythingMCP
git clone https://github.com/HelpCode-ai/anythingmcp.git
cd anythingmcp && docker compose up -d
This starts the backend (port 4000), the dashboard (port 3000), and PostgreSQL.
Step 2: Create a REST Connector
Open the dashboard at http://localhost:3000 and create a new REST connector. You can import your API from:
- OpenAPI/Swagger spec — Paste the URL or upload the JSON/YAML file
- Postman Collection — Import a Postman export directly
- cURL commands — Paste cURL commands and AnythingMCP parses them into endpoints
Step 3: Configure Authentication
Set up your API's authentication method in the connector settings:
- Bearer Token
- API Key (header or query)
- Basic Auth
- OAuth 2.0
Environment variables can be used for secrets so they stay out of your config.
Step 4: Review Auto-Generated MCP Tools
AnythingMCP automatically converts each REST endpoint into an MCP tool. Review tools in the dashboard, customize names and descriptions, and hide any endpoints you don't want exposed.
Step 5: Connect to Your AI Assistant
Add the MCP server to your AI client config:
{
"mcpServers": {
"my-api": {
"url": "http://localhost:4000/mcp"
}
}
}
Now your AI assistant can call your REST API endpoints through natural language.
Works With All Major AI Tools
- Claude Desktop / Claude.ai — Full MCP support
- ChatGPT — Via MCP plugin
- Microsoft Copilot — MCP integration
- Cursor — Built-in MCP support
- Windsurf — Native MCP support
Best Practices
- Start read-only — Expose GET endpoints first, then add write operations
- Use meaningful names — Rename tools in the dashboard for clarity
- Add descriptions — Help AI agents understand what each tool does
- Set rate limits — Protect your API from excessive calls
Next Steps
- Convert SOAP to MCP — For legacy SOAP services
- Convert GraphQL to MCP — For GraphQL APIs
- Connect Your Database to MCP — For direct DB access