ElasticMind-MCP
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 "Deploy 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-MCP search 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.
Related MCP server: local-document-rag-agent
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:
docker run -d --name elasticsearch \
-p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e "xpack.security.enabled=false" \
-e ES_JAVA_OPTS="-Xms1g -Xmx1g" \
docker.elastic.co/elasticsearch/elasticsearch:9.1.5(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:
uv sync
# OR
pip install -e .3. Ingest Data
Place your PDF documents in the input/ folder and run the extraction script to generate the data/docs.json index file:
uv run extraction.py🧩 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
uvpath: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:
{
"mcpServers": {
"sme-knowledge-base": {
"command": "/absolute/path/to/uv",
"args": [
"run",
"--directory",
"/absolute/path/to/my_server_sme",
"elastic_server.py"
],
"env": {
"ES_HOST": "http://localhost:9200"
}
}
}
}Replace /absolute/path/to/uv and /absolute/path/to/my_server_sme with the actual paths identified in Step 1.
🔧 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 ( |
| 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.
Available Tools
4 toolsadd_text_to_indexA
Adds a new text document to the knowledge base.
If the content exceeds 1000 words, it will be chunked into smaller documents.
Updates both the persistent JSON storage and the Elasticsearch index.
Args:
title: A descriptive title for the text.
content: The actual text content to index.
Inputs: title (required), content (required). Returns: result
index_documentsA
Reads documents from data/docs.json and indexes them into Elasticsearch. Call this tool to initialize or update the knowledge base.
Inputs: no named parameters. Returns: result
ingest_pdfsB
Takes all documents currently in input folder and creates output.json to process them add them to index to enable knowledge base powered querying.
Inputs: no named parameters. Returns: result
query_knowledge_baseA
Query the knowledge base for relevant documents.
Returns the top-2 documents' content and heading to be used as context.
Args:
query: The search query string.
Inputs: query (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
The tools have some overlap in purpose that could cause confusion. Both 'add_text_to_index' and 'ingest_pdfs' add documents to the knowledge base, though from different sources. 'index_documents' also indexes documents but from a specific JSON file, creating potential ambiguity about when to use each ingestion method. The descriptions help clarify the differences, but the boundaries between these three tools are not perfectly distinct.
The naming follows a mostly consistent pattern with three tools using verb_noun format ('add_text_to_index', 'index_documents', 'ingest_pdfs') and one using verb_noun_noun ('query_knowledge_base'). All use snake_case consistently. The minor deviation is that 'query_knowledge_base' has an extra noun component, but the pattern remains readable and predictable.
Four tools is well-scoped for a knowledge base server. Each tool appears to earn its place with distinct functions: document ingestion from different sources, indexing initialization, and querying. This count provides complete coverage without being overwhelming for the apparent scope of managing and querying a knowledge base.
The tool surface has notable gaps in the document lifecycle. While it covers ingestion from multiple sources and querying, there are no tools for updating, deleting, or managing existing documents in the knowledge base. The server appears focused on building and querying the knowledge base, but lacks maintenance operations that would be needed for a complete CRUD lifecycle.
Related MCP Connectors
MCP server for querying Forkast documentation
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
The Needle MCP server enables semantic search on documents stored in files like PDFs, DOCX, and XLSX by connecting AI applications to external data sources. It provides capabilities to create and manage document collections, perform natural language searches on stored content, and retrieve relevant information without requiring exact keyword matches.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA local-first MCP server that enables semantic search over PDF and DOCX documents using structure-aware parsing and vector storage. It allows users to query their local knowledge base through Claude Code without cloud dependencies or GPU requirements.1-
- FlicenseNot gradedqualityDmaintenanceMCP server enabling Claude Desktop to answer questions from local Word and PDF documents by searching a vector index built from their contents.-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to directly interact with Elasticsearch for searching, aggregating, and retrieving documents from indices, supporting full-text search, semantic search, and various query modes.29 npmMIT
- AlicenseAqualityDmaintenanceA local document search MCP server that indexes folders and provides hybrid keyword+semantic search, enabling users to chat with their documents via MCP clients like Claude Desktop or Claude Code.821 PyPIMIT