---
type: api
title: MCP server
description: > warn
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-post-agent-builder-mcp
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-post-agent-builder-mcp
products:
  - Kibana
---

# MCP server

Availability: Generally available since 9.2

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

## Paths

- `POST` `/api/agent_builder/mcp`

## Description

> 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).

## Required authorization

- Privileges: `agentBuilder:read`

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Query string parameters

- `namespace` (string) — optional
  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

`application/json`

## Code examples

#### Console

```console
POST kbn:/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 "${KIBANA_URL}/api/agent_builder/mcp" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -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"
    }
  }
}
```

