How to host an HTTP API as an MCP server
You already have an HTTP API. In a few minutes you can turn it into a standard MCP tool that Claude, Cursor, Doubao and other agents can call — without writing a line of glue code.
Step 1 — Create an API key.Sign up at the
console and create a personal access token (starts with
sk-).
Step 2 — Register your API as a service.
In Service Management, add your HTTP endpoint: the URL, request method, headers, and the input schema for the arguments your agent will pass.
Step 3 — Get your MCP endpoint.
The console gives you a ready-made Streamable HTTP endpoint for your service.
Step 4 — Connect it to any agent.
Add the endpoint to your MCP client config:
{
"mcpServers": {
"my-api": {
"type": "streamableHttp",
"url": "https://mcp.xn--5kvtwv52d.com/mcp/gateway",
"headers": { "Authorization": "Bearer ${JIZHINENG_API_KEY}" }
}
}
}
Step 5 — Ask your agent to use it.
Your API is now a callable tool. The gateway handles auth, metering, and adapts the tool to each platform automatically.
Why use a gateway instead of hand-coding an MCP server
- No transport code — a ready-made Streamable HTTP endpoint.
- Multi-platform for free — one tool, auto-adapted to Doubao, Tongyi, Wenxin, Claude, Cursor.
- Unified auth & metering — centralized API keys and a usage dashboard.
- Cross-agent settlement — a built-in settlement ledger for multi-agent task accounting.
Not sure which option fits? Read best MCP gateway for a full comparison.
What is an MCP gateway? ·
Gateway endpoint ·
中文教程