MCP server exposing a local markdown knowledge base
Project description
MCP Knowledge Base Server
This project implements a Model Context Protocol (MCP) server that manages a local markdown knowledge base. It provides tools for creating, reading, updating, searching, and organizing documents stored beneath a configurable root directory. The server uses FastMCP for transport and schema generation, so the Python tool functions double as the canonical source of truth for MCP metadata.
Running the server
uv run mcp-kb-server --root /path/to/knowledgebase
To expose multiple transports, pass --transport flags (supported values: stdio,
sse, http):
uv run mcp-kb-server --transport stdio --transport http
Use --host and --port to bind HTTP/SSE transports to specific interfaces:
uv run mcp-kb-server --transport http --host 0.0.0.0 --port 9000
On first launch the server copies a bundled KNOWLEDBASE_DOC.md into the
.docs/ directory if it is missing so that every deployment starts with a
baseline usage guide.
Optional ChromaDB Mirroring
The CLI can mirror knowledge base changes into a Chroma collection without
exposing raw Chroma operations as MCP tools. Mirroring is enabled by default via
the persistent client, which stores data under <root>/chroma. Choose a
different backend with --chroma-client (choices: ephemeral, persistent,
http, cloud). Example:
uv run mcp-kb-server \
--root /path/to/knowledgebase \
--chroma-client ephemeral \
--chroma-collection local-kb \
--chroma-embedding default
Persistent and remote clients accept additional flags:
--chroma-data-dir: storage directory for the persistent client (defaults to<root>/chromawhen not supplied).--chroma-host,--chroma-port,--chroma-ssl,--chroma-custom-auth: options for a self-hosted HTTP server.--chroma-tenant,--chroma-database,--chroma-api-key: credentials for Chroma Cloud deployments.--chroma-id-prefix: custom document ID prefix (kb::by default).
Every flag has a matching environment variable (MCP_KB_CHROMA_*), so the
following snippet enables an HTTP client without modifying CLI commands:
export MCP_KB_CHROMA_CLIENT=http
export MCP_KB_CHROMA_HOST=chroma.internal
export MCP_KB_CHROMA_PORT=8001
export MCP_KB_CHROMA_CUSTOM_AUTH="username:password"
uv run mcp-kb-server --transport http
When enabled, any file creation, update, or soft deletion is synchronously propagated to the configured Chroma collection, ensuring semantic search stays in lockstep with the markdown knowledge base.
The kb.search MCP tool automatically queries Chroma when mirroring is active,
falling back to direct filesystem scans if the semantic index returns no hits.
Reindexing
Use the standalone CLI to rebuild external indexes (e.g., Chroma) from the current knowledge base. This command is not exposed as an MCP tool.
uv run mcp-kb-reindex --root /path/to/knowledgebase \
--chroma-client persistent \
--chroma-data-dir /path/to/chroma \
--chroma-collection knowledge-base \
--chroma-embedding default
- Honors the same
--chroma-*flags andMCP_KB_CHROMA_*environment variables as the server. - Processes all non-deleted
*.mdfiles under the root and prints a summary:Reindexed N documents.
Testing
uv run pytest
LLM Client Configuration
Below are sample configurations for popular MCP-capable LLM clients. All
examples assume this repository is cloned locally and that uv is installed.
Claude Desktop
Add the following block to your Claude Desktop claude_desktop_config.json:
{
"mcpServers": {
"local-kb": {
"server-name": "kb-server",
"command": "uv",
"args": [
"run",
"mcp-kb-server",
"--root",
"/absolute/path/to/.knowledgebase"
]
}
}
}
Cursor AI
In Cursor's cursor-settings.json, register the server as a custom tool:
{
"mcpServers": {
"local_knowledge_base": {
"id": "local-kb",
"title": "Local Knowledge Base",
"command": "uvx",
"args": [
" --from",
"~/cursor_projects/local_knowledge_base",
"mcp-kb-server"
]
}
}
}
VS Code (Claude MCP Extension)
For the Claude MCP extension, add an entry to settings.json:
{
"claudeMcp.servers": {
"local-kb": {
"command": "uv",
"args": ["run", "mcp-kb-server"],
"env": {
"MCP_KB_ROOT": "/absolute/path/to/.knowledgebase"
}
}
}
}
Adjust the --root flag or MCP_KB_ROOT environment variable to point at the
desired knowledge base directory for each client.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_kb-0.1.0.tar.gz.
File metadata
- Download URL: mcp_kb-0.1.0.tar.gz
- Upload date:
- Size: 25.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e485ff89d51ce9f4e7bb3ab694fcce19a29ed9a209d0d1f84273cab8fabb969b
|
|
| MD5 |
583c66cca7adc181d3cc1f08d9a07563
|
|
| BLAKE2b-256 |
30134d72432d28df733769d8ff743d180430c7af8cf2afc154f993f82e3bc84c
|
Provenance
The following attestation bundles were made for mcp_kb-0.1.0.tar.gz:
Publisher:
version_publish_main.yml on JulianKimmig/local_knowledge_base
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_kb-0.1.0.tar.gz -
Subject digest:
e485ff89d51ce9f4e7bb3ab694fcce19a29ed9a209d0d1f84273cab8fabb969b - Sigstore transparency entry: 578991073
- Sigstore integration time:
-
Permalink:
JulianKimmig/local_knowledge_base@ce14905f77b9216c5765e7545e3fd50d8310d0b2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/JulianKimmig
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
version_publish_main.yml@ce14905f77b9216c5765e7545e3fd50d8310d0b2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_kb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_kb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 32.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8871158e21b3ac3e6952600bba25f28a84718f97ee2b6410524784199387998f
|
|
| MD5 |
4eb5a6d322b74063823f8f173f3888da
|
|
| BLAKE2b-256 |
abeda019de9d04ae1ce0cbb59144fb502aaaf3667d28c0a28da377ffad821b75
|
Provenance
The following attestation bundles were made for mcp_kb-0.1.0-py3-none-any.whl:
Publisher:
version_publish_main.yml on JulianKimmig/local_knowledge_base
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_kb-0.1.0-py3-none-any.whl -
Subject digest:
8871158e21b3ac3e6952600bba25f28a84718f97ee2b6410524784199387998f - Sigstore transparency entry: 578991085
- Sigstore integration time:
-
Permalink:
JulianKimmig/local_knowledge_base@ce14905f77b9216c5765e7545e3fd50d8310d0b2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/JulianKimmig
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
version_publish_main.yml@ce14905f77b9216c5765e7545e3fd50d8310d0b2 -
Trigger Event:
push
-
Statement type: