Explore documents and mappings together
List the available indices, inspect field mappings and ask the AI to build a Query DSL request appropriate to the stored data.
Databases · MCP integration
Connect Elasticsearch through its own database connector. Give your AI access to the indices, documents and cluster diagnostics its task needs, using an identity you control. Separate recognized read APIs from requests that require your review, including writes, SQL and ES|QL.
Connection in GateRook
stage-elasticsearch
Elasticsearch
stage / QAThe route
Your AI requests a tool. GateRook checks the endpoint policy, resolves credentials locally, and calls the configured service.
Understand the request flowAsk your AI
Count the pending orders in our stage Elasticsearch cluster. Use orders-stage and keep the request read-only.
{
"connection": "stage-elasticsearch",
"method": "POST",
"path": "/orders-stage/_count",
"body": {
"query": {
"term": {
"status": "pending"
}
}
}
}{
"status": 200,
"contentType": "application/json",
"body": {
"count": 7,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
}
},
"truncated": false
}Sample configuration and output, not a live connection. Replace example values with your environment. Tool names here are connector names; the endpoint may expose a connection-specific name.
Put context to work
List the available indices, inspect field mappings and ask the AI to build a Query DSL request appropriate to the stored data.
Compare counts and aggregations, inspect index settings and review recognized cluster diagnostics using the same scoped connection.
Review a proposed document write, bulk operation or settings change through elasticsearch_request. The approval contains the prepared request rather than a general grant to the assistant.
From service to MCP
GateRook must be running on a computer that can reach your service. Open Connections, choose Add connection, and select Elasticsearch. Give the connection a name and environment.
New to GateRook? Start with the full setup guide.Create a user or API key with only the index and cluster privileges your workflow needs. For investigation, start with read permissions rather than an administrative identity.
Open Connections, choose Add connection, then Elasticsearch under Databases. Set its name, environment and server origin.
Choose the authentication mode. For an API key, enter its already encoded value without the ApiKey prefix. Enter other secrets in GateRook's protected fields and supply a private CA when required.
Run Test connection and inspect its cluster and index-discovery checks. It does not test writes. Enable the index and query tools for initial investigation; leave the request tool Off until you need a reviewed operation.
Add the tested connection to an endpoint. In Tools & policies, enable only the tools needed for the task. Start with Read only where supported; use Approval for any selected mutation and leave other tools Off. A connection alone does not grant an AI client access.
In Clients, choose your AI app and endpoint, review the connection details, and connect. Try this guide’s example in Playground before asking your AI. Open Activity to inspect the tool, target, decision and returned result. The getting started guide covers this shared flow.
Connection settings
These are example values for the connection form. Enter credentials into GateRook’s secret fields, not into an AI prompt. Requirements and alternatives are noted per field.
| Setting | Example | How to use it |
|---|---|---|
Connector type | Elasticsearch | Choose Elasticsearch under Databases in Add connection. It is separate from the OpenSearch connector. |
Name / environment | stage-elasticsearch / stage | Use a dedicated connection and server identity for the environment you want your AI to inspect. |
Server URL | https://elastic.stage.example.test:9200 | Enter the Elasticsearch server origin and port, without a Kibana path, API path, credentials or query string. |
Authentication | API key | Supported modes are Username and password, API key, Bearer token and No authentication. AWS request signing belongs to the OpenSearch connector. |
API key | Your encoded Elasticsearch API key | Paste the encoded value returned when the key was created, or Base64 of id:api_key. Do not add the ApiKey prefix. Store it in GateRook's protected field. |
Server permissions | Read access to orders-stage | Set index and cluster privileges on the server identity. The connector's REST requests use those permissions; there is no separate local index allowlist. |
CA certificate (PEM) | Your private CA certificate, if needed | Supply a PEM CA certificate for a privately issued server certificate. GateRook still verifies the server hostname. |
Know what you expose
The connector determines what is possible. Endpoint modes and connection policies determine what a particular AI client may use.
| Tool | Purpose | Access behavior |
|---|---|---|
elasticsearch_indices | Resolve indices, aliases and data streams accessible to the server identity, optionally using an index expression. | Read only by default |
elasticsearch_query | Use recognized REST read APIs for JSON Query DSL, aggregations, multi-search, documents, mappings, settings and cluster diagnostics. | Read only by default |
elasticsearch_request | Submit the exact method, path, parameters and JSON or NDJSON body for writes, bulk operations, administration, SQL, ES|QL and other APIs outside the recognized read set. | Approval by default, including GET |
GateRook stores local connection secrets encrypted and resolves them for connectors. Allowed tool results are returned to your AI client and may be processed by its provider. Scope the data you expose as well as the actions you allow.
Practical answers
Use Test connection to isolate service access problems. Use Playground and Activity to inspect endpoint permissions and tool calls.
No. Elasticsearch has its own connection type, authentication options and elasticsearch_indices, elasticsearch_query and elasticsearch_request tools. Choose the connector that matches your server.
Use the encoded value returned when creating the key, or Base64 of id:api_key, without an ApiKey prefix. GateRook attaches the authorization header; the AI does not need the key in its prompt or tool arguments.
Use elasticsearch_request for those APIs. They are outside the recognized read set and require approval by default, even for a GET request. Server support and permissions still apply.
Yes, when you enable the request tool and the server identity has the required privileges. Approval is the default mode. Keep that tool Off, or remove the relevant server permissions, when changes must be unavailable.
It checks cluster information and attempts index discovery. It does not execute writes or certify access to every API. Check the server's permissions and the result of the specific tool call in Activity.
Keep exploring
Connect OpenSearch to AI through GateRook. Query documents, mappings and aggregations with local credentials, and review administrative REST requests before they run.
Connect MongoDB to AI through MCP with a step-by-step Docker tutorial. Query documents, approve updates, and trace every call in GateRook Activity.
Connect a REST or HTTP API to AI through MCP. Scope base URLs and paths, keep API keys in GateRook, and approve requests that change data.
Your infrastructure, on your terms
Start with one connection. Choose what your AI can do.