Skip to main content

Elasticsearch MCP server — query logs with or without SSH tunnel

Project description

Elasticsearch MCP Server

Query Elasticsearch logs directly from Claude Cowork — with or without an SSH tunnel.


Installation

1. Install the plugin

Get es-mcp from the Cowork plugin marketplace and install it.

2. Install uv

The MCP server runs via uvx, which requires uv to be installed on your machine:

# Windows
powershell -ExecutionPolicy Bypass -c "irm https://astral.sh/uv/install.ps1 | iex"
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

3. Configure the MCP server

Open claude_desktop_config.json:

Windows:  %APPDATA%\Claude\claude_desktop_config.json
macOS:    ~/Library/Application Support/Claude/claude_desktop_config.json

Add the entry inside "mcpServers": { }:

{
  "mcpServers": {
    "elasticsearch-logs": {
      "command": "uvx",
      "args": ["artisan-es-reader-plugin@latest", "artisan-es-reader-plugin"],
      "env": {
        "ES_HOST": "localhost",
        "ES_PORT": "9200",
        "ES_USERNAME": "your-es-username",
        "ES_PASSWORD": "your-es-password",
        "ES_USE_SSL": "true",
        "ES_VERIFY_CERTS": "false",
        "SSH_HOST": "your-bastion-ip",
        "SSH_PORT": "22",
        "SSH_USERNAME": "ubuntu",
        "SSH_PEM_FILE": "C:\\Users\\your-name\\path\\to\\key.pem",
        "SSH_REMOTE_ES_HOST": "localhost",
        "SSH_REMOTE_ES_PORT": "9200",
        "SSH_LOCAL_PORT": "0"
      }
    }
  }
}

Each team member only needs to fill in these personal values:

Variable Description
ES_USERNAME Elasticsearch username
ES_PASSWORD Elasticsearch password
SSH_HOST Bastion / jump host IP or hostname
SSH_PEM_FILE Absolute path to your local PEM key file

Windows paths must use double backslashes in JSON: C:\\Users\\your-name\\key.pem

4. Restart Cowork

The SSH tunnel starts automatically on first tool use.


Notes

  • ES_HOST is only used for direct connections. When SSH_HOST is set, traffic routes through the tunnel and ES_HOST is ignored.
  • ES_USE_SSL: set true if your Elasticsearch runs HTTPS.
  • ES_VERIFY_CERTS: set false for self-signed certificates.
  • SSH_LOCAL_PORT: 0 = auto-pick a free local port.
  • To connect without SSH tunnel, leave SSH_HOST empty.

Updating

For users

Updates are automatic — just restart Cowork and uvx will pull the latest version from PyPI.

For maintainers

  1. Make changes to src/es_mcp/server.py
  2. Bump the version in pyproject.toml
  3. Build and publish:
    python -m build
    twine upload dist/*
    
  4. Users get the new version automatically on next Cowork restart — no action needed on their end

Available tools

Tool What it does
list_indices List indices (supports glob pattern)
search_logs Full-text search with filters, sort, pagination
get_recent_errors Error-level entries from the last N minutes
get_index_mapping Field schema for an index
run_aggregation Run a custom ES aggregation
connection_info Show active connection / tunnel status

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

artisan_es_reader_plugin-0.2.0.tar.gz (88.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

artisan_es_reader_plugin-0.2.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file artisan_es_reader_plugin-0.2.0.tar.gz.

File metadata

  • Download URL: artisan_es_reader_plugin-0.2.0.tar.gz
  • Upload date:
  • Size: 88.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for artisan_es_reader_plugin-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5e599c9b9da62e6716a4bb657a235c8d4d4afbd6a124dd6ae1cabfc8acc1bfd0
MD5 1d02666a47557b925179796b1dd764da
BLAKE2b-256 6dbe26d65dcd67270474edf4a270aaa81fd693e714e9a299d571cfbbddf67b81

See more details on using hashes here.

File details

Details for the file artisan_es_reader_plugin-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for artisan_es_reader_plugin-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b442e6cf90bfe215207867728d597aa14d46bbe9d425c795239e3baf8751bac
MD5 3daf36aaaf8a6e90566a687a30695232
BLAKE2b-256 912e64756430a87ea47fe26b0664601ec124e1dee825daa2e3e585dd17458d04

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page