- Home
- MCP servers
- Knowledge Base
Knowledge Base
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"leon4s4-knowledge-base-mcp": {
"command": "python",
"args": [
"/absolute/path/to/knowledge-base-mcp/kb_server.py"
],
"env": {
"KB_UI_PORT": "8501",
"KB_DATA_DIR": "/absolute/path/to/knowledge-base-mcp/kb_data",
"KB_INITIAL_FILE": "/absolute/path/to/knowledge-base-mcp/initial_knowledge.txt"
}
}
}
}You provision a local, persistent memory store for GitHub Copilot that saves and retrieves contextual knowledge about your development environment. It uses a local ChromaDB instance to enable fast semantic search, keeps data on your machine for compliance, and integrates smoothly with Copilot workflows to enrich responses with stored memories like code snippets, configurations, and troubleshooting steps.
How to use
You run a local MCP server that Copilot connects to for saving and querying memories. The server exposes a simple local command-line entry point and can optionally be managed through a web interface for browsing memories. Use the provided MCP config to start the server and point your Copilot client at it. You can save memories such as environment details, code examples, and architectural notes, then search them for quick access during coding sessions.
To enable Copilot to save or search memories, configure your Copilot client with the MCP server details shown in the configuration below. The server runs locally and stores data on your machine, ensuring privacy and compliance for corporate environments.
How to install
Prerequisites you need before installation: Python 3.9 or newer, and pip for installing dependencies.
Step 1: Clone the knowledge base MCP repository and navigate into it.
Step 2: Install Python dependencies.
pip install -r requirements.txt
Step 3: Start the MCP server locally.
python kb_server.py
Optional: Start the web UI to manage memories.
streamlit run kb_ui.py
Configuration and environment
The server stores data locally in a directory you specify. You can also bootstrap with an initial knowledge file and customize the UI port.
Environment variables you may set for initialization and UI access include:
-
KB_DATA_DIR: Directory for ChromaDB storage (default: ./kb_data)
-
KB_INITIAL_FILE: Optional path to an initial knowledge file to load on startup
-
KB_UI_PORT: Port for the Streamlit UI (default: 8501)
Usage examples
Saving memories and performing searches can be done through the Copilot workflow or explicit shell interactions. For saving, you provide the memory content and optional type and tags. For searching, you query with a natural language prompt and filter by memory type if needed.
Example usage is demonstrated in the official examples bundled with the server, including storing environment details, code snippets, and operational knowledge, which will then be surfaced by Copilot during development.
Security and privacy
All data is stored locally with no external cloud dependencies. Embeddings are generated locally, and standard file-system permissions apply to protect access to memory data.
Troubleshooting
Server won’t start: ensure you’re running Python 3.9 or newer, install dependencies with the provided requirements file, and verify write access to the data directory.
Poor search results: save memories with clear content, include relevant technologies and URLs, and use precise search terms.
Memory not found: list memories with the provided tooling, check filters, and confirm that the memory was saved successfully.
Development notes
The server supports additional tooling for extending capabilities and integrating with Copilot workflows. It stores vector embeddings, document content, and metadata locally for fast, private retrieval.
Available tools
kb_save
Save a memory to the knowledge base with optional type and tags
kb_search
Search for relevant memories with optional memory_type and limit filters
kb_list
List all saved memories with optional type and content visibility controls
kb_delete
Delete a memory by its ID