AI 集成(MCP)
其他 MCP 客户端
通过 POST 直接发送 JSON-RPC 2.0 调用 esimoa MCP 服务器的方法。
其他 AI 应用#
Grok、Perplexity、Le Chat、Manus、Genspark、Cursor、VS Code 和 Microsoft Copilot Studio 都可以添加远程 MCP 服务器:创建自定义连接器,填入上面的 URL,认证选择“无”。只支持本地(stdio)服务器的客户端可以使用 mcp-remote:
url
https://api.esimoa.com/mcpmcp-remote (stdio)json
{
"mcpServers": {
"esimoa": { "command": "npx", "args": ["-y", "mcp-remote", "https://api.esimoa.com/mcp"] }
}
}协议#
通过 POST 发送 JSON-RPC 2.0,无需会话,每个请求独立处理。
支持的方法为 initialize、ping、tools/list、tools/call、resources/list 与 resources/read(协议 2024-11-05 至 2025-11-25),并为 2026-07-28 客户端支持 server/discover(无状态,使用 MCP-Protocol-Version 与 Mcp-Method 请求头)。不开启 SSE 流,因此 GET 返回 405。
initialize#
initializeshell
curl -X POST https://api.esimoa.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {},
"clientInfo": { "name": "my-client", "version": "1.0.0" }
}
}'tools/call#
tools/call · search_esimsshell
curl -X POST https://api.esimoa.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "X-API-Key: esk_live_your_key_here" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "search_esims",
"arguments": { "country": "Japan", "days": 7, "sort": "price", "limit": 3, "lang": "en" }
}
}'