LLM-Wiki-MCP
Local knowledge base built from PDF lecture slides on Agentic Coding, exposed as an MCP server with search, page retrieval, and query tools.
README
LLM-Wiki_MCP
A local knowledge base built from PDF lecture slides on Agentic Coding, exposed through a browser viewer and an MCP server. No cloud services are required to run the wiki or the viewer.
What this project does
- Compiles a folder of PDFs into an interlinked Markdown wiki using
compile_wiki.pyandpypdf. - Serves the wiki as a browser-readable site via
viewer/server.py. - Exposes the wiki as an MCP server (
os_wiki_mcp_server.py) so that Claude Desktop and Claude Code can access the wiki through the MCP server.
The wiki covers nine lectures on Agentic Coding Basics: vibe coding, agentic coding, SDLC pipelines, agent specifications, subprocess calling, planning mode, orchestration, MCP, loops and hooks.
Repository structure
os-wiki-mcp/
├── os_wiki_mcp_server.py MCP server — 4 registered tools
├── compile_wiki.py PDF → Markdown compilation pipeline
├── wiki_tool.py CLI: lint, search, query
├── requirements.txt Python dependencies
├── .gitignore
│
├── viewer/
│ └── server.py Local HTTP wiki browser (port 8000)
│
├── skills/
│ ├── ingest_source.md Step-by-step ingest procedure
│ ├── lint_and_repair.md Step-by-step lint and repair procedure
│ └── query_and_writeback.md Step-by-step query and write-back procedure
│
├── wiki/
│ ├── sources/ 9 compiled source summaries
│ ├── concepts/ 8 concept pages
│ ├── entities/ 4 entity profiles
│ ├── analyses/ 2 synthesis reports
│ ├── templates/ Page scaffolds (source, concept, entity, analysis)
│ ├── index.md Master table of contents
│ └── log.md Append-only change log
│
├── raw/ 9 original PDF files (immutable)
├── docs/ Design documents
├── demo/
│ └── screenshot.png
│
├── AGENTS.md Agent persona and SOPs
├── SCHEME.md YAML frontmatter schema
├── TASK.md Task contract (Task 1 complete)
├── CLAUDE.md Environment-level rules
└── journal.md Append-only operation log
Installation
Python 3.10 or higher is required.
pip install -r requirements.txt
requirements.txt installs:
mcp>=1.0.0— MCP Python SDK (providesmcp.server.fastmcp.FastMCP)pypdf>=4.0.0— PDF text extraction used bycompile_wiki.py
The viewer also uses the markdown package for richer rendering:
pip install markdown
No Anthropic API key is needed. The current implementation uses local rule-based synthesis only.
Generating the wiki
python compile_wiki.py
This reads every PDF in raw/, extracts text with pypdf, derives concepts
and entities using keyword matching, writes Markdown pages into wiki/, and
updates wiki/index.md and wiki/log.md. Existing pages in wiki/sources/,
wiki/concepts/, and wiki/entities/ are cleared and rewritten on each run.
To verify the result:
python wiki_tool.py lint # checks for dead links and orphan pages
python wiki_tool.py search "mcp"
Running the viewer
python viewer/server.py
Open http://localhost:8000 in a browser.
Options:
--port PORT Port to listen on (default: 8000)
--host HOST Host to bind (default: 127.0.0.1)
The viewer provides:
- Sidebar listing all pages grouped by type (Sources, Concepts, Entities, Analyses)
- Client-side sidebar filter by slug text
- Page type filter buttons (All / Source / Concept / Entity / Analysis)
- Markdown rendering with fenced code blocks and tables
[[wikilink]]converted to clickable navigation links- Frontmatter shown as a metadata card at the top of each page
- Dark / light mode toggle, persisted in
localStorage - No JavaScript framework, no external CDN, no API calls
Running the MCP server
python os_wiki_mcp_server.py
The server runs as a stdio MCP process and prints its status to stderr:
[OS Wiki MCP] Server starting...
[OS Wiki MCP] Wiki root : /path/to/wiki
[OS Wiki MCP] Tools : search_wiki, get_page, list_pages, query_wiki
[OS Wiki MCP] Transport : stdio
[OS Wiki MCP] Ready.
Claude Desktop configuration
Add the following to your Claude Desktop config
(~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"os-wiki": {
"command": "python",
"args": ["/absolute/path/to/os_wiki_mcp_server.py"]
}
}
}
Restart Claude Desktop. The os-wiki server appears in the tools list.
Available MCP tools
search_wiki
Searches all wiki pages (title, tags, body text) for a keyword. Returns up to 5 matching line snippets per page.
search_wiki(query="agentic")
search_wiki(query="mcp", page_type="concept")
page_type is optional and accepts: source, concept, entity,
analysis, meta.
Response fields: query, total, results (list of slug, title,
type, rel_path, snippets).
get_page
Fetches a single wiki page by its slug and returns its full content.
get_page(slug="mcp")
get_page(slug="andrej-karpathy")
Response fields: found, slug, title, type, rel_path,
frontmatter, body, outgoing_links.
If the slug does not exist, found is false and an error message
is returned.
list_pages
Lists all non-template wiki pages, optionally filtered by type.
list_pages()
list_pages(page_type="source")
Response fields: total, page_type, pages (list of slug, title,
type, rel_path). Pages are sorted by type then slug.
query_wiki
Answers a natural language question using local rule-based synthesis. Matches the question against known topic areas (vibe coding, agentic coding, MCP, harness, hooks) and returns a pre-composed cross-linked Markdown report.
query_wiki(question="What is the difference between vibe and agentic coding?")
query_wiki(question="How does MCP work?")
Response fields: question, title, slug, answer (full Markdown),
note (phase notice).
This tool does not call any external API. LLM-powered synthesis is not yet implemented.
Harness
Five files govern how agents and the compiler behave:
| File | Purpose |
|---|---|
AGENTS.md |
Defines the LLM Wiki Librarian persona, three SOPs (Ingest, Query & Write-Back, Lint), and forbidden actions |
SCHEME.md |
Canonical directory layout, slug conventions, and required YAML frontmatter fields for each page type |
TASK.md |
Project task contract and completion checklist (status: complete) |
CLAUDE.md |
Environment-level rules: CLI commands, Markdown-only constraint, harness compliance requirement |
journal.md |
Append-only log of operations; one line added after each successful task cycle |
The skills/ directory provides step-by-step checklists for the three
SOPs defined in AGENTS.md: ingesting a new source, running lint and
repairing errors, and querying with optional write-back.
Demo
This screenshot demonstrates the wiki viewer rendering the generated knowledge base.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。