Skip to main content
Glama
Sachin-wish

MCP Knowledge Base Server

by Sachin-wish

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: 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_idKB_DIR 기준 상대 경로에서 확장자를 제외한 값입니다(예: engineering/deploy-guide). 제목은 첫 번째 # 제목으로 대체되고, 그다음 파일 이름이 사용됩니다.

API 참조

도구

도구

설명

search_knowledge_base(query, limit=5, tag=None)

순위가 매겨진 키워드 검색; doc_id, title, tags, snippet, score 반환

get_document(doc_id)

한 문서의 전체 Markdown 콘텐츠 + 메타데이터

list_documents(tag=None, department=None)

모든 문서 나열, 선택적으로 필터링 가능

list_tags()

문서 수가 포함된 모든 태그

reload_knowledge_base()

KB_DIR을 다시 스캔하여 변경 사항 반영

stats()

문서 수, 태그 수, 인덱스 연령

리소스

URI

설명

kb://index

모든 문서의 사람이 읽을 수 있는 인덱스

kb://documents/{doc_id}

한 문서의 전체 콘텐츠

프롬프트

프롬프트

설명

answer_from_knowledge_base(question)

KB를 검색한 후 모델에게 발췌문에서만 답변하고 doc_ids를 인용하도록 지시합니다

환경 변수

변수

기본값

설명

KB_DIR

./knowledge_base

Markdown 문서의 루트 폴더

KB_NAME

Company Knowledge Base

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 참조.

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

View all related MCP servers

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…

View all MCP Connectors

Latest Blog Posts

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