# aniru18/github-mcp architecture

> Architecture diagram of the GitHub repository aniru18/github-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aniru18/github-mcp
- Repository: https://github.com/aniru18/github-mcp

## Overview

This is a Python MCP server for browsing and analyzing GitHub repositories. A user sends a natural-language request through an MCP client; the server dispatches it to a repository tool, which returns formatted repository information. The tools cover repository metadata and structure, code and file access, history and collaboration, comparisons, analysis, URLs, and local cloning. Vercel exposes the HTTP app through an ASGI entry point; local use is also documented. The excerpts establish the entry-point wiring, while tool capabilities and deployment modes are taken from the README.

Main entry points: [`server.py`](https://github.com/aniru18/github-mcp/blob/main/server.py) (MCP Tool Server), [`api/index.py`](https://github.com/aniru18/github-mcp/blob/main/api/index.py) (Vercel ASGI Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["MCP Runtime"]
  node_vercel_entry["Vercel ASGI Entry<br/>[index.py]"]
  node_mcp_server["MCP Tool Server<br/>[server.py]"]
end

subgraph group_repository["Repository Access"]
  node_repo_metadata["Repository Metadata<br/>[server.py]"]
  node_repo_files["Tree and File Access<br/>[server.py]"]
  node_code_search["Code Search<br/>[server.py]"]
end

subgraph group_insight["Repository Insights"]
  node_history_collaboration["History and Collaboration<br/>[server.py]"]
  node_branch_compare["Branch Comparison<br/>[server.py]"]
  node_repo_analysis["Structural Analysis<br/>[server.py]"]
  node_file_urls["File URLs<br/>[server.py]"]
end

subgraph group_local["Local Operations"]
  node_clone["Local Repository Clone<br/>[server.py]"]
end

node_user(("MCP Client User"))
node_github["GitHub"]
node_local_disk[("Local Disk")]

node_user -->|"requests tools"| node_mcp_server
node_vercel_entry -->|"exposes HTTP app"| node_mcp_server
node_mcp_server -->|"dispatches tools"| node_repo_metadata
node_mcp_server -->|"dispatches tools"| node_repo_files
node_mcp_server -->|"dispatches tools"| node_code_search
node_mcp_server -->|"dispatches tools"| node_history_collaboration
node_mcp_server -->|"dispatches tools"| node_branch_compare
node_mcp_server -->|"dispatches tools"| node_repo_analysis
node_mcp_server -->|"dispatches tools"| node_file_urls
node_mcp_server -->|"dispatches tool"| node_clone
node_repo_metadata -->|"queries metadata"| node_github
node_repo_files -->|"reads repository"| node_github
node_code_search -->|"searches code"| node_github
node_history_collaboration -->|"queries history"| node_github
node_branch_compare -->|"compares revisions"| node_github
node_repo_analysis -->|"analyzes repository"| node_github
node_file_urls -->|"resolves file URLs"| node_github
node_clone -->|"clones repository"| node_local_disk

click node_vercel_entry "https://github.com/aniru18/github-mcp/blob/main/api/index.py"
click node_mcp_server "https://github.com/aniru18/github-mcp/blob/main/server.py"
click node_repo_metadata "https://github.com/aniru18/github-mcp/blob/main/server.py"
click node_repo_files "https://github.com/aniru18/github-mcp/blob/main/server.py"
click node_code_search "https://github.com/aniru18/github-mcp/blob/main/server.py"
click node_history_collaboration "https://github.com/aniru18/github-mcp/blob/main/server.py"
click node_branch_compare "https://github.com/aniru18/github-mcp/blob/main/server.py"
click node_repo_analysis "https://github.com/aniru18/github-mcp/blob/main/server.py"
click node_file_urls "https://github.com/aniru18/github-mcp/blob/main/server.py"
click node_clone "https://github.com/aniru18/github-mcp/blob/main/server.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_vercel_entry,node_mcp_server,node_user toneBlue
class node_repo_metadata,node_repo_files,node_code_search,node_local_disk toneAmber
class node_history_collaboration,node_branch_compare,node_repo_analysis,node_file_urls toneMint
class node_clone toneRose
class node_github toneIndigo
```

## Components

### MCP Runtime

- [Vercel ASGI Entry](https://github.com/aniru18/github-mcp/blob/main/api/index.py): `api/index.py`
- [MCP Tool Server](https://github.com/aniru18/github-mcp/blob/main/server.py): `server.py`

### Repository Access

- [Repository Metadata](https://github.com/aniru18/github-mcp/blob/main/server.py): `server.py`
- [Tree and File Access](https://github.com/aniru18/github-mcp/blob/main/server.py): `server.py`
- [Code Search](https://github.com/aniru18/github-mcp/blob/main/server.py): `server.py`

### Repository Insights

- [History and Collaboration](https://github.com/aniru18/github-mcp/blob/main/server.py): `server.py`
- [Branch Comparison](https://github.com/aniru18/github-mcp/blob/main/server.py): `server.py`
- [Structural Analysis](https://github.com/aniru18/github-mcp/blob/main/server.py): `server.py`
- [File URLs](https://github.com/aniru18/github-mcp/blob/main/server.py): `server.py`

### Local Operations

- [Local Repository Clone](https://github.com/aniru18/github-mcp/blob/main/server.py): `server.py`

### Other components

- **MCP Client User**
- **GitHub**
- **Local Disk**

## Connections

- MCP Client User → MCP Tool Server: requests tools (evidence: `README.md`)
- Vercel ASGI Entry → MCP Tool Server: exposes HTTP app (evidence: `api/index.py`)
- MCP Tool Server → Repository Metadata: dispatches tools (evidence: `README.md`)
- MCP Tool Server → Tree and File Access: dispatches tools (evidence: `README.md`)
- MCP Tool Server → Code Search: dispatches tools (evidence: `README.md`)
- MCP Tool Server → History and Collaboration: dispatches tools (evidence: `README.md`)
- MCP Tool Server → Branch Comparison: dispatches tools (evidence: `README.md`)
- MCP Tool Server → Structural Analysis: dispatches tools (evidence: `README.md`)
- MCP Tool Server → File URLs: dispatches tools (evidence: `README.md`)
- MCP Tool Server → Local Repository Clone: dispatches tool (evidence: `README.md`)
- Repository Metadata → GitHub: queries metadata (evidence: `README.md`)
- Tree and File Access → GitHub: reads repository (evidence: `README.md`)
- Code Search → GitHub: searches code (evidence: `README.md`)
- History and Collaboration → GitHub: queries history (evidence: `README.md`)
- Branch Comparison → GitHub: compares revisions (evidence: `README.md`)
- Structural Analysis → GitHub: analyzes repository (evidence: `README.md`)
- File URLs → GitHub: resolves file URLs (evidence: `README.md`)
- Local Repository Clone → Local Disk: clones repository (evidence: `README.md`)
