github-knowledge-base-mcp
MCP server to connect to and use any public GitHub repo as knowledge base (markdown/notebook docs)
Documentation
GitHub Knowledge Base MCP
A simple MCP server built with FastMCP that lets you connect to any public GitHub repo as knowledge base.
It has a few simple tools to find and read markdown and Jupyter notebook documents.
Blog post: https://stefanbschneider.github.io/blog/posts/fastmcp/
Avialble toolset:
- `knowledge_base_info`
- `list_documents`
- `read_document`
- `list_documents_with_metadata`
- `list_latest_documents`
- `search_documents`
`knowledge_base_info` includes:
- `document_file_count`: total supported files
- `document_type_counts`: counts per extension (for example `.md`, `.markdown`, `.ipynb`)
`list_documents_with_metadata` is useful to retrieve latest blog posts by setting `sort_by="last_modified_utc"` and `descending=true`.
Example: retrieve latest blog posts
Request:
{
"tool": "list_latest_documents",
"arguments": {
"limit": 5,
"extension_filter": ".md"
}
}Response shape:
[
{
"path": "blog/2026-04-10-launch-post.md",
"size_bytes": 3210,
"last_modified_utc": "2026-04-10T14:11:52Z"
}
]Supported file types:
- `.md`
- `.markdown`
- `.ipynb`
Setup
Installation
uv sync frozenConfiguration
Set `KB_GITHUB_REPO` to use a public GitHub repository as the knowledge base.
- supported formats:
- optional ref/branch/tag: `KB_GITHUB_BRANCH`
- if no ref is set, the repository default branch is used
Example:
export KB_GITHUB_REPO="microsoft/vscode"
export KB_GITHUB_BRANCH="main" # optional
python gh_kb_mcp_server.pyNotebook handling details:
- only markdown cells are indexed/read for `.ipynb`
- notebook outputs are ignored
- invalid notebooks return clear validation errors for direct reads
All tools run only against the configured GitHub repository.
Running the server
fastmcp run server.pyConfiguring the MCP in VSCode
Via command palette, call "MCP: Add server..." or add/create `mcp.json` adding the following block to your `"servers"`:
"GitHub Knowledge Base": {
"type": "stdio",
"command": "${workspaceFolder}/.venv/bin/fastmcp",
"args": [
"run",
"server.py",
],
"env": {
"KB_GITHUB_REPO": // eg: "stefanbschneider/blog" or "microsoft/vscode"
}
}Frequently asked questions
What is github-knowledge-base-mcp?
github-knowledge-base-mcp is MCP server to connect to and use any public GitHub repo as knowledge base (markdown/notebook docs)
How do I install github-knowledge-base-mcp?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is github-knowledge-base-mcp open source?
Yes — it is hosted on GitHub at https://github.com/stefanbschneider/github-knowledge-base-mcp.
Related MCP tools
AI-powered OSINT agent with interactive REPL, MCP server, and CLI. 19 tools. Works with Claude, GPT-4, or local models. For authorized security research only.
Production-grade MCP server giving Claude 27 security intelligence tools across 21 APIs — CVE lookup, EPSS scoring, CISA KEV, MITRE ATT&CK, Shodan, VirusTotal, and more.
Open-source coding agent memory. Records issues, attempts, fixes and decisions, then warns your agent before it repeats an approach that already failed. Native MCP server for Claude Code, Cursor, Antigravity and Codex. 100% local, no cloud, no telemetry. MIT.
An LLM agent that conducts deep research (local and web) on any given topic and generates a long report with citations. Built for the Model Context Protocol to
🚀 The fast, Pythonic way to build MCP servers and clients Trusted by 19900+ developers. Trusted by 19900+ developers. Trusted by 19900+ developers.
Fast and Accurate Code Search for Agents. Uses 99% fewer tokens than grep+read
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP