MCP server for OpenSearch Dashboards
Project description
opensearch-dashboard-mcp
MCP server that exposes OpenSearch Dashboards to an LLM client over stdio. Read saved objects, list tenants and index patterns, and query logs like the Discover app — all through the Dashboards API, so it works even when the raw OpenSearch REST API isn't exposed.
Run
uvx opensearch-dashboard-mcp
(After publishing to PyPI. For local dev use uvx --from . opensearch-dashboard-mcp.)
Configure
Environment variables:
| Variable | Default | Purpose |
|---|---|---|
OPENSEARCH_DASHBOARDS_URL |
http://localhost:5601 |
Base URL |
OPENSEARCH_DASHBOARDS_USERNAME |
— | Basic auth / session-login user |
OPENSEARCH_DASHBOARDS_PASSWORD |
— | Basic auth / session-login password |
OPENSEARCH_DASHBOARDS_VERIFY_TLS |
true |
Verify TLS certs |
SSH_PROXY_TO |
— | If set (e.g. user@host), route all requests through an embedded SSH SOCKS5 tunnel to that host |
SSH_PROXY_PORT |
auto | Local port for the tunnel; a free port is picked when unset |
SSH tunnel
When SSH_PROXY_TO is set, the server spawns ssh -N -D <port> <host> before
serving and routes HTTP through the resulting socks5h:// proxy. DNS is resolved
on the remote side, so this reaches targets only visible from a remote network
(e.g. a VPN living inside a container). Requires key-based SSH auth (runs with
BatchMode=yes). The tunnel lives exactly as long as the server.
Use in an MCP client
{
"mcpServers": {
"opensearch-dashboards": {
"command": "uvx",
"args": ["opensearch-dashboard-mcp"],
"env": {
"OPENSEARCH_DASHBOARDS_URL": "http://localhost:5601",
"OPENSEARCH_DASHBOARDS_USERNAME": "admin",
"OPENSEARCH_DASHBOARDS_PASSWORD": "admin"
}
}
}
}
Tools
ping()— check connectivity + auth. Hits the security authinfo endpoint; on a 401 with credentials set, performs a session login and re-checks. Returns{connected, authenticated, user, tenants}or the error reason.list_saved_objects(type_="dashboard", per_page=20, tenant=None)— saved objects viasaved_objects/_find, returned as compact{id, title, type}.tenantselects the multi-tenancy tenant (name,"__user__"for the private tenant, orNonefor the user default).get_tenants()— multi-tenancy tenants via the security plugin config API, as{name, description, reserved, hidden}.get_index_patterns(per_page=50)— index patterns (saved objects of typeindex-pattern), as{id, title, time_field}.discover_search(index, query=None, time_from=None, time_to=None, time_field="@timestamp", size=10, fields=None, tenant=None)— fetch documents like the Discover app through the internal search API (/internal/search/opensearch).queryis a Lucene query_string;time_from/time_tofilter a range (now-15m, ISO, …);fieldstrims_sourceto avoid flooding context. Returns{index, total, count, hits}.
Multi-tenancy note: saved objects are stored per tenant. Discover available tenant
names with get_tenants, then pass one as tenant to the other tools.
Develop
uv sync --group dev
uv run opensearch-dashboard-mcp # starts on stdio; Ctrl-D to exit
uv run pytest # tests (add --cov for the 100% gate)
Layout: config.py (env → Settings), client.py (async httpx wrapper),
tools.py (tool registrations), server.py (entry point + tunnel), tunnel.py
(SSH SOCKS5 tunnel). See CLAUDE.md for the architecture in depth.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opensearch_dashboard_mcp-0.1.0.tar.gz.
File metadata
- Download URL: opensearch_dashboard_mcp-0.1.0.tar.gz
- Upload date:
- Size: 96.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd06dbc4ddd273d9dd319f436d78f8b5c4828d0edec8fdf446e923bb93065ab9
|
|
| MD5 |
7490c269982f46efa1b72ab75257f450
|
|
| BLAKE2b-256 |
982737276031a1b7ed1eef4c63e40d1bb30e1036b98b56c9afa6fc4ff37cccc6
|
Provenance
The following attestation bundles were made for opensearch_dashboard_mcp-0.1.0.tar.gz:
Publisher:
publish.yml on danilin-em/opensearch-dashboard-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opensearch_dashboard_mcp-0.1.0.tar.gz -
Subject digest:
fd06dbc4ddd273d9dd319f436d78f8b5c4828d0edec8fdf446e923bb93065ab9 - Sigstore transparency entry: 2188760951
- Sigstore integration time:
-
Permalink:
danilin-em/opensearch-dashboard-mcp@56d83a7d7ee181dadcfdfafcded98b4e7364e749 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/danilin-em
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@56d83a7d7ee181dadcfdfafcded98b4e7364e749 -
Trigger Event:
release
-
Statement type:
File details
Details for the file opensearch_dashboard_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: opensearch_dashboard_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06f2fec4378aa59cf7e2eef9df2399fa6cc5a7ac85a723e9476e46b75f6c776b
|
|
| MD5 |
df6900b5a7fa6bdae4c7ed9eb7c36353
|
|
| BLAKE2b-256 |
ababb2bb74a23d2e1e099c850e948c5236f1a368dcbda8e735118f7c06727eea
|
Provenance
The following attestation bundles were made for opensearch_dashboard_mcp-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on danilin-em/opensearch-dashboard-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opensearch_dashboard_mcp-0.1.0-py3-none-any.whl -
Subject digest:
06f2fec4378aa59cf7e2eef9df2399fa6cc5a7ac85a723e9476e46b75f6c776b - Sigstore transparency entry: 2188760961
- Sigstore integration time:
-
Permalink:
danilin-em/opensearch-dashboard-mcp@56d83a7d7ee181dadcfdfafcded98b4e7364e749 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/danilin-em
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@56d83a7d7ee181dadcfdfafcded98b4e7364e749 -
Trigger Event:
release
-
Statement type: