AI Services/Agent
Call MCP
Stateless MCP Streamable HTTP endpoint for Agent tools. The response is JSON.
Send X-Api-Key, or Authorization: Bearer <API Key>. A missing or invalid key does not return 401. The session falls back to anonymous and only exposes aitoearn_connection_help. The legacy path POST /api/unified/mcp is forwarded to this endpoint.
POST
/
api
/
ai
/
agent
/
mcp
Call MCP
curl --request POST \
--url https://aitoearn.cn/api/ai/agent/mcp \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}
'import requests
url = "https://aitoearn.cn/api/ai/agent/mcp"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'tools/list'})
};
fetch('https://aitoearn.cn/api/ai/agent/mcp', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/ai/agent/mcp"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"tools/list\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "AgentMcpController_handleStreamablePost_example",
"object": "response"
}Authorizations
Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".
Body
application/json
MCP JSON-RPC request body.
Response
Native third-party protocol response or SSE data, not wrapped in the AiToEarn common response envelope.
Native third-party protocol response, not wrapped in the AiToEarn common response envelope.
Last modified on September 29, 2026
⌘I
Call MCP
curl --request POST \
--url https://aitoearn.cn/api/ai/agent/mcp \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}
'import requests
url = "https://aitoearn.cn/api/ai/agent/mcp"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'tools/list'})
};
fetch('https://aitoearn.cn/api/ai/agent/mcp', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/ai/agent/mcp"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"tools/list\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "AgentMcpController_handleStreamablePost_example",
"object": "response"
}
