MCP Knowledge Base Server
MCP ナレッジベースサーバー
AIアシスタント(Claude Desktop、Cursor、または任意のMCPクライアント)に、社内の ナレッジベース のMarkdownドキュメントへの検索可能で構造化されたアクセスを提供する MCP(Model Context Protocol) サーバーです。
アシスタントに 「本番环境にデプロイするにはどうすればいい?」 や 「有給休暇は何日ある?」 と尋ねると、ナレッジベースを検索し、関連記事を読み、引用付きで回答します。社内プロセスを幻覚(ハルシネーション)することはありません。
特徴
6つのツール — スニペット付きキーワード検索、ドキュメント全体の取得、フィルタ付き一覧表示、タグブラウジング、ホットリロード、統計
2種類のリソース — インデックス全体または任意のドキュメントを直接参照(
kb://index、kb://documents/{doc_id})1つのプロンプトテンプレート —
answer_from_knowledge_baseは検索結果に基づいて回答を根拠付け、引用を強制しますインフラ不要 — ナレッジベースはオプションのfrontmatter付きの
.mdファイルのフォルダだけで、Gitリポジトリとの併用に最適です2つのトランスポート — ローカルクライアント用のstdio、共有/リモート環境用のHTTP
依存関係が軽量 — FastMCP + 組み込みの小型TF-IDF型インデックス。データベースやembeddingsサービスは不要です
Related MCP server: MCP Docs Server
アーキテクチャ
┌─────────────────┐ 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 │
└────────────────────────┘クイックスタート
git clone <your-repo-url> mcp-knowledge-base-server
cd mcp-knowledge-base-server
pip install .サーバーを自分のドキュメントに向ける(または同梱のサンプルコーパスを使用する):
export KB_DIR=/path/to/your/markdown/docsデモを実行する
pip install fastmcp # only dependency the demo needs
python examples/demo_client.pyデモはstdio経由でサーバーを起動し、すべての機能(検索、ドキュメント取得、一覧表示、リソース、根拠付き回答プロンプト)を実行し、実際のクライアントが目にする正確なJSON-RPCペイロードを表示します。
Claude Desktopに接続する
claude_desktop_config.json に追加:
{
"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"
}
}
}
}Claude Desktopを再起動して、次のように尋ねます: 「ナレッジベースを検索して — デプロイが失敗した場合のロールバック手順は?」
HTTPで実行する(共有/リモート環境)
KB_DIR=/path/to/docs mcp-knowledge-base --transport http --port 8000
# → streamable HTTP endpoint at http://127.0.0.1:8000/mcpドキュメント形式
任意の .md ファイルのフォルダで動作します。オプションのfrontmatterで結果を拡充できます:
---
title: Deploying to Production
tags: [deploy, production, runbook]
department: engineering
updated: 2025-11-02
---
# Deploying to Production
…ドキュメントの doc_id は、KB_DIR からの相対パスから拡張子を除いたものです(例: engineering/deploy-guide)。タイトルは最初の # 見出し、次にファイル名にフォールバックします。
APIリファレンス
ツール
ツール | 説明 |
| ランク付きキーワード検索。doc_id、タイトル、タグ、スニペット、スコアを返します |
| 1記事の完全なMarkdownコンテンツ + メタデータ |
| すべての記事を一覧表示。オプションでフィルタ可能 |
| ドキュメント数付きの全タグ |
|
|
| ドキュメント数、タグ数、インデックス経過時間 |
リソース
URI | 説明 |
| 全ドキュメントの人間可読なインデックス |
| 1つのドキュメントの完全なコンテンツ |
プロンプト
プロンプト | 説明 |
| KBを検索し、モデルに抜粋のみから回答しdoc_idを引用するよう指示します |
環境変数
変数 | デフォルト | 説明 |
|
| Markdownドキュメントのルートフォルダ |
|
| MCPクライアントに表示されるサーバー名 |
プロジェクト構造
├── 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.toml拡張方法
検索の改善:
KnowledgeBaseIndexをembeddings + ベクターデータベースに置き換える(ツールのインターフェースはそのままです)。他のソース: Confluence/Notionのエクスポートをインデックス化 — Markdownになるものであればそのまま動作します。
鮮度:
reload_knowledge_baseをスケジュール実行するか、ファイルシステムウォッチャーでKB_DIRを監視します。
ライセンス
MIT — LICENSE を参照してください。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI models to seamlessly access and query local markdown technical documentation files, providing automatic documentation context without explicit prompting.175ISC
- AlicenseNot gradedqualityDmaintenanceProvides direct access to local documentation files through simple search and overview tools, enabling LLMs to query project-specific markdown documentation without requiring vector databases or RAG pipelines.MIT
- AlicenseAqualityAmaintenanceEnables AI agents to search local Markdown documents using natural language, with automatic indexing and section-level retrieval.921MIT
- AlicenseNot gradedqualityDmaintenanceGives AI agents full-text search over any Markdown/MDX documentation folder.14MIT
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sachin-wish/mcp-knowledge-base-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server