---
type: api
title: MCP server
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-post-agent-builder-mcp
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-post-agent-builder-mcp
products:
  - Kibana
---

# MCP server

Availability: 9.2+

- Server: `https://{kibana_url}`

## Paths

- `POST` `/api/agent_builder/mcp`
- `POST` `/s/{space_id}/api/agent_builder/mcp`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/authentication#basicauth)

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

> warn
> 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.
To learn more about the Agent Builder MCP server, refer to the [MCP documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/mcp-server).<br/><br/>[Required authorization] Route required privileges: agentBuilder:read.

## Query String Parameters

- `namespace` (string)
  Comma-separated list of namespaces to filter tools. Only tools matching the specified namespaces will be returned.

## Request Body

`application/json`

Type: `object`


## Response

Indicates a successful response

## Code Examples

#### Console

```console
POST /api/agent_builder/mcp
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "initialize",
  "params": {
    "capabilities": {},
    "clientInfo": {
      "name": "test-client",
      "version": "1.0.0"
    },
    "protocolVersion": "2024-11-05"
  }
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/agent_builder/mcp" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "initialize",
  "params": {
    "capabilities": {},
    "clientInfo": {
      "name": "test-client",
      "version": "1.0.0"
    },
    "protocolVersion": "2024-11-05"
  }
}'
```

## Response Examples

#### Mcp initialize response

Example response showing the successful result of communication initialisation over MCP protocol

```json
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "capabilities": {
      "tools": {
        "listChanged": true
      }
    },
    "protocolVersion": "2024-11-05",
    "serverInfo": {
      "name": "elastic-mcp-server",
      "version": "0.0.1"
    }
  }
}
```

