ElasticMind-MCP
An MCP server that indexes PDF documentation and text into Elasticsearch for semantic search and retrieval. It enables users to query knowledge bases, ingest new files, and dynamically update content through MCP-compatible clients like Claude Desktop and Cursor.
README
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:
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 uv - Find 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 |
|---|---|
ingest_pdfs |
Scans the input/ directory for new PDFs, extracts text, updates docs.json, and indexes everything into Elasticsearch. Call this after adding new files. |
index_documents |
Manually triggers the indexing process from data/docs.json to Elasticsearch. Useful if you've modified the JSON file directly. |
add_text_to_index |
Adds a new text document to the knowledge base. Features: <br>• Updates both persistent storage (docs.json) and Elasticsearch.<br>• Automatically chunks content > 1000 words.<br>• Generates unique IDs. |
query_knowledge_base |
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 elasticsearch - Add 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.
- It will scan
- 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)
- "What does the document say about [topic]?" (Uses
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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。