packages/cloud-frontend/content/mcps.mdx
import { Callout, Steps, Tabs, Cards } from "@/docs/components";
Extend your agents with external tools and services using the Model Context Protocol.
<div className="status-badge status-stable">Stable</div> <Callout type="info"> This page covers **connecting MCP servers to your agents**. For protocol details and building your own MCP server, see [MCP Protocol](/docs/mcp). </Callout>MCP (Model Context Protocol) allows agents to:
Browse and connect MCP servers at Dashboard → MCPs.
curl -X POST "https://elizacloud.ai/api/v1/mcps" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Weather MCP",
"url": "https://mcp.eliza.ai/weather",
"agentId": "agent_abc123"
}'
elizaOS Cloud provides a curated registry of MCP servers:
| Server | Description | Tools |
|---|---|---|
| Weather | Current weather and forecasts | get_weather, get_forecast |
| Search | Web search capabilities | search_web, search_images |
| Crypto | Cryptocurrency data | get_price, get_market_data |
| Calculator | Math operations | calculate, convert_units |
| Time | Time and timezone tools | get_time, convert_timezone |
curl -X GET "https://elizacloud.ai/api/mcp/registry" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"servers": [
{
"id": "weather",
"name": "Weather MCP",
"description": "Get weather data for any location",
"url": "https://mcp.eliza.ai/weather",
"tools": [
{
"name": "get_weather",
"description": "Get current weather for a location",
"inputSchema": {
"type": "object",
"properties": {
"location": { "type": "string" }
}
}
}
]
}
]
}
Provide the server URL and any required authentication.
Connect the MCP server to your agent.
Verify the tools are available in the agent.
</Steps>curl -X POST "https://elizacloud.ai/api/v1/mcps" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My MCP Server",
"url": "https://my-mcp-server.com",
"agentId": "agent_abc123",
"authentication": {
"type": "bearer",
"token": "mcp_token_xxx"
}
}'
When MCP servers are connected, agents can use their tools automatically:
const response = await fetch("https://elizacloud.ai/api/v1/chat/completions", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "agent_abc123", // Agent with MCP connected
messages: [{ role: "user", content: "What's the weather in Tokyo?" }],
}),
});
The agent will automatically invoke the get_weather tool and include the result in its response.
elizaOS Cloud exposes an MCP-compatible JSON-RPC interface:
curl -X POST "https://elizacloud.ai/api/mcp" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/list",
"id": 1
}'
| Method | Description |
|---|---|
tools/list | List available tools |
tools/call | Execute a tool |
resources/list | List available resources |
resources/read | Read a resource |
prompts/list | List available prompts |
prompts/get | Get a prompt |
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "get_weather",
"arguments": {
"location": "San Francisco"
}
},
"id": 2
}
Response:
{
"jsonrpc": "2.0",
"result": {
"content": [
{
"type": "text",
"text": "Current weather in San Francisco: 65°F, Partly Cloudy"
}
]
},
"id": 2
}
Your MCP server must implement:
initialize, tools/list, tools/call// Simple MCP server with Express
const express = require("express");
const app = express();
app.use(express.json());
const tools = [
{
name: "greet",
description: "Greet a person",
inputSchema: {
type: "object",
properties: {
name: { type: "string" },
},
required: ["name"],
},
},
];
app.post("/mcp", (req, res) => {
const { method, params, id } = req.body;
if (method === "tools/list") {
return res.json({
jsonrpc: "2.0",
result: { tools },
id,
});
}
if (method === "tools/call") {
const { name, arguments: args } = params;
if (name === "greet") {
return res.json({
jsonrpc: "2.0",
result: {
content: [{ type: "text", text: `Hello, ${args.name}!` }],
},
id,
});
}
}
res.json({
jsonrpc: "2.0",
error: { code: -32601, message: "Method not found" },
id,
});
});
app.listen(3000);
elizaOS Cloud provides demo MCP servers for testing:
| Server | URL | Description |
|---|---|---|
| Weather | /api/mcps/weather | Weather data demo |
| Time | /api/mcps/time | Time and timezone demo |
| Crypto | /api/mcps/crypto | Cryptocurrency data demo |
curl -X POST "https://elizacloud.ai/api/mcps/weather" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "get_weather",
"arguments": { "location": "New York" }
},
"id": 1
}'
curl -X GET "https://elizacloud.ai/api/v1/mcps?agentId=agent_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
curl -X DELETE "https://elizacloud.ai/api/v1/mcps/mcp_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
Share your MCP server in the registry:
curl -X POST "https://elizacloud.ai/api/v1/mcps/{mcpId}/publish" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"visibility": "public",
"description": "My custom MCP server",
"category": "utilities"
}'