GitHub Insights MCP Server
Provides tools for analyzing public GitHub repositories, including repository metadata and README content, file/folder structure, detected tech stack and dependency manifests, Mermaid architecture diagrams of top-level structure, and retrieval of specific file contents via the GitHub REST API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GitHub Insights MCP Serveranalyze the tech stack and structure of microsoft/vscode"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
š GitHub Insights MCP Server
An MCP (Model Context Protocol) server that lets Claude understand any public GitHub repository ā its purpose, structure, tech stack, and architecture ā by exposing typed, focused tools instead of requiring manual browsing.
Built to explore the MCP protocol: tool design, structured data contracts, and the division of labor between a tool-providing server and the LLM client that consumes it.
Table of Contents
Related MCP server: GitHub Context MCP Server
How it Works
Ask Claude Desktop about any public GitHub repo, and it can call one of five tools:
get_repo_overview_toolā metadata (stars, language, last update) + README contentget_repo_structure_toolā depth-limited file/folder treeget_tech_stack_toolā detected languages and dependency manifest filesgenerate_architecture_diagram_toolā a Mermaid diagram of the top-level structureget_file_content_toolā full content of a specific file, for deeper analysis
Claude decides which tools to call and in what order based on the question ā
e.g. reading get_repo_structure_tool's output to identify an entry point
file, then calling get_file_content_tool to actually read it.
Architecture
āāāāāāāāāāāāāāāāāāā stdio (MCP/JSON-RPC) āāāāāāāāāāāāāāāāāāāāāāāā
ā Claude Desktop ā āāāāāāāāāāāāāāāāāāāāāāāāāāā¶ ā GitHub Insights MCP ā
ā (MCP client) ā āāāāāāāāāāāāāāāāāāāāāāāāāāā ā Server ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāā¬āāāāāāāāāāā
ā HTTPS (REST)
ā¼
āāāāāāāāāāāāāāāāāāāā
ā GitHub API ā
āāāāāāāāāāāāāāāāāāāāThe server runs locally as a subprocess launched by Claude Desktop, communicating over stdio using the MCP protocol. It never talks to an LLM itself ā it fetches and structures data from the GitHub REST API, and lets the calling LLM (Claude) handle summarization and reasoning. See Design Decisions for why this split matters.
Tech Stack
Layer | Choice | Why |
Protocol | Official | Standard, actively maintained |
HTTP Client |
| Async-native, pairs cleanly with MCP's async tool handlers |
Data Validation |
| Typed tool schemas, response validation |
Configuration |
| Validated config, resolved to an absolute |
Resilience |
| Retries on transient network errors, not on definitive API errors |
Testing |
| Fully mocked HTTP ā no real GitHub calls during test runs |
Project Structure
github-insights-mcp/
āāā server.py # MCP entrypoint - registers tools, starts stdio transport
āāā github_client.py # Sole GitHub REST API access layer (auth, retries, error mapping)
āāā analyzers/
ā āāā overview.py # Repo metadata + README content
ā āāā structure.py # Depth-limited file/folder tree
ā āāā tech_stack.py # Language + manifest file detection
ā āāā diagram.py # Mermaid diagram generation (pure function)
ā āāā file_content.py # Single-file content retrieval
āāā tests/
ā āāā conftest.py # Shared fixtures
ā āāā test_github_client.py # URL parsing, HTTP error mapping (mocked)
ā āāā test_tech_stack.py # Detection logic (mocked)
ā āāā test_diagram.py # Diagram generation (pure, unmocked)
āāā models.py # Pydantic models for every tool's input/output
āāā config.py # Validated settings, absolute .env resolution
āāā logging_config.py # Logging setup (stderr, not stdout ā see below)
āāā exceptions.py # Domain-specific exception types
āāā docs/
ā āāā PRD.md # Product requirements
ā āāā ARCHITECTURE.md # Technical design
āāā requirements.txt
āāā pytest.ini
āāā .env.exampleGetting Started
Prerequisites
Python 3.11+
A GitHub Personal Access Token with
public_reposcope only (create one here)Claude Desktop (free to install; no paid plan required for local MCP servers)
Setup
git clone https://github.com/AhmetSOGUT/github-insights-mcp.git
cd github-insights-mcp
conda create -n github-insights-mcp python=3.11 -y
conda activate github-insights-mcp
pip install -r requirements.txt
cp .env.example .env
# edit .env and set GITHUB_TOKEN=your-token-hereConnecting to Claude Desktop
Open Claude Desktop ā Settings ā Developer ā Edit Config
Add this server under
mcpServers(create the key if it doesn't exist):
{
"mcpServers": {
"github-insights": {
"command": "/absolute/path/to/your/python",
"args": ["/absolute/path/to/github-insights-mcp/server.py"]
}
}
}Use the absolute path to the Python interpreter inside your conda
environment (where python on Windows / which python on macOS/Linux) ā
Claude Desktop does not inherit your shell's activated environment.
Restart Claude Desktop completely (quit from the system tray, not just close the window).
Check Settings ā Connectors ā
github-insightsshould show as connected.Ask Claude something like: "Summarize what this repo does: https://github.com/owner/repo"
Running Tests
All GitHub API calls are mocked via respx ā no token or network access
needed to run the suite:
pytest -vDesign Decisions
Why does the server not summarize anything itself? It returns structured, factual data (README text, file contents, metadata) and leaves synthesis to the calling LLM. Calling a second LLM from inside the server would mean a second API key, doubled latency, and duplicated work the client is already positioned to do. This keeps the server a pure tool provider, in line with what MCP is designed for.
Why log to
stderrinstead ofstdout? MCP communicates with its client overstdout. Anything else written tostdoutā including log output ā would corrupt the protocol stream and break the connection. All logging in this project is explicitly routed tostderr.Why resolve
.envvia an absolute path inconfig.py? Claude Desktop launches this server from an unpredictable working directory (not necessarily the project root). A relative.envpath works when run manually from the project folder but fails silently under Claude Desktop, causing confusing startup failures. Resolving the path viaPath(__file__).parentmakes config loading independent of how the process was launched.Why a single
GitHubClientinstead of callinghttpxdirectly from each analyzer? Authentication, retry behavior, and GitHub-specific error translation (404 āRepoNotFoundError, rate-limited 403 āRateLimitError) live in exactly one place. Analyzers stay focused on interpreting data, not on HTTP or auth concerns.
Known Limitations
README and file content are truncated (README to ~3,000 characters, individual files to 50,000 characters) to keep responses fast and token-efficient. For very large files or sparse READMEs, this can produce a less complete picture than Claude's own web browsing would, which has no such caps ā this is a deliberate v1 trade-off, not an oversight (see
docs/PRD.md, Section 4).The architecture diagram only reflects top-level folders, not actual import relationships between files. A more accurate diagram would require parsing source files, which is out of scope for v1.
Single-user, PAT-based auth only. Anyone using this server needs their own GitHub token; there's no OAuth flow for a shared/hosted deployment.
Roadmap
Deeper architecture diagrams based on actual import/dependency parsing
OAuth-based auth for a shared, multi-user deployment
Commit/PR/issue activity summaries
Smarter file selection (auto-detect entry points to read, rather than requiring the LLM to guess a path)
A remote-hosted version of the server
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Dive into the world of open-source with the GitHub Repo Explorer! Utilize the powerful GitHub
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Screens public GitHub repos and PRs to generate risk maps, findings, and merge-readiness signals.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables analysis of any GitHub repository to get architecture, file roles, execution flows, system design Q\&A, and structured agent context. Works with MCP-compatible clients like Claude Desktop, Cursor, and Windsurf.628 npmMIT
- FlicenseAqualityDmaintenanceEnables Claude to access and manage GitHub repositories dynamically at runtime, including private repos, with tools for browsing files, searching code, and viewing commits, pull requests, and issues.111-
- AlicenseNot gradedqualityDmaintenanceEnables Claude to analyze GitHub repositories with tools for health scoring, contributor analysis, issue tracking, code search, and more.MIT
- FlicenseNot gradedqualityCmaintenanceEnables Claude to query GitHub repositories in plain English, fetching recent activity, release notes, issue triage, and health summaries via the GitHub API.-