NewAgent Observability is live.
Back to directory
OpenSearch logo

OpenSearch MCP server: nine core tools, filters and clusters

OpenSearch deliberately keeps its tool count low, including a generic endpoint tool whose cluster URL an agent can supply.

Connector
Official, local
Coverage
Indices, mappings, search, cluster health
Tools
9 core, more behind a filter
Biggest risk for an agent
One tool reaches any API endpoint

Last verified 1 September 2026 · from The OpenSearch project's repository, its documentation and the server's own tools/list response

This page is one of 90 in a directory of monitoring and developer tools. Each page checks what an AI coding agent can get out of the tool through its MCP server, the connector that lets the agent query the tool directly.

Summary

OpenSearch publishes two official MCP servers. This page covers the standalone one, opensearch-mcp-server-py, which registers nine core tools by default.

It is the cheapest connector of its reach in this guide, at about 1,388 tokens. The low count is deliberate. One of the nine, GenericOpenSearchApiTool, calls any OpenSearch endpoint, which the README describes as reducing tool explosion.

The same generality is the risk. A tool that reaches any API is a tool that reaches the write APIs, and the server also supports agents supplying the cluster URL per call.

What is the OpenSearch MCP server?

It is the OpenSearch project's server for the Model Context Protocol. The agent gains tools for listing indices, reading mappings, searching, and checking cluster health.

There are two official surfaces. The standalone server runs as a Python process you install. The ML Commons MCP server is built into OpenSearch itself, introduced in 3.0, and is a feature of the cluster rather than a package.

Tools beyond the core nine exist but are off by default, grouped into categories such as search_relevance and skills, enabled through OPENSEARCH_ENABLED_CATEGORIES or a config file.

OpenSearch's standalone server starts with nine core tools, including one that can call any OpenSearch endpoint. Its purpose is log and metric investigation, rather than code changes, releases, agent traces or cost records.

Part of the workWhat OpenSearch has hereCan an agent reach it
Code, tests & reviewNoneNo code-review product
CI & releaseNoneNo CI product, and no build or test pipeline
Production observabilityIndices holding logs, metrics and tracesPartial through this connector. Search and mappings are first-class. There is no alerting or dashboard surface among the core tools
Agent observability & evalsNoneNo traces, evaluations or prompt versioning for your own agents
AI cost managementNoneNo token or model spend data

In practice, OpenSearch answers questions you can express as a query against an index, plus basic cluster health. An agent connected here can search logs, read a mapping and check whether shards are healthy. It cannot read an alert or a dashboard through the core tools, so this is a query tool rather than an observability platform.

What can an AI agent do with OpenSearch?

TaskToolsWorksWatch out for
Find out what data existsListIndexTool IndexMappingToolYesMappings give the agent field names, which it needs before writing a query
Search logs for an errorSearchIndexTool CountToolYesThe cluster caps how many hits one search returns, whatever size the query asks for
Run several searches at onceMsearchToolYesTakes one search per line. The cluster's own limit on concurrent searches is what bounds the result
Check cluster healthClusterHealthTool GetShardsToolYesCluster state, not application behavior
Understand why a document matchedExplainToolYesRelevance scoring detail, useful for search tuning rather than log analysis
Reach an API with no dedicated toolGenericOpenSearchApiToolYesCustom paths, methods and bodies. This reaches writes as well as reads

The last row is the design decision that shapes this connector. Rather than one tool per endpoint, OpenSearch ships one tool for all of them, which keeps the tool list small and moves the surface area into a single call.

9 core tools on by default, with further categories off until enabled

Discovery2
ListIndexToolIndexMappingTool
Querying3
SearchIndexToolMsearchToolCountTool
Cluster2
ClusterHealthToolGetShardsTool
Relevance1
ExplainTool
Any endpoint1Write
GenericOpenSearchApiTool

GenericOpenSearchApiTool is marked as a write because it accepts a custom path, method and body, so it reaches whatever the credentials permit. Further tools sit behind OPENSEARCH_ENABLED_CATEGORIES, including search_relevance and skills. Counted on 21 August 2026.

What connecting costs before the first question

A context window is the amount of text a model can hold at once, and connecting uses some of it before the agent asks anything. Every tool the server registers sends its name, description and input schema to the model when the session starts. The tool list is charged whether or not a single tool is called.

OpenSearch is among the cheapest connectors measured in this guide, and the only one that is cheap by design rather than by being small. GenericOpenSearchApiTool replaces what would otherwise be dozens of endpoint-specific tools, and the optional categories stay off until you name them.

Tool setToolsTokens (GPT-5.6, GPT-5.5)Tokens (GPT-4, GPT-3.5)Tokens (Claude Haiku 4.5 to Opus 5)Share of a 200,000-token window
Core tools, the default91,388 to 2,0751,366 to 2,0792,321 to 2,7640.7% to 1.4%

Encodings: GPT-5.6, GPT-5.5 o200k_base; GPT-4, GPT-3.5 cl100k_base; Claude Haiku 4.5 to Opus 5 count_tokens. Counted 21 August 2026 from tools/list on opensearch-mcp-server-py, run locally with a placeholder URL and credentials.

Registration is static, so no OpenSearch cluster was involved. Figures cover name, description and input schema, for the core tools only. The two models in column one share the o200k_base encoding, so they get one count. The spread is formatting, about 49%. Reasoning tokens are output, spent per request. The tool list is input, charged once at connection.

The Claude figures are measured rather than encoded. Anthropic publishes no local tokenizer, so the definitions were sent to the API's count_tokens endpoint and a no-tools baseline subtracted. The range covers two tokenizer generations rather than two serializations. Haiku 4.5 and Opus 4.6 sit at the low end, Opus 5 and Sonnet 5 at the high end. The gap between them is about a fifth.

OpenSearch MCP server limits: where answers come back incomplete

OpenSearch documents the limits below, and the first two follow from its generic-tool design.

The agent says: I checked the cluster settings. It can also change them.

GenericOpenSearchApiTool accepts a custom path, method and request body, so it is not limited to reads. Whatever the credentials permit, that tool can reach, including index deletion and settings changes.

The other eight tools only read, and each one takes a fixed set of parameters. The generic one is the exception, and it is on by default.

Guard: Give the server a read-only OpenSearch role, and leave GenericOpenSearchApiTool off your client's allowlist unless you need it.

The agent says: I queried the cluster you mentioned. The agent supplied the URL, not you.

The server supports dynamic connection parameters, where an agent passes opensearch_url and credentials with each call. This exists so one agent can work across several clusters in a session, or discover an endpoint from a runbook.

OpenSearch documents guards for exactly this: OPENSEARCH_SSRF_GUARD=true restricts caller-supplied URLs to public HTTPS addresses, and ambient AWS credential fallback is off unless explicitly enabled.

Guard: Set OPENSEARCH_SSRF_GUARD=true when using dynamic connection parameters, and leave the ambient AWS fallback disabled.

The agent says: I have no tool for that. It is behind a category filter.

Tools beyond the core nine ship disabled. Categories such as search_relevance and skills are enabled with OPENSEARCH_ENABLED_CATEGORIES or a config file, and until then the agent cannot see them.

Guard: Enable the categories you need by name, and have the agent list its tools before you trust a negative answer.

How to configure OpenSearch MCP for agents

  1. 1

    Give the server a read-only role

    GenericOpenSearchApiTool can call any endpoint, so the credential rather than the tool list is what bounds it.

  2. 2

    Enable the SSRF guard if you use dynamic connections

    SSRF means server-side request forgery: an agent supplies a URL and the server fetches it. OPENSEARCH_SSRF_GUARD=true restricts caller-supplied URLs to public HTTPS addresses, and OPENSEARCH_ALLOW_AMBIENT_AWS_FALLBACK should stay off.

  3. 3

    Enable only the categories you need

    OPENSEARCH_ENABLED_CATEGORIES turns on groups such as search_relevance and skills; each one adds tools and context cost.

  4. 4

    Treat the built-in server as experimental

    ML Commons ships an MCP server inside OpenSearch 3.0. It avoids running a local process. OpenSearch's own documentation marks it experimental and states it is not recommended for use in a production environment. Use it to evaluate, not to deploy.

Paste this into your agent’s instructions

With one generic tool covering every endpoint, an agent can reach further than the tool names suggest. The block makes it state which endpoint it actually called.

Terminal
When you answer using OpenSearch MCP tools, state:
- The index or indices you searched, and the time range.
- If you used GenericOpenSearchApiTool, the exact path and
  method you called.
- The cluster you queried, if dynamic connection parameters
  are enabled.
Never state that data does not exist. State that none was
returned under the constraints above.
Write your answer in ASD-STE100 Simplified Technical
English. Use short sentences with one idea in each.

Do you need the MCP server at all?

Frequently, yes. OpenSearch's REST API is fully documented, and GenericOpenSearchApiTool is itself close to calling the API directly with an extra layer.

The connector adds discovery. An agent that has ListIndexTool and IndexMappingTool can find out what exists before querying, which is the step that fails most often when an agent writes a query from memory.

The built-in ML Commons server is the other option, with a caveat OpenSearch states plainly: it is experimental and not recommended for production. It is a feature of the cluster rather than a process you run, which suits evaluation in environments where installing a local server is awkward.

Use the standalone server for anything running in production. Consider ML Commons only for evaluation, where running a local process is the obstacle and OpenSearch's experimental designation is acceptable.

OpenSearch MCP server setup

The package runs with uvx and needs OPENSEARCH_URL plus credentials: basic auth, or AWS signing through AWS_REGION and a profile.

Tool filtering is configured with OPENSEARCH_ENABLED_CATEGORIES and OPENSEARCH_DISABLED_CATEGORIES.

Claude Code

Basic auth against a cluster you control. Scope the user to read-only.

Terminal
claude mcp add-json "opensearch" '{"command":"uvx",
  "args":["opensearch-mcp-server-py"],
  "env":{"OPENSEARCH_URL":"https://your-cluster:9200",
         "OPENSEARCH_USERNAME":"<user>",
         "OPENSEARCH_PASSWORD":"<password>"}}'

Cursor

In ~/.cursor/mcp.json for all projects, or .cursor/mcp.json in one.

Terminal
{"mcpServers":{"opensearch":{"command":"uvx",
  "args":["opensearch-mcp-server-py"],
  "env":{"OPENSEARCH_URL":"https://your-cluster:9200",
         "OPENSEARCH_USERNAME":"<user>",
         "OPENSEARCH_PASSWORD":"<password>"}}}}

Codex CLI

Codex reads TOML, so the JSON blocks above will not transfer.

Terminal
[mcp_servers.opensearch]
command = "uvx"
args = ["opensearch-mcp-server-py"]
env = { OPENSEARCH_URL = "https://your-cluster:9200", OPENSEARCH_USERNAME = "<user>", OPENSEARCH_PASSWORD = "<password>" }

Every other client

Each block below is the configuration for one client, with the file path and the key that client expects.

Claude Desktop

macOS ~/Library/Application Support/Claude/claude_desktop_config.json. Windows %APPDATA%\Claude\claude_desktop_config.json. There is no CLI. Edit through Settings, Developer, Edit Config.

Quit and restart fully for changes to load. Paths in args must be absolute. Logs at ~/Library/Logs/Claude/mcp.log.

Terminal
{"mcpServers":{"opensearch":{"command":"uvx",
  "args":["opensearch-mcp-server-py"],
  "env":{"OPENSEARCH_URL":"https://your-cluster:9200","OPENSEARCH_USERNAME":"<user>","OPENSEARCH_PASSWORD":"<password>"}}}}
Gemini CLI

~/.gemini/settings.json globally, or .gemini/settings.json per project. Key mcpServers. CLI: gemini mcp add.

Terminal
{"mcpServers":{"opensearch":{"command":"uvx",
  "args":["opensearch-mcp-server-py"],
  "env":{"OPENSEARCH_URL":"https://your-cluster:9200","OPENSEARCH_USERNAME":"<user>","OPENSEARCH_PASSWORD":"<password>"}}}}
VS Code Copilot

.vscode/mcp.json per workspace, or your user profile. CLI: code --add-mcp.

Terminal
{"servers":{"opensearch":{"command":"uvx",
  "args":["opensearch-mcp-server-py"],
  "env":{"OPENSEARCH_URL":"https://your-cluster:9200","OPENSEARCH_USERNAME":"<user>","OPENSEARCH_PASSWORD":"<password>"}}}}

The key is `servers`, not `mcpServers`. VS Code is the only client that uses that name, and copying a config from anywhere else fails silently.

Windsurf

~/.codeium/windsurf/mcp_config.json, which is the path Windsurf documents. Key mcpServers, the same JSON shape as Cursor, carrying the same cluster credentials.

Zed

~/.config/zed/settings.json, carrying the same cluster credentials as the blocks above.

The key is `context_servers`. Zed does not call them MCP servers in config, so searching its settings for mcp finds nothing.

Google Antigravity

~/.gemini/config/mcp_config.json globally, or .agents/mcp_config.json per project. Key mcpServers. There is no CLI. Use the /mcp overlay in the editor. Supports stdio, streamable HTTP, SSE and websocket.

Terminal
{"mcpServers":{"opensearch":{"command":"uvx",
  "args":["opensearch-mcp-server-py"],
  "env":{"OPENSEARCH_URL":"https://your-cluster:9200","OPENSEARCH_USERNAME":"<user>","OPENSEARCH_PASSWORD":"<password>"}}}}
Amp (Sourcegraph)

~/.config/amp/settings.json or .amp/settings.json, carrying the same cluster credentials. The amp mcp CLI covers approve, doctor and oauth.

The key is `amp.mcpServers`, namespaced. A bare mcpServers block is ignored.

Cline

~/.cline/mcp.json per the docs. The source also reads ~/.cline/data/settings/cline_mcp_settings.json. Key mcpServers, standard JSON shape, carrying the same cluster credentials. Supports stdio, streamable HTTP and SSE.

Goose (Block)

~/.config/goose/config.yaml, carrying the same cluster credentials.

YAML, and servers are called `extensions`. Goose does not use the MCP vocabulary in config at all. Add one interactively with goose configure, or per session with goose session --with-extension.

Kiro (AWS)

.kiro/settings/mcp.json per workspace, or ~/.kiro/settings/mcp.json globally. Key mcpServers, standard JSON shape, carrying the same cluster credentials.

Warp

~/.warp/.mcp.json or .warp/.mcp.json. Key mcpServers, standard shape, carrying the same cluster credentials. Also addable through the /agent-add-mcp skill.

JetBrains Junie

.junie/mcp/mcp.json per project, or ~/.junie/mcp/mcp.json. Key mcpServers, carrying the same cluster credentials. Use /mcp in the CLI to manage.

Roo Code

.roo/mcp.json per project. The global file is mcp_settings.json, opened from the Roo Code MCP settings view with Edit Global MCP. Key mcpServers, carrying the same cluster credentials.

Continue

.continue/mcpServers/*.yaml, one file per server, carrying the same cluster credentials.

YAML, and `mcpServers` is a list, not an object. Every JSON client keys servers by name. Continue takes an array, so a converted config will not parse.

Trae

.trae/mcp.json per project, or paste into the UI under Raw Config (JSON). Key mcpServers, standard shape, carrying the same cluster credentials.

Devin

Devin has no config file to edit. Servers are added through a web form in the settings UI, and Devin's documentation states you do not need to write or paste JSON. The block below is the shape those fields describe, shown for reference. Either route uses the same cluster credentials.

Amazon OpenSearch with AWS signing

This block carries no credentials of its own. AWS signing replaces them: the server signs each request with your AWS profile rather than sending a password.

Terminal
OPENSEARCH_URL=https://search-domain.eu-west-1.es.amazonaws.com \
AWS_REGION=eu-west-1 AWS_PROFILE=default \
uvx opensearch-mcp-server-py
Dynamic connections, guarded

Lets an agent supply the cluster URL per call, along with the credentials for it. No credentials appear in this block for that reason: they arrive with the call, and the guard restricts which URLs are acceptable.

Terminal
OPENSEARCH_SSRF_GUARD=true \
OPENSEARCH_ALLOW_AMBIENT_AWS_FALLBACK=false \
uvx opensearch-mcp-server-py

Read-only access, permissions and security

  • One default tool reaches every endpoint

    GenericOpenSearchApiTool takes a custom path, method and body, so it is bounded by the credential rather than by the tool list.

  • Agents can supply the cluster URL

    Dynamic connection parameters exist so one agent can work across clusters. OPENSEARCH_SSRF_GUARD=true restricts those URLs to public HTTPS addresses.

  • The server's own AWS credentials should stay out of this

    OPENSEARCH_ALLOW_AMBIENT_AWS_FALLBACK lets the server sign caller-supplied URLs with its own credentials, which extends the agent's reach to anything those credentials permit.

  • Give it a read-only role

    The eight non-generic tools read, so a read-only OpenSearch role costs nothing except the generic tool's write capability.

Troubleshooting

The agent has no tool for something documented
Tools beyond the core nine ship disabled. Enable the category with OPENSEARCH_ENABLED_CATEGORIES, naming search_relevance or skills as needed.
401 or 403 on connect
Check the credential type. Basic auth uses OPENSEARCH_USERNAME and OPENSEARCH_PASSWORD; Amazon OpenSearch needs AWS_REGION and a profile so requests are signed.
An agent queried a cluster you did not expect
Dynamic connection parameters let the agent pass opensearch_url per call. Set OPENSEARCH_SSRF_GUARD=true, or avoid enabling dynamic connections.
A query returns nothing on an index you know has data
Have the agent call IndexMappingTool first. Field names come from the mapping, and a query written from memory fails as an empty result.

OpenSearch MCP server: Reference

ItemValue
StatusRepository pushed 20 August 2026 · Apache 2.0
Adoption147 stars
Packageopensearch-mcp-server-py on PyPI, run with uvx
Second serverML Commons MCP server, built into OpenSearch 3.0 (experimental; OpenSearch does not recommend it for production)
AuthBasic auth, or AWS signing with AWS_REGION and a profile
Tools9 core on by default · further categories behind OPENSEARCH_ENABLED_CATEGORIES
Read-onlyNo flag. Use a read-only OpenSearch role
GuardsOPENSEARCH_SSRF_GUARD for caller-supplied URLs

What engineers report

The connector has 147 stars, is Apache 2.0 and was pushed on 20 August 2026. Public discussion is small, so the two issues below are the record rather than a sample of opinion.

What was checkedWhat it shows
Stars147
Last push20 August 2026
LicenseApache 2.0
Tools9 core, with further categories off by default
Official serversTwo: this one, and an experimental one built into OpenSearch 3.0 through ML Commons

“If the LLM uses the wrong field (e.g., response instead of response.keyword for an aggregation), OpenSearch does not raise an error, it simply returns an empty result.”

ssunno, GitHub issue, 22 June 2025 · An empty result that means a wrong field rather than no data, which is the failure this page warns about.

“Currently, the query appears to only support simple keyword searches, and semantic searches do not seem to be supported.”

mateon01, GitHub issue, 17 June 2025 · Query capability, on an issue still open at the time of writing.

Repository facts from the GitHub API, retrieved 21 August 2026. Tool counts come from the server's own tools/list response, not from the README.

Should you connect an agent to OpenSearch?

Yes. Best for OpenSearch teams giving the server a read-only role and enabling the SSRF guard.

Strongest fit
Teams running OpenSearch who want an agent to explore an unfamiliar cluster: what indices exist, what the fields are, what the logs say.
Main advantage
Very low context cost for real reach, achieved by one generic API tool instead of dozens of specific ones.
Main weakness
Core tools cover search and health only. Alerting and dashboards need categories you enable yourself.
Operational risk
The generic API tool reaches write endpoints, and dynamic connection parameters let an agent choose the cluster.

From Oodle

One platform for agent traces and infrastructure

Agent traces usually sit in a different product from the rest of your telemetry, so when a slow database makes an agent slow the symptom is in one tool and the cause is in another. Oodle keeps both in one query surface, from $10 per million spans.

See agent observability

Frequently asked questions

How many tools does the OpenSearch MCP server have?

Nine core tools on a default connection, with further categories such as search_relevance and skills available behind a filter. Counted from the server's own tools/list response, 21 August 2026.

Why is one tool called GenericOpenSearchApiTool?

It calls any OpenSearch endpoint with a custom path, method and body. The README describes this as reducing tool explosion, and it is why nine tools cover so much.

Can an agent delete an index?

If the credentials allow it, yes, through the generic API tool. Give the server a read-only role and keep that tool off your allowlist unless you need it.

Is there a second official server?

Yes, with a caveat. OpenSearch ships an MCP server inside ML Commons, introduced in 3.0, which is a feature of the cluster rather than a package you install. OpenSearch marks it experimental and states it is not recommended for use in a production environment.

Can the agent pick which cluster to query?

Yes, through dynamic connection parameters. Set OPENSEARCH_SSRF_GUARD=true to restrict caller-supplied URLs to public HTTPS addresses.

Changelog

  • 29 July 2026. opensearch-project/opensearch-mcp-server-py 0.11.0 released, the most recent version.
  • 24 July 2025. 0.3.0 released. The first release on PyPI, 0.0.1, dates from 7 May 2025.
  • 14 May 2025. opensearch-project/opensearch-mcp-server-py created on GitHub.

Sources

Every number on this page traces to one of these

  1. Repository facts from the GitHub API · opensearch-project/opensearch-mcp-server-py, retrieved 21 August 2026
  2. Tool descriptions, category filtering and the SSRF guard from the repository README and user guide
  3. Tool counts from the server's own tools/list response on the published package
  4. ML Commons MCP server availability from the OpenSearch documentation site

OpenSearch’s own MCP documentation

Also search and log stores:

Also production observability: