Provides tools to manage and query a knowledge base within Elastic, including document ingestion, text chunking, and semantic search retrieval.
Allows indexing documentation, extracting text from PDFs, and performing semantic search queries against an Elasticsearch knowledge base.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ElasticMind-MCPsearch the documentation for our company's security protocols"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SME Knowledge Base ā MCP Server
This repository provides an MCP (Model Context Protocol) server that indexes documentation into Elasticsearch and exposes tools to query it from MCP-compatible clients such as Claude Desktop, Cursor, and GitHub Copilot.
š Features
Smart Indexing: Uses deterministic IDs to prevent duplicate entries in Elasticsearch.
Semantic Search: Query the knowledge base using Elasticsearch's matching capabilities.
Dynamic Updates: Add new text content directly via MCP tools.
Robustness: Gracefully handles database connection failures.
Prerequisites
Before running the server, ensure the following are installed:
Python 3.11+
Docker (for running Elasticsearch)
uv (Python package and project manager)
š¦ Setup
1. Start Elasticsearch
The server requires a running Elasticsearch instance. You can start one easily using Docker:
(Note: Ensure the version tag matches your requirements. Version 8.11.0 is used here as a stable default.)
2. Install Dependencies
Navigate to the project directory and install the required Python packages:
3. Ingest Data
Place your PDF documents in the input/ folder and run the extraction script to generate the data/docs.json index file:
š§© Configuration
To use this server with Claude Desktop, Cursor, or GitHub Copilot, you need to configure the MCP settings.
1. Locate Paths
You will need the absolute paths for both the uv executable and your cloned repository.
Find
which uvFind Repository path:
pwd
2. Edit Configuration File
A template configuration file is provided in mcp.json. You can copy its content, but remember to update the paths to be absolute.
Open Claude Desktop.
Go to Settings > Developer > Edit Config.
Add the following configuration to the
mcpServersobject in the JSON file:
Replace
š§ Available Tools
The server exposes the following tools to the LLM:
Tool Name | Description |
| Scans the |
| Manually triggers the indexing process from |
| Adds a new text document to the knowledge base. Features: ⢠Updates both persistent storage ( ⢠Automatically chunks content > 1000 words. ⢠Generates unique IDs. |
| Accepts a search query string and returns the top 2 most relevant document sections (Heading + Content). |
š Example Workflow
Start Elasticsearch: Ensure your Docker container is running.
docker start elasticsearchAdd Documents: Drop any PDF files you want to index into the
input/folder.Start Server: When you open Claude Desktop or Cursor, the server starts automatically.
It will scan
input/, extract text from new PDFs, and index them into Elasticsearch.
Interact:
"What does the document say about [topic]?" (Uses
query_knowledge_base)"Add this meeting note to the knowledge base: [content]" (Uses
add_text_to_index)
Troubleshooting
Connection Refused: Ensure the Docker container is running (
docker ps) and port 9200 is accessible.Path Errors: Double-check that the paths in your config JSON are absolute (start with
/) and point to the correct locations.