MCP Knowledge Base Server
MCP Knowledge Base Server
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 저장소와 함께 사용하면 훌륭합니다두 가지 전송 방식 — 로컬 클라이언트용 stdio, 공유/원격 설정용 HTTP
가벼운 의존성 — FastMCP + 소규모 내장 TF-IDF 스타일 인덱스. 데이터베이스나 임베딩 서비스가 필요 없습니다
Related MCP server: search-docs
아키텍처
┌─────────────────┐ 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, title, tags, snippet, score 반환 |
| 한 문서의 전체 Markdown 콘텐츠 + 메타데이터 |
| 모든 문서 나열, 선택적으로 필터링 가능 |
| 문서 수가 포함된 모든 태그 |
|
|
| 문서 수, 태그 수, 인덱스 연령 |
리소스
URI | 설명 |
| 모든 문서의 사람이 읽을 수 있는 인덱스 |
| 한 문서의 전체 콘텐츠 |
프롬프트
프롬프트 | 설명 |
| KB를 검색한 후 모델에게 발췌문에서만 답변하고 doc_ids를 인용하도록 지시합니다 |
환경 변수
변수 | 기본값 | 설명 |
|
| 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를 임베딩 + 벡터 DB로 교체하세요(도구 인터페이스는 동일하게 유지됩니다).다른 소스: Confluence/Notion 내보내기를 인덱싱하세요 — Markdown으로 끝나는 모든 것이 변경 없이 작동합니다.
최신성:
reload_knowledge_base를 일정에 따라 실행하거나 파일 시스템 감시자로KB_DIR을 감시하세요.
라이선스
MIT — 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