MCP Knowledge Base Server
MCP Knowledge Base Server
Ein MCP (Model Context Protocol)-Server, der KI-Assistenten — Claude Desktop, Cursor oder jeden MCP-Client — durchsuchbaren, strukturierten Zugriff auf die interne Wissensdatenbank eines Unternehmens mit Markdown-Dokumenten bietet.
Fragen Sie Ihren Assistenten „Wie stelle ich in Produktion bereit?" oder „Wie viele Urlaubstage habe ich?" und er durchsucht die Wissensdatenbank, liest die relevanten Artikel und antwortet mit Quellenangaben — statt Ihre internen Prozesse zu erfinden.
Funktionen
6 Tools — Stichwortsuche mit Textausschnitten, vollständiger Dokumentabruf, gefilterte Auflistung, Tag-Durchsuchung, Hot Reload und Statistiken
2 Ressourcentypen — durchsuchen Sie den gesamten Index oder direkt ein Dokument (
kb://index,kb://documents/{doc_id})1 Prompt-Vorlage —
answer_from_knowledge_baseverankert Antworten in Suchergebnissen und erzwingt QuellenangabenNull-Infrastruktur — die Wissensdatenbank ist einfach ein Ordner mit
.md- Dateien mit optionalem Frontmatter; funktioniert hervorragend mit einem Git-RepoZwei Transports — stdio für lokale Clients, HTTP für gemeinsame/Remote-Setups
Wenig Abhängigkeiten — FastMCP + ein kleiner integrierter TF-IDF-ähnlicher Index; keine Datenbank, kein Embeddings-Dienst erforderlich
Related MCP server: search-docs
Architektur
┌─────────────────┐ stdio / HTTP (JSON-RPC) ┌──────────────────────────┐
│ MCP client │ ───────────────────────────▶ │ FastMCP server │
│ (Claude, …) │ ◀─────────────────────────── │ ├─ tools (search, get…) │
└─────────────────┘ │ ├─ resources (kb://…) │
│ └─ prompts (answer…) │
│ │ │
│ KnowledgeBaseIndex │
│ (tokenize → TF-IDF) │
└──────────┬─────────────┘
│ scans
┌──────────▼─────────────┐
│ knowledge_base/ │
│ engineering/*.md │
│ hr/*.md product/*.md │
└────────────────────────┘Schnellstart
git clone <your-repo-url> mcp-knowledge-base-server
cd mcp-knowledge-base-server
pip install .Weisen Sie den Server auf Ihre eigenen Dokumente hin (oder verwenden Sie das beiliegende Beispiel-Korpus):
export KB_DIR=/path/to/your/markdown/docsDemo ausführen
pip install fastmcp # only dependency the demo needs
python examples/demo_client.pyDie Demo startet den Server über stdio und übt jede Fähigkeit aus — Suche, Dokumentabruf, Auflistung, Ressourcen und den Prompt mit verankerten Antworten — und gibt dabei die exakten JSON-RPC-Payloads aus, die ein echter Client sehen würde.
Claude Desktop verbinden
Fügen Sie zu claude_desktop_config.json hinzu:
{
"mcpServers": {
"knowledge-base": {
"command": "python",
"args": ["-m", "mcp_knowledge_base.server"],
"env": {
"PYTHONPATH": "/absolute/path/to/mcp-knowledge-base-server/src",
"KB_DIR": "/absolute/path/to/mcp-knowledge-base-server/knowledge_base"
}
}
}
}Starten Sie Claude Desktop neu und fragen Sie dann: „Durchsuchen Sie unsere Wissensdatenbank — wie lautet die Rollback-Prozedur, wenn eine Bereitstellung schiefgeht?"
Über HTTP ausführen (gemeinsame/Remote-Setups)
KB_DIR=/path/to/docs mcp-knowledge-base --transport http --port 8000
# → streamable HTTP endpoint at http://127.0.0.1:8000/mcpDokumentformat
Jeder Ordner mit .md-Dateien funktioniert. Optionales Frontmatter reichert
die Ergebnisse an:
---
title: Deploying to Production
tags: [deploy, production, runbook]
department: engineering
updated: 2025-11-02
---
# Deploying to Production
…Die Dokument-doc_id ist ihr Pfad relativ zu KB_DIR ohne die Erweiterung
(z. B. engineering/deploy-guide). Der Titel fällt auf die erste #-Überschrift
zurück, dann auf den Dateinamen.
API-Referenz
Tools
Tool | Beschreibung |
| Rangierte Stichwortsuche; gibt doc_id, Titel, Tags, Ausschnitt, Score zurück |
| Vollständiger Markdown-Inhalt + Metadaten eines Artikels |
| Alle Artikel auflisten, optional gefiltert |
| Alle Tags mit Dokumentanzahl |
|
|
| Dokumentanzahl, Tag-Anzahl, Index-Alter |
Ressourcen
URI | Beschreibung |
| Menschenlesbarer Index jedes Dokuments |
| Vollständiger Inhalt eines Dokuments |
Prompts
Prompt | Beschreibung |
| Durchsucht die Wissensdatenbank und weist das Modell dann an, nur aus den Auszügen zu antworten und doc_ids zu zitieren |
Umgebungsvariablen
Variable | Standard | Beschreibung |
|
| Stammordner der Markdown-Dokumente |
|
| Servername, der MCP-Clients angezeigt wird |
Projektstruktur
├── knowledge_base/ # sample corpus (replace with your own)
│ ├── engineering/*.md
│ ├── hr/*.md
│ └── product/*.md
├── src/mcp_knowledge_base/
│ ├── server.py # FastMCP server: tools, resources, prompts
│ └── index.py # document loading + TF-IDF-style search
├── examples/
│ └── demo_client.py # end-to-end demo over stdio
└── pyproject.tomlErweiterungsmöglichkeiten
Bessere Suche:
KnowledgeBaseIndexgegen Embeddings + eine Vektor-DB austauschen (die Tool-Schnittstelle bleibt identisch).Andere Quellen: Confluence/Notion-Exporte indizieren — alles, was als Markdown endet, funktioniert unverändert.
Aktualität:
reload_knowledge_basenach Zeitplan ausführen oderKB_DIRmit einem Dateisystem-Watcher überwachen.
Lizenz
MIT — siehe LICENSE.
Available Tools
6 toolsget_documentA
Fetch the full Markdown content of one knowledge-base article.
Inputs: doc_id (required). Returns: object
list_documentsA
List every article in the knowledge base, optionally filtered.
Inputs: tag, department. Returns: result
list_tagsA
List all tags used across the knowledge base, with document counts.
Inputs: no named parameters. Returns: object
reload_knowledge_baseA
Re-scan the knowledge-base directory to pick up new or edited articles.
Returns: Number of documents now indexed.
Inputs: no named parameters. Returns: object
search_knowledge_baseA
Search the company knowledge base with natural language or keywords.
Use this FIRST whenever a question might be answered by internal documentation (processes, runbooks, policies, architecture, onboarding…).
Inputs: query (required), tag, limit. Returns: result
statsB
Basic knowledge-base statistics (document count, tags, index age).
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: searching, fetching full documents, listing documents, listing tags, reloading the index, and showing stats. There is no overlap that would cause an agent to select the wrong tool.
All tool names follow a consistent verb_noun pattern (search_, get_, list_, reload_, etc.). The pattern is predictable and easy to infer for additional tools.
Six tools is well within the ideal range for a knowledge base server. Each tool serves a distinct function, and the count feels neither too sparse nor bloated.
The tool set covers all core operations: search, read, list, and maintenance. Minor gaps exist (e.g., no tool to add or delete documents via the API, but that may be intentionally managed filesystem-side). Reload and stats provide necessary lifecycle support.
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Convert PDFs, Office docs, websites and audio into AI-ready Markdown, then search and ask your docs.
Shared markdown docs for people and AI agents, kept as plain files in your team's GitHub repo.
- Very Simple NotesDeprecatedcom.verysimplenotes
Markdown notes in folders, with files, that your AI assistant can read, write and organise.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI models to seamlessly access and query local markdown technical documentation files, providing automatic documentation context without explicit prompting.5ISC
- AlicenseAqualityBmaintenanceEnables AI agents to search local Markdown documents using natural language, with automatic indexing and section-level retrieval.101MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with direct access to local Markdown documentation libraries, enabling them to list, read, and search through docs on demand.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to search, read, and navigate a folder of Markdown notes as a knowledge base, with full-text search, backlinks, tags, metadata, and note resources for conversation attachment.1MIT