
ES-知识基准MCP
将文档从网络无缝加载到Elasticsearch中,并立即允许您的LLM或AI助手进入向量搜索文档。
3 years
Works with Finder
0
Github Watches
0
Github Forks
0
Github Stars
Elasticsearch Knowledge Base MCP Server
Overview
This MCP server empowers your AI Assistant to ASK, LEARN, and REMEMBER:
-
ASK: Ask questions of the gathered knowledge bases, in plain language like, "What's the best way to use
local_example
in ruby Rspec tests?". - LEARN: Obtain and index entire documentation stores (e.x. every word of every page of https://docs.pytest.org/en/stable/contents.html) from the Web, git repositories, or the local filesystem.
- REMEMBER: Store working information, user preferences, and rules as "memories" for future reference.
Internally, the server uses a KnowledgeBaseClient
protocol to abstract interactions with the knowledge base backend, allowing for potential future flexibility. The current implementation uses Elasticsearch.
This MCP Server is powered by Elasticsearch Serverless Search (Start a free trial) for inference, and vector search, and Elastic Crawler for crawling, parsing, and indexing.
Benefits
This MCP Server significantly reduces token usage of the AI Assistant by allowing it to reference specific documentation for the task at hand instead of relying on the AI model's internal knowledge. This allows the AI Assistant to one-shot complex tasks because it doesn't need to guess parameter names, types, or usage. It also allows the AI Assistant to reference documentation as needed without needing to be trained on it.
Demo
Searching Documentation
See how you can autonomously search documentation stored in a knowledge base to gather details needed for a task:
https://github.com/user-attachments/assets/64b5fee1-a983-4a92-9485-bfc54f879374
Crawling Documentation
Watch how you can identify project dependencies and automatically crawl relevant web documentation to build a knowledge base:
https://github.com/user-attachments/assets/c7226aa9-9b40-45fb-877b-8721550e0576
Configuration
To use this server, the MCP host (e.g., Roo VS Code extension, Cline, VS Code) must be configured with the connection details for the target Elasticsearch cluster, including the host URL and authentication credentials (like an API Key).
This server requires connection details for your Elasticsearch cluster and is configured directly within your MCP host's settings file (e.g., mcp_settings.json
for the Roo VS Code extension).
The recommended way to run this server is using uvx
, which handles fetching and running the code directly from GitHub.
VS Code
- Open the command palette (Ctrl+Shift+P or Cmd+Shift+P).
- Type "Settings" and select "Preferences: Open User Settings (JSON)".
- Add the following MCP Server configuration
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "es-host",
"description": "Elasticsearch Host",
"password": false
},
{
"type": "promptString",
"id": "es-api-key",
"description": "Elasticsearch API Key",
"password": false
}
],
"servers": {
"External Documentation - GitHub": {
"command": "uvx",
"args": [
"git+https://github.com/strawgate/es-documentation-manager-mcp"
],
"env": {
"ES_HOST": "${input:es-host}",
"ES_API_KEY": "${input:es-api-key}",
},
}
}
}
}
Cline / Roo Code
Add the following configuration block to your mcpServers
object:
"Knowledge Base": {
"command": "uvx",
"args": [
"git+https://github.com/strawgate/es-knowledge-base-mcp"
],
"env": {
"ES_HOST": "https://YOUR_ELASTICSEARCH_HOST_URL:443",
// --- Authentication: Provide EITHER API Key
"ES_API_KEY": "YOUR_BASE64_ENCODED_API_KEY",
// OR Username/Password
"ES_USERNAME": "YOUR_ELASTICSEARCH_USERNAME",
"ES_PASSWORD": "YOUR_ELASTICSEARCH_PASSWORD",
},
"alwaysAllow": [
"get_documentation_types",
"pull_crawler_image",
"crawl_domains",
"search_specific_documentation",
"search_all_documentation",
"get_document_by_url",
"get_document_by_title"
],
"disabled": false
}
Available Tools
The knowledge-base
server provides the following tools to interact with Elasticsearch knowledge bases:
Learning from Web Sources
-
from_web_documentation
: Initiate a web crawl starting from a given URL (url
) to gather information and store it as a new knowledge base. You need to provide aknowledge_base_name
andknowledge_base_description
. -
from_web_documentation_request
: Start a web crawl based on a structured request object (KnowledgeBaseProto
) containing the name, source URL, and description. -
from_web_documentation_requests
: Initiate multiple web crawls simultaneously by providing a list of structured request objects (KnowledgeBaseProto
).
Memory - Storing Thoughts
-
from_thought
: Save a single piece of information (a "thought") with atitle
andbody
directly into the knowledge base system. -
from_thoughts
: Save multiple thoughts at once by providing a list of thought objects, each with atitle
andbody
.
Querying Knowledge
-
questions
: Ask one or morequestions
(as a list of strings) and receive answers based on information across all available knowledge bases. You can specify the desiredanswer_style
(concise, normal, comprehensive, exhaustive). -
questions_for_kb
: Ask one or morequestions
targeted at a specific knowledge base, identified by itsknowledge_base_name
. You can also specify theanswer_style
as concise, normal, or comprehensive.
Resources
-
kb://entry
: Access the details (Title, Source, Description) of a specific knowledge base entry using its unique ID or assigned name.
Knowledge Base Management
-
get
: Retrieve a list of all existing knowledge base entries. -
get_by_id_or_name
: Fetch details of a specific knowledge base using its unique ID or assigned name. -
update
: Modify the name, source URL, or description associated with a knowledge base entry. -
update_name
: Change only the name of a specific knowledge base entry. -
update_description
: Change only the description of a specific knowledge base entry. -
delete
: Remove a specific knowledge base entry entirely.
Contributing
For details on local development, setup, and contributing to this project, please see the Contributing Guide.
相关推荐
😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack
Reviews

user_qK6wQaCW
As a dedicated user of the es-knowledge-base-mcp by strawgate, I am highly impressed with its exceptional functionality. It has tremendously streamlined my workflow, making knowledge management seamless. The intuitive user interface and comprehensive database ensure quick access to information, significantly enhancing productivity. Highly recommended for anyone looking for a reliable MCP application!

user_VScJbChi
As a dedicated user of the es-knowledge-base-mcp developed by strawgate, I must say it has significantly improved my workflow efficiency. The product's intuitive design and comprehensive knowledge base offer seamless access to valuable information in my preferred language. The initial URL and welcoming message set the tone for a user-friendly experience right from the start. Overall, es-knowledge-base-mcp is an indispensable tool for anyone seeking a reliable MCP solution.

user_J8kxWSHy
The es-knowledge-base-mcp by strawgate is a fantastic tool for managing knowledge efficiently. The seamless integration and user-friendly interface have greatly enhanced my productivity. Highly recommend this for anyone looking to streamline their information management.

user_17GBNnlZ
I've been using es-knowledge-base-mcp by strawgate for a while now, and it has significantly improved my work efficiency. The product offers a comprehensive set of tools that streamline my tasks and provide valuable insights. Highly recommend it to anyone looking for a robust knowledge management solution!

user_U21P0O00
As a dedicated user of the es-knowledge-base-mcp by strawgate, I highly recommend it! It's an incredibly useful tool that has significantly improved my workflow. The interface is intuitive, making it easy to navigate and find the information I need quickly. It's clear that a lot of thought has gone into its development, and it shows in how seamlessly it integrates with other applications. If you're looking for a reliable knowledge base solution, this is the one to go for!