GitHub MCP Server — Project Plan & Changelog
Documents 12 MCP tools, a RAG pipeline, and a modular package structure for a GitHub MCP server project.
What this file does
Documents 12 MCP tools, a RAG pipeline, and a modular package structure for a GitHub MCP server project.
When to use it
- Planning a similar MCP server with multiple tools
- Tracking progress on a modular refactor with docstring audits
- Reviewing a changelog for recent fixes and feature additions
- Understanding the file layout and tool registration pattern
Assumes this stack
GitHub MCP Server — Project Plan & Changelog
📋 Current State (March 2026)
✅ Completed Features
- Modular package structure —
github_mcp/with one file per tool - 12 MCP Tools registered via
register_all_tools(mcp):list_files— list repo files / directoriescreate_branch— create a branch from any sourcecreate_file— create / update a file with a commitcreate_pull_request— open a PR (supports draft)create_project_task— create Issue or draft card on Projects v2 boardlist_project_tasks— list board items with offset paginationassign_task— assign users + labels (auto-creates missing labels)update_task_status— move items between Status columnscreate_project_field— add text/number/date field to a board (idempotent)set_task_fields— set multiple custom field values in one callask_codebase— RAG Q&A over the indexed GitHub repo (Groq + PGVector)explore_codebase— file explorer backed by PGVector/ChromaDB index
- RAG pipeline —
ingest.pyindexes the target GitHub repo into PGVector (default) - Shared helpers —
core/github_api.py,utils/project_helpers.py - Documentation —
docs.html(interactive),README.md,plan.md - Package manager —
uvwithpyproject.toml
🗂 File Inventory & Docstring Status
Top-level scripts
| File | Module docstring | All functions documented |
|---|---|---|
server.py | ✅ | ✅ |
ingest.py | ✅ | ✅ (added March 2026) |
rag_query.py | ✅ | ✅ |
github_mcp/ package
| File | Module docstring | Functions documented |
|---|---|---|
__init__.py | ✅ | n/a |
config.py | ✅ | ✅ validate_config() |
constants.py | ✅ | n/a (constants only) |
github_mcp/core/
| File | Module docstring | Functions documented |
|---|---|---|
__init__.py | ✅ | n/a |
github_api.py | ✅ | ✅ _headers, _gql_headers, _raise_for_status, _gql_check |
github_mcp/utils/
| File | Module docstring | Functions documented |
|---|---|---|
__init__.py | ✅ | n/a |
project_helpers.py | ✅ | ✅ _resolve_project, _find_field, _inline_value |
github_mcp/tools/
| File | Tool | Module docstring | Tool docstring |
|---|---|---|---|
__init__.py | register_all_tools | ✅ | ✅ |
files.py | list_files | ✅ | ✅ |
branches.py | create_branch | ✅ | ✅ |
file_operations.py | create_file | ✅ | ✅ |
pull_requests.py | create_pull_request | ✅ | ✅ |
tasks.py | create_project_task | ✅ | ✅ |
task_list.py | list_project_tasks | ✅ | ✅ |
task_assign.py | assign_task | ✅ | ✅ |
task_status.py | update_task_status | ✅ | ✅ |
project_fields.py | create_project_field | ✅ | ✅ |
task_fields.py | set_task_fields | ✅ | ✅ |
rag_query.py | ask_codebase, explore_codebase | ✅ | ✅ (both) |
🎯 Target Architecture
GitHubMCP/
├── server.py # Main entry point (FastMCP setup)
├── ingest.py # RAG ingestion pipeline
├── rag_query.py # Standalone RAG tester
├── pyproject.toml # Dependencies (uv managed)
├── README.md # Full installation + API reference
├── plan.md # This file
├── docs.html # Interactive HTML documentation
├── .env # Environment variables
│
├── pgvector/ # Auto-created PGVector mirror (optional dual-store)
├── chroma_store/ # ChromaDB persistence (fallback / dual-store)
│
└── github_mcp/
├── __init__.py
├── config.py
├── constants.py
├── core/
│ └── github_api.py
├── utils/
│ └── project_helpers.py
└── tools/
├── __init__.py
├── files.py
├── branches.py
├── file_operations.py
├── pull_requests.py
├── tasks.py
├── task_list.py
├── task_assign.py
├── task_status.py
├── project_fields.py
├── task_fields.py
└── rag_query.py
📝 Implementation Phases
Phase 1: Package Structure ✅ COMPLETE
- Created
github_mcp/directory layout - Added all
__init__.pyfiles - Moved constants + config to dedicated files
Phase 2: Core & Utils Extraction ✅ COMPLETE
core/github_api.py—_headers(),_gql_headers(),_raise_for_status(),_gql_check()utils/project_helpers.py—_resolve_project(),_find_field(),_inline_value()
Phase 3: Tool Extraction ✅ COMPLETE
Each tool extracted to its own file (~50–200 lines each).
Phase 4: RAG Pipeline ✅ COMPLETE
ingest.py— indexes GitHub repo + local docs into ChromaDBrag_query.py— standalone LCEL chain testergithub_mcp/tools/rag_query.py—ask_codebase+explore_codebaseMCP tools
Phase 5: Documentation ✅ COMPLETE (March 2026 update)
README.md— full API reference for all 12 tools + module referencedocs.html— interactive HTML doc covering all 12 tools, RAG pipeline, module APIsplan.md— this file updated with docstring status table- All Python files have module-level and function-level docstrings
🔧 Changelog
March 2026 (latest)
- PGVector as default vector store —
RAG_VECTOR_DB=pgvectoris now the default in.env,ingest.py,rag_query.py, andgithub_mcp/tools/rag_query.py - Fixed async crash —
ask_codebaseraisedAssertionError: _async_engine not foundwhen using a sync psycopg connection URL. Fixed by adding_PGVectorSyncRetriever(aBaseRetrieversubclass that wraps syncsimilarity_search()) insidegithub_mcp/tools/rag_query.py; BaseRetriever's default_aget_relevant_documentsruns it safely in a thread executor - RAG prompt grounded to target repo —
_RAG_PROMPTis now an f-string that readsGITHUB_OWNER/GITHUB_REPOfrom the environment so answers refer to the correct repo (Bishwajit-2810/The_New_York_Times) rather than the MCP server project RAG_SKIP_LOCAL_DOCSflag — added toingest.pyand defaulted totruein.env; prevents this project's own docs from polluting the target-repo vector store- Full documentation pass — all module-level, function-level, and tool-level
docstrings updated across
server.py,ingest.py,rag_query.py(root), andgithub_mcp/tools/rag_query.py README.mdoverhauled — new "🚀 How to Run This System" section (Steps 0–6), restructured env-var table, updated RAG pipeline section, updated module referencedocs.htmlupdated — Quick Start, .env block, RAG pipeline §3 (PGVector default, new install deps, corrected expected output), Tool 11ask_codebasedocstring block,server.pyandingest.pymodule reference docstring blocks- Added
ask_codebase(Tool 11) RAG Q&A tool - Added
explore_codebase(Tool 12) file-explorer tool - Added
--docs-onlyflag toingest.py - Rebuilt
docs.html— adds Tools 11 & 12, RAG section, module API tables - Rebuilt
README.md— full tool reference, module reference, docstring status
Earlier
- Modular refactor: monolithic
server_fallback.pysplit intogithub_mcp/package - Added Tools 1–10 (GitHub REST + GraphQL)
- Added offset pagination to
list_project_tasks - Added
_inline_value()auto-detect for date/number/text GraphQL mutations - Added idempotentcy to
create_project_field assign_taskauto-creates missing labels
🚀 Benefits of Modular Structure
| Benefit | Detail |
|---|---|
| Maintainability | Each tool ~50–200 lines; easy to locate and patch |
| Testability | Import and test each tool in isolation |
| Scalability | Add new tools by creating one file + one line in __init__.py |
| Collaboration | Clear per-module ownership; minimal merge conflicts |
| Discoverability | File name = tool name; structure is self-documenting |
What's inside
Completed features list, file inventory table, target architecture tree, implementation phases, changelog, and benefits table.
Change this for your project
- Replace
Bishwajit-2810/The_New_York_Timeswith your target repo in_RAG_PROMPT - Replace
Bishwajit-2810/GitHubMCPwith your own repository name - Replace
RAG_VECTOR_DB=pgvectordefault in.envif using a different vector store
Where it goes
Save in docs/ or the repository root. Gives agents and new contributors a map of the codebase.
Worth borrowing
- One file per tool with a single registration function in
__init__.py - Docstring status table to track documentation completeness across modules
- Sync retriever wrapper (
_PGVectorSyncRetriever) to avoid async engine errors
Related Documents
Design Document: BharatSeva AI
Describes a 10-agent AWS system that helps India's informal workers access government schemes via voice-first, serverless architecture.
OpenClaw Enterprise Transformation Plan
Transforms a single-user AI agent into a dual-mode platform supporting both viral open-source and Fortune 500 enterprise deployments through phased security, IAM, audit, multi-tenancy, and Kubernetes features.
Qwen Image and Edit: Open-sourcing and Local GGUF Generations with Lightning
Documents the Qwen-Image and Qwen-Image-Edit models, covering architecture, training, benchmarks, ComfyUI setup, and prompting techniques for local GGUF deployment.
University of Guelph Rocketry Club - Complete Tech Stack
Documents the full tech stack of a university rocketry club website with AI chatbot, member management, and project showcases.