API to MCP
Converts any REST API endpoints into MCP tools, enabling AI clients like Cursor and Claude Desktop to call internal services directly.
README
API to MCP
把任意 REST API 端点快速转换成 MCP tools,让 AI 客户端(Cursor、Claude Desktop 等)直接调用你的内网服务。
快速开始
cd api-to-mcp
pip install -r requirements.txt
python main.py --port 8000
- Web UI: http://localhost:8000/ui
- MCP 端点: http://localhost:8000/mcp
使用流程
- 打开配置页面,点击「添加服务」
- 填写服务名称、Base URL、请求头
- 点击「+ 端点」,配置方法、路径、参数、描述
- 点击「发送测试请求」验证 API 可达
- 测试通过后,点击「添加到 MCP」完成注册
MCP 客户端配置
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"my-api": {
"url": "http://your-server:8000/mcp"
}
}
}
配置示例
services:
- name: "user-service"
base_url: "http://192.168.1.100:8080/api"
headers:
Authorization: "Bearer xxx"
endpoints:
- name: "get_user"
method: "GET"
path: "/users/{user_id}"
description: "根据用户ID获取用户信息"
parameters:
- name: "user_id"
type: "string"
required: true
location: "path"
verified: true
架构
┌──────────────┐ ┌──────────────┐ ┌────────────────┐
│ Web UI (/ui)│────▶│ main.py │────▶│ FastMCP Server│
│ 配置/测试 │ │ loader.py │ │ /mcp (HTTP) │
└──────────────┘ │ http_client │ └────────────────┘
└──────────────┘ │
▼
MCP Client
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.