{"id":26671830,"url":"https://github.com/elastic/mcp-server-elasticsearch","last_synced_at":"2025-05-16T18:06:44.119Z","repository":{"id":284143372,"uuid":"953992846","full_name":"elastic/mcp-server-elasticsearch","owner":"elastic","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-09T02:06:51.000Z","size":107,"stargazers_count":181,"open_issues_count":24,"forks_count":23,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-12T00:17:40.449Z","etag":null,"topics":["elasticsearch","mcp","mcp-server","vector-database"],"latest_commit_sha":null,"homepage":"https://www.elastic.co/elasticsearch","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elastic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-24T11:59:18.000Z","updated_at":"2025-05-11T16:39:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5aeffa5-609f-437a-bb13-df212bfebc71","html_url":"https://github.com/elastic/mcp-server-elasticsearch","commit_stats":null,"previous_names":["elastic/mcp-server-elasticsearch"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fmcp-server-elasticsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fmcp-server-elasticsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fmcp-server-elasticsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fmcp-server-elasticsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elastic","download_url":"https://codeload.github.com/elastic/mcp-server-elasticsearch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253655518,"owners_count":21943063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elasticsearch","mcp","mcp-server","vector-database"],"created_at":"2025-03-26T00:35:12.960Z","updated_at":"2025-05-16T18:06:44.114Z","avatar_url":"https://github.com/elastic.png","language":"JavaScript","funding_links":[],"categories":["Databases","Search \u0026 Discovery Mcp Servers","MCP 服务器精选列表","📚 Projects (1974 total)","Production-Ready Servers","🏗️ Infrastructure, Utils \u0026 Orchestration","官方 MCP 服务器列表","Servers","Rust","MCP Servers","🧰 MCP Tools","APIs and HTTP Requests","🔧 Utilities","*Ops for AI"],"sub_categories":["Search Engines","🗄️ 数据库交互","MCP Servers","🛡️ Security Operations (Blue/Purple)","Data \u0026 Databases","How to Submit","Databases","🏢 Enterprise, Cloud \u0026 Threat Intelligence MCP Servers","Model Serving \u0026 Inference"],"readme":"# Elasticsearch MCP Server\n\nThis repository contains experimental features intended for research and evaluation and are not production-ready.\n\nConnect to your Elasticsearch data directly from any MCP Client (like Claude Desktop) using the Model Context Protocol (MCP).\n\nThis server connects agents to your Elasticsearch data using the Model Context Protocol. It allows you to interact with your Elasticsearch indices through natural language conversations.\n\n\u003ca href=\"https://glama.ai/mcp/servers/@elastic/mcp-server-elasticsearch\"\u003e\n  \u003cimg width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/@elastic/mcp-server-elasticsearch/badge\" alt=\"Elasticsearch Server MCP server\" /\u003e\n\u003c/a\u003e\n\n## Available Tools\n\n* `list_indices`: List all available Elasticsearch indices\n* `get_mappings`: Get field mappings for a specific Elasticsearch index\n* `search`: Perform an Elasticsearch search with the provided query DSL\n* `get_shards`: Get shard information for all or specific indices\n\n## Prerequisites\n\n* An Elasticsearch instance\n* Elasticsearch authentication credentials (API key or username/password)\n* MCP Client (e.g. Claude Desktop)\n\n## Demo\n\nhttps://github.com/user-attachments/assets/5dd292e1-a728-4ca7-8f01-1380d1bebe0c\n\n## Installation \u0026 Setup\n\n### Using the Published NPM Package\n\n\u003e [!TIP]\n\u003e The easiest way to use Elasticsearch MCP Server is through the published npm package.\n\n1. **Configure MCP Client**\n   - Open your MCP Client. See the [list of MCP Clients](https://modelcontextprotocol.io/clients), here we are configuring Claude Desktop.\n   - Go to **Settings \u003e Developer \u003e MCP Servers**\n   - Click `Edit Config` and add a new MCP Server with the following configuration:\n\n   ```json\n   {\n     \"mcpServers\": {\n       \"elasticsearch-mcp-server\": {\n         \"command\": \"npx\",\n         \"args\": [\n           \"-y\",\n           \"@elastic/mcp-server-elasticsearch\"\n         ],\n         \"env\": {\n           \"ES_URL\": \"your-elasticsearch-url\",\n           \"ES_API_KEY\": \"your-api-key\"\n         }\n       }\n     }\n   }\n   ```\n\n2. **Start a Conversation**\n   - Open a new conversation in your MCP Client\n   - The MCP server should connect automatically\n   - You can now ask questions about your Elasticsearch data\n\n### Configuration Options\n\nThe Elasticsearch MCP Server supports configuration options to connect to your Elasticsearch:\n\n\u003e [!NOTE]\n\u003e You must provide either an API key or both username and password for authentication.\n\n\n| Environment Variable | Description | Required |\n|---------------------|-------------|----------|\n| `ES_URL` | Your Elasticsearch instance URL | Yes |\n| `ES_API_KEY` | Elasticsearch API key for authentication | No |\n| `ES_USERNAME` | Elasticsearch username for basic authentication | No |\n| `ES_PASSWORD` | Elasticsearch password for basic authentication | No |\n| `ES_CA_CERT` | Path to custom CA certificate for Elasticsearch SSL/TLS | No |\n\n\n### Developing Locally\n\n\u003e [!NOTE]\n\u003e If you want to modify or extend the MCP Server, follow these local development steps.\n\n1. **Use the correct Node.js version**\n   ```bash\n   nvm use\n   ```\n\n2. **Install Dependencies**\n   ```bash\n   npm install\n   ```\n\n3. **Build the Project**\n   ```bash\n   npm run build\n   ```\n\n4. **Run locally in Claude Desktop App**\n   - Open **Claude Desktop App**\n   - Go to **Settings \u003e Developer \u003e MCP Servers**\n   - Click `Edit Config` and add a new MCP Server with the following configuration:\n\n   ```json\n   {\n     \"mcpServers\": {\n       \"elasticsearch-mcp-server-local\": {\n         \"command\": \"node\",\n         \"args\": [\n           \"/path/to/your/project/dist/index.js\"\n         ],\n         \"env\": {\n           \"ES_URL\": \"your-elasticsearch-url\",\n           \"ES_API_KEY\": \"your-api-key\"\n         }\n       }\n     }\n   }\n   ```\n\n5. **Debugging with MCP Inspector**\n   ```bash\n   ES_URL=your-elasticsearch-url ES_API_KEY=your-api-key npm run inspector\n   ```\n\n   This will start the MCP Inspector, allowing you to debug and analyze requests. You should see:\n\n   ```bash\n   Starting MCP inspector...\n   Proxy server listening on port 3000\n\n   🔍 MCP Inspector is up and running at http://localhost:5173 🚀\n   ```\n\n## Contributing\n\nWe welcome contributions from the community! For details on how to contribute, please see [Contributing Guidelines](/docs/CONTRIBUTING.md).\n\n## Example Questions\n\n\u003e [!TIP]\n\u003e Here are some natural language queries you can try with your MCP Client.\n\n* \"What indices do I have in my Elasticsearch cluster?\"\n* \"Show me the field mappings for the 'products' index.\"\n* \"Find all orders over $500 from last month.\"\n* \"Which products received the most 5-star reviews?\"\n\n## How It Works\n\n1. The MCP Client analyzes your request and determines which Elasticsearch operations are needed.\n2. The MCP server carries out these operations (listing indices, fetching mappings, performing searches).\n3. The MCP Client processes the results and presents them in a user-friendly format.\n\n## Security Best Practices\n\n\u003e [!WARNING]\n\u003e Avoid using cluster-admin privileges. Create dedicated API keys with limited scope and apply fine-grained access control at the index level to prevent unauthorized data access.\n\nYou can create a dedicated Elasticsearch API key with minimal permissions to control access to your data:\n\n```\nPOST /_security/api_key\n{\n  \"name\": \"es-mcp-server-access\",\n  \"role_descriptors\": {\n    \"mcp_server_role\": {\n      \"cluster\": [\n        \"monitor\"\n      ],\n      \"indices\": [\n        {\n          \"names\": [\n            \"index-1\",\n            \"index-2\",\n            \"index-pattern-*\"\n          ],\n          \"privileges\": [\n            \"read\",\n            \"view_index_metadata\"\n          ]\n        }\n      ]\n    }\n  }\n}\n```\n\n## License\n\nThis project is licensed under the Apache License 2.0.\n\n## Troubleshooting\n\n* Ensure your MCP configuration is correct.\n* Verify that your Elasticsearch URL is accessible from your machine.\n* Check that your authentication credentials (API key or username/password) have the necessary permissions.\n* If using SSL/TLS with a custom CA, verify that the certificate path is correct and the file is readable.\n* Look at the terminal output for error messages.\n\nIf you encounter issues, feel free to open an issue on the GitHub repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Fmcp-server-elasticsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felastic%2Fmcp-server-elasticsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Fmcp-server-elasticsearch/lists"}