MCP server
Technical Preview; added in 9.2.0
Spaces method and path for this operation:
post /s/{space_id}/api/agent_builder/mcp
Refer to Spaces for more information.
WARNING: This endpoint is designed for MCP clients (Claude Desktop, Cursor, VS Code, etc.) and should not be used directly via REST APIs. Use MCP Inspector or native MCP clients instead.
[Required authorization] Route required privileges: read_onechat.
POST
/api/agent_builder/mcp
curl \
--request POST 'https://localhost:5601/api/agent_builder/mcp' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"id":1,"method":"initialize","params":{"clientInfo":{"name":"test-client","version":"1.0.0"},"capabilities":{},"protocolVersion":"2024-11-05"},"jsonrpc":"2.0"}'
Request example
WARNING: DO NOT USE THIS ENDPOINT VIA REST API. These examples are auto-generated and should not be run. Integrate with MCP using MCP Inspector or native MCP clients (Claude Desktop, Cursor, VS Code) instead.
{
"id": 1,
"method": "initialize",
"params": {
"clientInfo": {
"name": "test-client",
"version": "1.0.0"
},
"capabilities": {},
"protocolVersion": "2024-11-05"
},
"jsonrpc": "2.0"
}
Response examples (200)
Example response showing the successful result of communication initialisation over MCP protocol
{
"id": 1,
"result": {
"serverInfo": {
"name": "elastic-mcp-server",
"version": "0.0.1"
},
"capabilities": {
"tools": {
"listChanged": true
}
},
"protocolVersion": "2024-11-05"
},
"jsonrpc": "2.0"
}