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_examplein 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.
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.
See how you can autonomously search documentation stored in a knowledge base to gather details needed for a task:
storage.analyzer.mov
Watch how you can identify project dependencies and automatically crawl relevant web documentation to build a knowledge base:
Crawl.documentation.for.this.project.mov
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.
- 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": true
}
],
"servers": {
"es_knowledge_base_mcp": {
"command": "uvx",
"args": [
"git+https://github.com/strawgate/es-knowledge-base-mcp"
],
"env": {
"ES_HOST": "${input:es-host}",
"ES_API_KEY": "${input:es-api-key}",
},
}
}
}
}Add the following configuration block to your mcpServers object:
"es_knowledge_base_mcp_debug": {
"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": [
"knowledge_base_create",
"knowledge_base_get",
"knowledge_base_get_by_backend_id",
"knowledge_base_get_by_name",
"knowledge_base_delete_by_backend_id",
"knowledge_base_delete_by_name",
"knowledge_base_update_by_backend_id",
"knowledge_base_update_by_name",
"memory_encodings",
"memory_encoding",
"memory_recall",
"memory_recall_last",
"ask_questions",
"ask_questions_for_kb",
"learn_extract_urls_from_webpage",
"learn_from_web_documentation",
"learn_active_documentation_requests",
"fetch_webpage",
"call_tool_bulk",
"call_tools_bulk"
],
"disabled": false
}The es_knowledge_base_mcp_debug server provides the following tools:
knowledge_base_create: Create a new knowledge base.knowledge_base_get: Get a list of all knowledge bases.knowledge_base_get_by_backend_id: Get a knowledge base by its backend ID.knowledge_base_get_by_name: Get a knowledge base by its name.knowledge_base_delete_by_backend_id: Delete a knowledge base by its backend ID.knowledge_base_delete_by_name: Delete a knowledge base by its name.knowledge_base_update_by_backend_id: Update the metadata of an existing knowledge base by its backend ID.knowledge_base_update_by_name: Update the description of an existing knowledge base by its name.
memory_encodings: Encode multiple memories into the memory knowledge base.memory_encoding: Encode a single memory into the memory knowledge base.memory_recall: Search the memory knowledge base using questions.memory_recall_last: Retrieve the most recent memories from the memory knowledge base.
ask_questions: Ask questions of the knowledge base.ask_questions_for_kb: Ask questions of a specific knowledge base.
learn_extract_urls_from_webpage: Extracts all unique URLs from a given webpage.learn_from_web_documentation: Starts a crawl job based on a seed page and creates a knowledge base entry for it.learn_active_documentation_requests: Returns a list of active documentation requests.
fetch_webpage: Fetches a webpage and converts it to Markdown format.
call_tool_bulk: Call a single tool multiple times in a single request.call_tools_bulk: Call multiple tools in a single request.
kb://entry: Access the details (Title, Source, Description) of a specific knowledge base entry using its unique ID or assigned name.
For details on local development, setup, and contributing to this project, please see the Contributing Guide.