Share Elasticsearch MCP tools.
Index and mapping exploration with query-DSL search — scoped API keys strongly recommended.
Run on your machine
Start the server on your host machine. Tools not listed in --allow are completely hidden from the agent.
npx -y @mcpwire/cli share \
--name elasticsearch \
--allow "list_indices,get_mappings,search,get_shards" \
--redact-secrets \
-- npx -y @elastic/mcp-server-elasticsearch@0.3.1
Exposes 4 default tools with pattern-based secret redaction.
Optionally set an expiry with --ttl 30m, prompt for approvals with --confirm, or limit calls with --max-calls 20.
Connect your teammate’s agent
MCPWire prints a unique wire://... ticket in your terminal. Send it privately to your teammate to paste into their MCP client:
{
"mcpServers": {
"elasticsearch": {
"command": "npx",
"args": [
"-y",
"@mcpwire/cli",
"join",
"wire://<TICKET_FROM_HOST>"
]
}
}
}
Replace <TICKET_FROM_HOST> with the active session ticket. The agent can only discover and call the tools exposed above.
Scoped tool permissions
MCPWire acts as a Layer 7 JSON-RPC firewall. Requests for blocked tools are dropped on the wire before ever touching your machine.
| Tool | Default Policy | Notes |
|---|---|---|
list_indices | Allowed | Lists indices the credentials can see. |
get_mappings | Allowed | Reads field mappings for an index. |
search | Allowed | Runs query-DSL searches and returns document contents from permitted indices — scope the API key to data that can be shared. |
get_shards | Allowed | Reads shard allocation info. |
Test and verify
Try these recommended prompts to confirm the agent receives expected outputs and that restricted actions fail safely.
Try Elasticsearch
Set ES_URL in the host environment plus either ES_API_KEY or both ES_USERNAME and ES_PASSWORD. Create a dedicated API key with read-only privileges on the specific indices you intend to share (the server’s own security guide shows the POST /_security/api_key shape). This is Elastic’s official server, currently labeled experimental.
Ask the agent what data is reachable with list_indices, then inspect an index with get_mappings and run a DSL query with search. Searches return actual document contents, so the credential scope — not the allowlist — is what limits disclosure. All four tools are read-only.
The generated command above contains the catalog’s explicit default allowlist. Check the guest’s tool list before making calls and use the server’s argument schema for required fields. See the CLI guide for guest configuration and session controls for approvals, redaction, and expiry.
--record session.wirelog to your host command. Drop the resulting file into the Session Replay Viewer to inspect timestamps, latency, blocked attempts, and secret scrubbing.