﻿---
title: Elastic Agent Builder MCP server
description: Learn how to connect Claude Desktop, Cursor, and VS Code to Elastic Agent Builder tools using the Model Context Protocol (MCP) server.
url: https://www.elastic.co/elastic/docs-builder/docs/3663/explore-analyze/ai-features/agent-builder/mcp-server
products:
  - Elastic Cloud Serverless
  - Elastic Observability
  - Elastic Security
  - Elasticsearch
  - Kibana
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available since 9.3, Preview in 9.2
---

# Elastic Agent Builder MCP server
The [**Model Context Protocol (MCP) server**](https://modelcontextprotocol.io/docs/getting-started/intro) provides a standardized interface for external MCP hosts to access Elastic Agent Builder tools. For example, you can run an ES|QL query against your data from Claude Desktop without opening Kibana.
<note>
  On this page, Elastic Agent Builder acts as the MCP server: external MCP hosts connect to it to use your Elastic Agent Builder tools. To instead let your agents use tools hosted on an external MCP server, refer to [Model Context Protocol (MCP) tools in Elastic Agent Builder](https://www.elastic.co/elastic/docs-builder/docs/3663/explore-analyze/ai-features/agent-builder/tools/mcp-tools).
</note>


## MCP server endpoint

The MCP server is available at the following endpoint:
```
{KIBANA_URL}/api/agent_builder/mcp
```

When using a custom Kibana Space, include the space name in the endpoint path:
```
{KIBANA_URL}/s/{SPACE_NAME}/api/agent_builder/mcp
```

<tip>
  You can copy your MCP server URL directly in the Tools GUI. Refer to [MCP server access in the Tools GUI](/elastic/docs-builder/docs/3663/explore-analyze/ai-features/agent-builder/tools#mcp-server-access).
</tip>


## Authentication and configuration

External MCP hosts need credentials to reach the MCP server endpoint. The way that you configure your MCP server depends on your authentication method. Choose API keys or OAuth 2.1 based on your deployment type and use case.
Use one of the following authentication paths:
- [API key authentication](https://www.elastic.co/elastic/docs-builder/docs/3663/explore-analyze/ai-features/agent-builder/mcp-server-api-keys)
- [OAuth 2.1 authentication](https://www.elastic.co/elastic/docs-builder/docs/3663/deploy-manage/app-connections/oauth-clients) using an [application connection](https://www.elastic.co/elastic/docs-builder/docs/3663/deploy-manage/app-connections) <applies-to>Elastic Cloud Serverless: Preview</applies-to>

The following table compares the two paths.

| Consideration                           | API key                                                                                                                           | OAuth                                                                                                                                                                   |
|-----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Supported platforms                     | Elastic Stack deployments and Serverless projects                                                                                 | Serverless projects only <applies-to>Elastic Cloud Serverless: Preview</applies-to>                                                                                     |
| Best for                                | Automation, unattended access, and shared machine-to-machine use                                                                  | Interactive MCP hosts acting on behalf of a person (Claude Desktop, Cursor), including teams that share one client                                                      |
| Multi-user access                       | One shared key means one shared identity; all callers act with the same permissions                                               | One client registration serves many users. Each person consents separately and gets their own connection, acting with their own permissions and revocable individually  |
| Identity                                | The key's snapshotted permissions                                                                                                 | The consenting user; permissions are the user's live permissions in the project                                                                                         |
| Credential lifetime                     | Long-lived until the key expires or is revoked                                                                                    | Short-lived tokens, refreshed automatically unless revoked. Require a new connection if unused for 30+ days.                                                            |
| Setup                                   | Generate a key and add it to the host configuration                                                                               | Register an MCP client, then consent in the browser                                                                                                                     |
| Elastic Agent Builder tools through MCP | Full tool catalog, including [Elastic Workflows](https://www.elastic.co/elastic/docs-builder/docs/3663/explore-analyze/workflows) | Full tool catalog, limited by the [authorizing user's](/elastic/docs-builder/docs/3663/deploy-manage/app-connections/connect-mcp-host#authorize-connection) permissions |


## Related pages

- [Programmatic access to Elastic Agent Builder](https://www.elastic.co/elastic/docs-builder/docs/3663/explore-analyze/ai-features/agent-builder/programmatic-access)
- [OAuth for MCP clients](https://www.elastic.co/elastic/docs-builder/docs/3663/deploy-manage/app-connections/oauth-clients)