Is the Elasticsearch MCP server with OAuth approved for team use?
The answer is yes only for a Serverless project, and only if the team uses the Agent Builder MCP endpoint rather than the deprecated repository server. The official path is the Agent Builder MCP endpoint, available in Elastic 9.2.0+ and Elasticsearch Serverless projects, because the elastic/mcp-server-elasticsearch repository is deprecated and receives only critical security updates. OAuth 2.1 is supported only on Serverless projects, while API keys work on both Elastic Stack deployments and Serverless. If the estate runs self-hosted Stack, the approval is for API key authentication only, and the reviewer should record that OAuth is not an option there.
Before approving, the team should confirm that the endpoint and client configuration match the approved pattern. Each OAuth client is scoped to one Serverless project and to the Kibana space it was created in, so every additional space needs its own client, and each client must be reviewed separately. The reviewer should check which Elasticsearch roles and privileges sit behind each user's consent, because OAuth limits who connects, not what the connected agent can query. Also confirm which endpoint form is in use, the root /api/agent_builder/mcp path or the space-specific /s/{SPACE_ID}/api/agent_builder/mcp path, so that space boundaries are not assumed.
The gaps sit in credential handling and lifecycle. For confidential OAuth clients, the client secret is shown only once and cannot be retrieved later, so the team needs a documented custody process for it. Tokens are short-lived and refresh automatically unless revoked, and a connection that goes unused for 30 days or more must be re-established. Ask the vendor and your own administrators to confirm how revocation, offboarding and client rotation are handled, and whether the Serverless tenant produces logs that show which connected user ran which tool. Those answers, not the protocol choice alone, decide whether the rollout is approved.
Authentication and deployment support by edition
This table compares which Elasticsearch MCP server paths and authentication methods apply to Elastic Stack deployments and Elasticsearch Serverless projects. Read each row against the edition you run, because OAuth 2.1 is documented only for Serverless and the Agent Builder endpoint is documented for Elastic 9.2.0 and later on Stack. The main takeaway is that Stack teams have API keys as the documented option, while OAuth clients must be planned per project and per space.
| Item | Elastic Stack deployment | Elasticsearch Serverless project |
|---|---|---|
| Official Agent Builder MCP endpoint | Available in Elastic 9.2.0 and later. Confirm availability on earlier versions with Elastic. | Available. Endpoint is the Kibana URL plus the Agent Builder MCP path. |
| Deprecated elastic/mcp-server-elasticsearch server | Deprecated and limited to critical security updates. Plan migration to the Agent Builder endpoint. | Deprecated. Superseded by the Agent Builder MCP endpoint. |
| OAuth 2.1 authentication | No | Yes |
| API key authentication | Yes | Yes |
| Per-space endpoint | Uses the space path for a custom Kibana space. Confirm the path behavior with Elastic. | Uses the space path for a custom Kibana space. Each space needs its own OAuth client. |
| Client credential handling | No OAuth client is documented for Stack. Confirm how API keys are issued, stored and rotated. | Each OAuth client is scoped to one project and one space. The confidential client secret is shown once only. |
| Token and connection lifetime | Confirm API key expiry and revocation settings with Elastic. | OAuth tokens are short-lived and refresh automatically. A new connection is required after 30 or more days unused. |
Why the repository server is no longer the server to approve
The Apache-2.0 licensed elastic/mcp-server-elasticsearch repository is the vendor's original Elasticsearch MCP server, but its README now marks it as deprecated. The project will receive only critical security updates from here on, and the README names the Elastic Agent Builder MCP endpoint as its successor, available in Elastic 9.2.0 and later and in Elasticsearch Serverless projects. For an approval decision, this means the repository server should not be the baseline a team signs off on. A review that approves it today is approving a component that will not get feature work, and that receives only the fixes Elastic classifies as critical. Reviewers should treat the Agent Builder endpoint as the server to evaluate, and treat any request to connect the older server as an exception that needs a documented reason and an expiry date.
Two actions follow for the security or IT owner. First, record the MCP server in the AI tool inventory with its exact name, source repository or endpoint, and the Elastic version or Serverless project it runs against, so that anyone reviewing the inventory can see which connections rely on the deprecated code. Second, block new onboarding on the deprecated server in the team's approval process, so that new clients and new users are pointed to the Agent Builder MCP endpoint. Existing connections should be listed with an owner and a migration target. Reviewers should also confirm with their own Elastic administrator whether the deployment is on 9.2.0 or later, since that determines whether the Agent Builder endpoint is available on a self-managed cluster or whether the team must use Serverless. Elastic's Agent Builder MCP server documentation is the natural next read for that check.
How an MCP host reaches Agent Builder tools through OAuth or API keys
The diagram starts at an MCP host such as Claude Desktop, which calls the Agent Builder MCP endpoint at the Kibana URL. The endpoint takes an optional space path, so a custom Kibana space gets its own endpoint. Two authentication paths sit in the middle: OAuth 2.1, where each person consents and gets a separate connection, and API keys. Both paths lead to Agent Builder tools such as an ES|QL query. Check which path your deployment supports, since OAuth 2.1 works only on Serverless projects, and confirm that each OAuth client is limited to one project and one space.
Authentication paths from an MCP host to Agent Builder tools, with the per-space boundary.
Choosing OAuth 2.1 or API keys for a team
OAuth 2.1 is the path where each person connects their own AI client and consents separately. Elastic documents it for Serverless projects only, so a team on a self-managed or other Elastic Stack deployment cannot use it. One client registration serves many users, and each user gets an individual connection that can be revoked without affecting anyone else.
- Serverless only: Confirm your deployment is a Serverless project before planning around OAuth 2.1. Stack deployments fall back to API keys.
- One registration, many users: The platform team creates the OAuth client once. Each user consents, which keeps the grant tied to a person rather than a shared secret.
- Individual revocation: Removing one person's connection does not require rotating a credential shared by the team.
- Short-lived tokens: Tokens are refreshed automatically unless revoked. A connection that goes unused for 30 or more days must be re-established.
- Client scope: Each OAuth client is limited to one Serverless project and the Kibana space it was created in. Each additional space needs its own client.
Before approving this path, confirm with the platform team how the client is created, who may create clients in each space, and how revocations are recorded in your audit process.
API keys are the path that works on both Elastic Stack deployments and Serverless projects. The key is a credential, and whatever it can reach is determined by the permissions assigned to it. Attribution therefore follows the key holder's scope, not the individual using the AI client, so a shared key makes queries hard to trace to a person.
- Broadest availability: Use this path when the deployment is not Serverless or when OAuth 2.1 is not available for your project.
- Scope set at creation: Access is bounded by the role and privileges the key carries, so the key should be issued with the narrowest index access that the use case allows.
- Lifecycle is manual: Rotation, expiry and revocation are managed by the platform team rather than by an approval flow per user.
- Attribution risk: A key shared across a team means audit entries point to the key, not the person. Issue one key per person or per application where traceability matters.
- Storage: Keys must be stored in the AI client's configuration. Confirm where that configuration lives on each workstation and who can read it.
Before approving this path, ask the platform team how keys are issued, how often they expire, and how a compromised key is revoked without disrupting other users.
The choice affects three things: who is named in the logs, how quickly one person's access can be removed, and what the platform team must maintain. OAuth 2.1 shifts work toward per-person consent and token handling by the platform, while API keys shift work toward key issuance, scoping and rotation. Neither path removes the need to limit what the connected user or key can reach in Elasticsearch.
- Attribution: OAuth ties activity to a consenting person. API keys tie activity to the key unless each person holds a separate one.
- Revocation: OAuth allows per-user revocation. With API keys, removing one person may mean reissuing a key to everyone else who shares it.
- Lifecycle: Confirm the token refresh behavior and the 30-day inactivity rule for OAuth, and the expiry and rotation rules for keys in your environment.
- Platform effort: OAuth needs a client per space and project, while keys need an issuance and rotation routine.
- Deployment fit: The deployment type often decides the question before the security trade-offs do.
Before choosing, ask the Elastic account team and your platform owner to confirm which deployment type you run and whether that matches the path your reviewers will accept.
How token lifetimes and the 30-day idle rule shape access
OAuth connections for the Agent Builder MCP server expire in practice through token refresh rules, idle timeouts and revocation, not only through a password change. Each rule changes who holds access, for how long, and what an offboarding or rotation step must actually do.
Short-lived tokens with automatic refresh
OAuth access tokens are short-lived, and the client refreshes them automatically unless the connection is revoked. That means a token that has leaked from a laptop may stop working on its own, but a live connection keeps renewing itself indefinitely while the user stays active. Ask Elastic and your identity team how long an access token lasts in your Serverless project, and confirm that refresh stops when a user is removed from your identity provider.
Agent Builder MCP docsNew connection after 30 idle days
A connection that goes unused for 30 or more days stops working, and the person must create a new one. This acts as a built-in expiry for dormant access, such as a contractor's laptop or an agent client that nobody opens. Treat it as a backstop, not an offboarding control: an active user keeps refreshing, so the idle rule never removes access on its own.
Client secret shown once
For confidential OAuth clients, the client secret is displayed only once and cannot be retrieved later. Store it immediately in your approved secrets manager with an owner and a record of the client it belongs to. If it is lost, the practical fix is to create a replacement client and retire the old one, so plan the storage step before the screen closes.
Create OAuth client docsPer-user revocation for offboarding
Each person consents separately and receives an individual connection, which can be revoked on its own. Offboarding should therefore revoke that user's connections as a named step in the leaver process, alongside disabling their identity account. Confirm with Elastic how an administrator can list and revoke connections, and test the step with a pilot user before relying on it.
Shared client rotation
One client registration serves many users, so rotating its secret or retiring it disconnects everyone who depends on it at once. Schedule rotation as a planned change with a replacement client ready, and remember that each client is scoped to one Serverless project and to the space where it was created. Each additional space needs its own client, so each one is rotated separately.
Client scope detailsHow per-space OAuth clients divide access across teams
Each OAuth client for the Agent Builder MCP server is scoped to one Serverless project and to the Kibana space it was created in, so an OAuth client cannot reach a second space. A team that works across several spaces therefore needs one client per space, and each client is a separate access boundary to design, approve and document. The first decision is how many spaces the agents actually need, because every extra space adds a client registration, a consent path and a credential to manage. Map each space to the team or business function that owns its data, then confirm with the Elastic admin which projects and spaces are in scope before anyone creates a client.
Ownership follows the space. The team that owns a space's indexes and dashboards should own the client created for it, and that owner should be the person who answers reviewer questions about what the client can reach. Keep one client per space rather than sharing a single client across spaces with mixed sensitivity, since the scoping model gives no way to split one client's reach within a space. Confirm the mapping with the security team, and record which user groups consent to each client, because each person consents separately and receives an individual connection that can be revoked on its own.
For reviewers, document a register with one row per client: the Serverless project, the space ID, the owning team, the consenting user groups, the permissions the underlying Elasticsearch roles grant, and the review date. Note that a confidential client secret is shown only once and cannot be retrieved later, so record where it was stored at creation. Also record that tokens are refreshed automatically unless revoked and that connections unused for 30 days or more must be re-established, so reviewers can check for stale connections. Confirm these lifetimes against the current Elastic documentation before publishing the register.
Gaps to close before the team goes live
Most of the risk in this rollout sits in a few open items: which server the team runs, which deployment type supports the sign-in method they want, and what the connection can actually touch. Each card below names one gap, the decision it forces, and what to confirm with Elastic and the cluster's role model before approval.
Deprecated repository server still in use
The elastic/mcp-server-elasticsearch repository is deprecated and receives only critical security updates. Teams that already run it should inventory every client config that points at it and list who installed it and on which machines. Plan the move to the Agent Builder MCP endpoint, and confirm with Elastic which Kibana version or Serverless project each team member will connect to before the old server is removed.
Repository READMEOAuth unavailable on Stack deployments
OAuth 2.1 for the Agent Builder MCP server is supported on Serverless projects only. Self-managed Elastic Stack deployments can use API keys instead. Decide the deployment type first, because a team that expects single sign-on on a Stack cluster will not find it in this path. Ask Elastic to confirm the authentication options for the exact version your cluster runs.
Agent Builder MCP docsNo tool allowlist in sourced docs
The sourced Agent Builder documentation describes the MCP endpoint and the authentication paths, but it does not establish a per-tool allowlist that an administrator can set for each client. Do not assume the team can restrict which Agent Builder tools a connected client runs. Ask Elastic in writing whether tool-level restriction exists, and if not, document which tools are exposed and limit the connection through roles and spaces.
Client secret loss requires re-registration
For confidential OAuth clients, the client secret is shown only once and cannot be retrieved later. If the secret is lost, the client must be re-registered, and every team connection built on it depends on that change. Assign one named owner for each client, store the secret in the team's approved vault at creation time, and record the rotation steps before go-live.
- Secret shown
- Once
Index scope follows user or key permissions
The connection reads and writes only what the authenticated user or API key can reach. Scope is set by Elasticsearch roles, index privileges and the Kibana space the client was created in, not by the MCP server itself. Before approval, have the cluster owner map each planned user or key to specific index patterns, confirm read-only versus write privileges, and test the connection against an index that should be out of reach.
Agent Builder MCP docsRollout order for a security-approved team setup
This sequence moves a team from confirming which Elasticsearch MCP server applies to a pilot that proves credential handling, revocation and token expiry before anyone outside the pilot group connects. Each phase closes with a check that a security reviewer can record.
Confirm the server and deployment type
Before any configuration, the platform owner confirms the Elastic version or whether the deployment is Serverless. The repository README says the elastic/mcp-server-elasticsearch server is deprecated and receives only critical security updates, and that the Agent Builder MCP endpoint supersedes it in Elastic 9.2.0+ and Serverless. Confirm that the team is on the Agent Builder endpoint, not the deprecated repository server. Done when the reviewer has a written record of the version or project type and the chosen server.
Choose the authentication path
The platform owner selects API keys or OAuth 2.1 based on the deployment type. Elastic's Agent Builder docs state that OAuth 2.1 is supported on Serverless projects only, while API keys work on Elastic Stack deployments and Serverless projects. If the deployment is self-managed Stack, OAuth is not an option, so the choice is made by deployment type rather than preference. Done when the chosen path is approved in writing by the security reviewer.
Define one client per Kibana space
Each OAuth client is scoped to a single Serverless project and to the Kibana space it was created in. The identity or platform team maps every space the team needs and creates one client for each, rather than sharing a single client across spaces. Confirm the mapping against the endpoint form, {KIBANA_URL}/s/{SPACE_ID}/api/agent_builder/mcp for a custom space, so each client's reach is documented. Done when a space-to-client register exists and the reviewer has signed off on it.
Record secret handling for confidential clients
For confidential OAuth clients, Elastic states the client secret is shown only once and cannot be retrieved later. Before creation, the team agrees who receives the secret, where it is stored in the organization's approved secret manager, and how a lost secret is handled, which means creating a new client. Confirm that the storage location and access list are recorded. Done when the secret custody record is complete and no one has the secret in an unapproved location.
Pilot with a small user group
A small group of named users connects through the chosen path. With OAuth, one client registration serves many users, and each person consents separately and gets their own connection. The platform owner checks that each pilot user's connection is separate in the admin view and that the tools available match the intended scope. Done when the pilot list, the consent records and the observed tool access are documented and match the approved design.
Verify revocation and token expiry
Elastic documents that OAuth tokens are short-lived and refresh automatically unless revoked, and that a connection is required again after 30 or more days of non-use. The reviewer tests revoking one pilot user's connection and confirms the other connections keep working and the revoked user loses access. The reviewer also confirms the inactivity behavior is understood by the team. Done when a revocation test and an expiry review are recorded with results.
Expand in controlled waves
After the pilot results are accepted, the team adds users and spaces in waves, each with its own client and consent record. Each wave repeats the revocation check on a sample of new connections and confirms the deprecated repository server is not being installed by anyone. Confirm with the vendor and your own environment that the Agent Builder documentation still matches the deployed version before each wave. Done when the expansion log, the current user and space register and the reviewer's approval are all current.
Evidence a security reviewer asks for and where it comes from
This table lists the evidence a reviewer should expect before approving the Agent Builder MCP server with OAuth, and where each item comes from. Read each row as a request: ask the team for the artifact, then check it against the Elastic documentation or the live environment. The main takeaway is that the client secret, per-space clients and token idle policy each leave a record only if the team keeps one.
| Evidence row | What to ask for | Source in the Elastic docs or the environment |
|---|---|---|
| Deployment version | The Elastic version or Serverless project in use, and confirmation that the Agent Builder MCP endpoint is present | Stack version from the cluster, or the Serverless project settings; the repository README names 9.2.0 and later and Serverless as the supported base |
| Server choice | A written decision that the Agent Builder MCP endpoint is used and the deprecated repository server is not | The Elastic Agent Builder MCP server docs and the repository README, which states the deprecated server gets only critical security updates |
| Auth method | Which path is used per client: OAuth 2.1 on Serverless only, or API keys on Stack and Serverless | Agent Builder MCP server docs for supported authentication; the Kibana connection settings for each client |
| Per-space client list | One row per client showing the Serverless project, Kibana space and the MCP endpoint path used | Client records under the Kibana space; the endpoint is /api/agent_builder/mcp or /s/{SPACE_ID}/api/agent_builder/mcp |
| Consent records | Evidence that each user consented separately and holds an individual connection that can be revoked | OAuth connection list for each user in the Agent Builder MCP flow, and the export or screenshot kept by the admin |
| Secret storage record | Where each confidential client secret is stored, who can read it, and proof it was saved when first shown | The secret store or vault entry; the client creation record, since the secret is shown only once and cannot be retrieved |
| Token lifetime and idle policy | Written confirmation of how tokens refresh and when a connection expires after 30 days unused | Agent Builder MCP server docs state tokens are short-lived, refresh automatically unless revoked, and require a new connection after 30+ days unused |
| Revocation test result | A dated test showing a revoked connection stops working and a new consent is required | Result of a test run by the team in the Kibana environment, with the revoked user and the client named in the record |
Questions buyers ask before approving the Elasticsearch MCP server
Does OAuth 2.1 work on a self-managed Elastic Stack deployment?
No. OAuth 2.1 authentication for the Agent Builder MCP server is supported on Elasticsearch Serverless projects only. API keys work on both Elastic Stack deployments and Serverless projects, so a self-managed cluster must use API keys for its MCP connection. Confirm the deployment type in your own environment before writing the authentication requirement into a rollout plan, because a team that expects OAuth on a self-managed cluster will need a different approval path. Elastic's Agent Builder MCP server documentation lists the two authentication paths and the deployment types each supports.
Can the deprecated Elastic MCP server still be used for new rollouts?
It can still run, but it is not recommended for new rollouts. The README of the elastic/mcp-server-elasticsearch repository says the server is deprecated and will only receive critical security updates going forward. Elastic says it has been superseded by the Agent Builder MCP endpoint, available in Elastic 9.2.0 and later and in Serverless projects. Any team already running the repository server should plan a migration to the Agent Builder endpoint and confirm its cluster version meets the 9.2.0 minimum. Treat the deprecated server as a migration item, not a standard to approve.
What drives the effort and cost of an Elasticsearch MCP rollout?
Three factors drive most of the work. The first is the number of Kibana spaces, because each OAuth client is scoped to a single Serverless project and to the space it was created in, so every additional space needs its own client. The second is the authentication path: OAuth brings per-user consent, individual revocation and short-lived tokens, while API keys need a documented owner, scope and rotation process. The third is your internal review, including security sign-off, data classification and change approval. The cost components are your staff time and any external review you buy. Ask any provider for a quote that lists the spaces, the authentication path and the review steps it covers.
Can our own team set up the Agent Builder MCP server without outside help?
Often yes, if your platform team already administers Elastic and can create the required clients and keys. The setup steps are documented by Elastic, and the work is mostly configuration: confirming the deployment type, creating an OAuth client or API key for each space, and connecting an MCP host. The harder part is governance. Someone must decide which spaces an agent may reach, who owns each credential, how keys are rotated, and how revoked connections are tracked. Note that a confidential OAuth client secret is shown only once and cannot be retrieved later, so the process for storing it must be settled before creation. Teams without a documented review path often benefit from outside help on that part.
How do OAuth token lifetimes and inactive connections affect our access policy?
OAuth tokens are short-lived and refresh automatically unless the connection is revoked. A connection that has not been used for 30 or more days requires a new connection, so the policy follows from that rule. Stale connections stop working without anyone revoking them, but they should still be reviewed so that no unused consent remains on record. Because each person consents separately and can be revoked individually, your offboarding process should include removing that person's connection. Confirm the current token behavior in Elastic's documentation for your Serverless project before you publish the policy, since token settings are the vendor's to define.
What does a DeployOpen scoping call cover for an Elasticsearch MCP rollout?
A scoping call agrees the work before any engagement starts. DeployOpen's AI agent rollout security review tests the setup, including prompt injection, tool and file permissions, data exposure, credential handling, SSO and admin settings, and delivers a findings report with fixes and a retest. For this use case, the scope would typically cover the deployment type, the spaces in scope, the chosen authentication path, credential ownership and the review evidence your security team needs. Engagements are fixed-scope, and the scope, deliverables and timelines are agreed in writing before work starts. A quote follows from that written scope. DeployOpen does not publish a price list.
Which Elasticsearch MCP server should we name in our approval record?
Name the Agent Builder MCP endpoint as the server to approve for new work, and record the repository server as deprecated. The endpoint is {KIBANA_URL}/api/agent_builder/mcp, or {KIBANA_URL}/s/{SPACE_ID}/api/agent_builder/mcp for a custom Kibana space. Repository server rollouts that already exist should carry a dated migration item, since the repository server receives only critical security updates. The repository is licensed Apache-2.0, which matters for your open-source inventory, but the license does not change its deprecated status. Keep the approval scoped to the Elastic version or Serverless project that you confirmed.
How DeployOpen helps teams approve this MCP setup
DeployOpen plans, implements and tests self-hosted platforms inside the client's own infrastructure, including AI agent rollouts that connect to MCP servers. For the Elasticsearch MCP setup, we work from the written scope to confirm which server is in use, how each team's OAuth or API key access is set up, and what the connected agent can reach before anyone approves it.
How we scope
- Confirm which Elasticsearch deployment type and Kibana spaces the team uses, and whether Serverless is available for OAuth 2.1.
- Record which MCP endpoint each team connects to and whether the deprecated repository server is still in place.
- Agree in writing how many OAuth clients, one per Serverless project and Kibana space, the rollout requires.
How we build
- Configure the Agent Builder MCP endpoint with OAuth 2.1 or API keys, matching the access model the client approved.
- Test the connection for prompt injection, tool permissions, data exposure and handling of client secrets and API keys.
- Check credential lifetimes, the 30-day inactivity rule and per-user revocation against the client's access review process.
How we hand over
- Deliver a findings report with fixes, a retest record and a written description of each space-scoped client.
- Document the client secret handling procedure, since a confidential client secret is shown only once and cannot be retrieved later.
- Provide evidence for the security and compliance team to review, without issuing any audit report or attestation.
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer.
- Re-test the setup when Elastic changes the MCP endpoint, authentication options or repository status.

