Set up Elasticsearch in Metorial for Claude, ChatGPT and Cursor
Share Elasticsearch with your team in Claude, ChatGPT and Cursor through Metorial: basic authentication or bearer token sign-in, 20 tools (6 read-only).
To give your team Elasticsearch in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Elasticsearch integration in a Metorial portal, and each person connects with a basic authentication. Index, search, and analyze documents in Elasticsearch clusters. The integration has 20 tools, 6 read-only, 13 write and 1 destructive, plus 2 triggers.
What you'll learn
- How an admin shares Elasticsearch in a portal and how each person connects
- What Elasticsearch asks for when you connect, and where to find it
- How to keep the 6 read-only tools and reject the other 14
Before you start
- A portal with at least one access group
- A basic authentication from Elasticsearch for each person, or one for a shared connection
- For the CLI steps: the Metorial CLI, signed in to your portal
Sign-in methods
| Method | Type | What a person provides |
|---|---|---|
| Basic Authentication (default) | Custom credentials | elasticsearchUrl, username and password |
| Bearer Token | Custom credentials | elasticsearchUrl and token |
| API Key | API token | elasticsearchUrl and token |
The portal and metorial setup use Basic Authentication unless someone picks another method.
Basic Authentication
To connect, a person enters these values:
elasticsearchUrl: Base URL of your Elasticsearch cluster (e.g., https://my-cluster.es.cloud:9243)username: Elasticsearch usernamepassword: Elasticsearch password
Bearer Token
To connect, a person enters these values:
elasticsearchUrl: Base URL of your Elasticsearch cluster (e.g., https://my-cluster.es.cloud:9243)token: OAuth2 access token obtained from the /_security/oauth2/token endpoint
API Key
To connect, a person enters these values:
elasticsearchUrl: Base URL of your Elasticsearch cluster (e.g., https://my-cluster.es.cloud:9243)token: Base64-encoded API key (the "encoded" value returned when the API key was created)
Admin: share Elasticsearch in a portal
In the dashboard
Open Shared Resources
Open Workforce, choose the portal, and select Shared Resources under Access.
Share a new integration
Select Share a Resource, then New Integration, and choose Elasticsearch. Under Auth Method, keep Basic Authentication or pick another. For how members connect, choose Each person connects so everyone enters their own basic authentication, or Shared connection to enter one basic authentication for everyone.
Limit the tools
Under Tool Filters, set the write and destructive groups to Reject if agents should only read from Elasticsearch.
Choose who gets it
Add the access groups that should see Elasticsearch. When a person asks for access from the portal, the request appears under Access Requests.
With the CLI
The CLI cannot create the per-user Elasticsearch integration. Once it exists, check which groups have it:
Employee: connect Elasticsearch
In the portal
Open Elasticsearch in the catalog
Sign in to your portal and open Elasticsearch. The status reads Available.
Authenticate
Under Quick setup, select Authenticate. In the setup window, enter your basic authentication (elasticsearchUrl, username and password).
Confirm
The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.
With the CLI
catalog search prints the catalog item ID. metorial setup uses Basic Authentication. To connect with Bearer Token instead, find its ID with metorial catalog get <catalog-item-id> and add --auth-method <auth-method-id>.
Add it to your AI client
metorial install adds your Elasticsearch connection to a local MCP client such as Claude Code, Cursor or Codex. metorial list prints the integration ID and metorial client list the client identifiers.
For a client that takes a server URL, such as ChatGPT, metorial install custom <integration-id> creates an installation token and shows the endpoint details.
Make it read-only
Open the integration's Tool Filters and set the write and destructive groups to Reject. Agents keep the 6 read-only tools, such as esql_query and get_document, and lose the 13 write tools, such as reindex or manage_alias, and the destructive tool delete_document.
Employees see the result on the integration's page in the portal under Tool access. For the full walkthrough, see Tool permissions.
Check it worked
metorial tools lists the 20 tools, minus any you rejected. list_indices takes no input. It lists all indices in the Elasticsearch cluster with their health status, document count, and storage size.
To see every input a tool takes, run metorial schema <integration-id> <tool-key>.
Tools
Read-only tools (6)
cluster_health: Get the health status and key metrics of the Elasticsearch cluster including node count, shard allocation status, and pending tasks.list_indices: List all indices in the Elasticsearch cluster with their health status, document count, and storage size.get_document: Retrieve one or more known Elasticsearch documents by ID.search_documents: Search and query documents in Elasticsearch using the full Query DSL.graph_explore: Discover relationships between terms in an Elasticsearch index. NeedsindexNameandvertices.esql_query: Execute an ES|QL query to filter, transform, and analyze data stored in Elasticsearch. Needsquery.
Write tools (13)
bulk_operations: Perform multiple index, create, update, or delete operations in a single API call. Needsoperations.index_document: Create or replace a document in an Elasticsearch index. NeedsindexNameanddocument.update_document: Partially update an existing document in an Elasticsearch index. NeedsindexNameanddocumentId.manage_index: Create, configure, open, close, or delete an Elasticsearch index. NeedsactionandindexName.manage_watch: Create, update, delete, execute, activate, or deactivate Watcher alerts. NeedsactionandwatchId.manage_alias: Create, delete, or list index aliases. Needsaction.manage_snapshot: Create, restore, delete, or retrieve snapshots and snapshot repositories for cluster backups. Needsaction.reindex: Copy documents from one index to another, optionally applying a query filter or transformations via a script. NeedssourceIndexanddestinationIndex.run_inference: Execute a machine learning inference task using a configured inference endpoint. Needsaction.manage_security: Manage Elasticsearch security resources including users, roles, and API keys. NeedsresourceTypeandaction.manage_pipeline: Create, update, delete, list, or simulate ingest pipelines. Needsaction.manage_index_template: Create, retrieve, list, or delete Elasticsearch composable index templates. Needsaction.manage_async_search: Submit, retrieve, or delete an Elasticsearch asynchronous search. Needsaction.
Destructive tools (1)
delete_document: Remove a document from an Elasticsearch index by its ID. NeedsindexNameanddocumentId.
Triggers
Elasticsearch has 2 triggers, which fire on events in Elasticsearch:
watcher_alert: Polls the Watcher execution history for new alert executions.inbound_webhook
Next steps
- Claude Code, Cursor, Codex and ChatGPT: connect each client to your portal and use Elasticsearch there
- Tool permissions: tool filters and what employees see
- Elasticsearch on metorial.com: the integration overview