Back to .md Directory

GitHub MCP Server — Project Plan & Changelog

Documents 12 MCP tools, a RAG pipeline, and a modular package structure for a GitHub MCP server project.

May 2, 2026
0 downloads
0 views
ai rag mcp
View source

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

PythonFastMCPPGVectorChromaDBGroquv

GitHub MCP Server — Project Plan & Changelog

📋 Current State (March 2026)

✅ Completed Features

  • Modular package structuregithub_mcp/ with one file per tool
  • 12 MCP Tools registered via register_all_tools(mcp):
    1. list_files — list repo files / directories
    2. create_branch — create a branch from any source
    3. create_file — create / update a file with a commit
    4. create_pull_request — open a PR (supports draft)
    5. create_project_task — create Issue or draft card on Projects v2 board
    6. list_project_tasks — list board items with offset pagination
    7. assign_task — assign users + labels (auto-creates missing labels)
    8. update_task_status — move items between Status columns
    9. create_project_field — add text/number/date field to a board (idempotent)
    10. set_task_fields — set multiple custom field values in one call
    11. ask_codebase — RAG Q&A over the indexed GitHub repo (Groq + PGVector)
    12. explore_codebase — file explorer backed by PGVector/ChromaDB index
  • RAG pipelineingest.py indexes the target GitHub repo into PGVector (default)
  • Shared helperscore/github_api.py, utils/project_helpers.py
  • Documentationdocs.html (interactive), README.md, plan.md
  • Package manageruv with pyproject.toml

🗂 File Inventory & Docstring Status

Top-level scripts

FileModule docstringAll functions documented
server.py
ingest.py✅ (added March 2026)
rag_query.py

github_mcp/ package

FileModule docstringFunctions documented
__init__.pyn/a
config.pyvalidate_config()
constants.pyn/a (constants only)

github_mcp/core/

FileModule docstringFunctions documented
__init__.pyn/a
github_api.py_headers, _gql_headers, _raise_for_status, _gql_check

github_mcp/utils/

FileModule docstringFunctions documented
__init__.pyn/a
project_helpers.py_resolve_project, _find_field, _inline_value

github_mcp/tools/

FileToolModule docstringTool docstring
__init__.pyregister_all_tools
files.pylist_files
branches.pycreate_branch
file_operations.pycreate_file
pull_requests.pycreate_pull_request
tasks.pycreate_project_task
task_list.pylist_project_tasks
task_assign.pyassign_task
task_status.pyupdate_task_status
project_fields.pycreate_project_field
task_fields.pyset_task_fields
rag_query.pyask_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__.py files
  • 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 ChromaDB
  • rag_query.py — standalone LCEL chain tester
  • github_mcp/tools/rag_query.pyask_codebase + explore_codebase MCP tools

Phase 5: Documentation ✅ COMPLETE (March 2026 update)

  • README.md — full API reference for all 12 tools + module reference
  • docs.html — interactive HTML doc covering all 12 tools, RAG pipeline, module APIs
  • plan.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 storeRAG_VECTOR_DB=pgvector is now the default in .env, ingest.py, rag_query.py, and github_mcp/tools/rag_query.py
  • Fixed async crashask_codebase raised AssertionError: _async_engine not found when using a sync psycopg connection URL. Fixed by adding _PGVectorSyncRetriever (a BaseRetriever subclass that wraps sync similarity_search()) inside github_mcp/tools/rag_query.py; BaseRetriever's default _aget_relevant_documents runs it safely in a thread executor
  • RAG prompt grounded to target repo_RAG_PROMPT is now an f-string that reads GITHUB_OWNER/GITHUB_REPO from the environment so answers refer to the correct repo (Bishwajit-2810/The_New_York_Times) rather than the MCP server project
  • RAG_SKIP_LOCAL_DOCS flag — added to ingest.py and defaulted to true in .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), and github_mcp/tools/rag_query.py
  • README.md overhauled — new "🚀 How to Run This System" section (Steps 0–6), restructured env-var table, updated RAG pipeline section, updated module reference
  • docs.html updated — Quick Start, .env block, RAG pipeline §3 (PGVector default, new install deps, corrected expected output), Tool 11 ask_codebase docstring block, server.py and ingest.py module reference docstring blocks
  • Added ask_codebase (Tool 11) RAG Q&A tool
  • Added explore_codebase (Tool 12) file-explorer tool
  • Added --docs-only flag to ingest.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.py split into github_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_task auto-creates missing labels

🚀 Benefits of Modular Structure

BenefitDetail
MaintainabilityEach tool ~50–200 lines; easy to locate and patch
TestabilityImport and test each tool in isolation
ScalabilityAdd new tools by creating one file + one line in __init__.py
CollaborationClear per-module ownership; minimal merge conflicts
DiscoverabilityFile 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_Times with your target repo in _RAG_PROMPT
  • Replace Bishwajit-2810/GitHubMCP with your own repository name
  • Replace RAG_VECTOR_DB=pgvector default in .env if 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