Skip to main content
Glama
github-mcp-server

github-mcp-server

by ArnabbLank

github-mcp-server

A minimal MCP server for GitHub in ~140 lines of Python. Browse repos, read code, search, and get insights — all through natural language via Claude, Cursor, or any MCP client.

Tools

Tool

Description

list_repos

List repositories with language, stars, and last update

get_repo_structure

View the file tree of any repo

get_file

Read any file's content

search_code

Search code across your repos

list_issues

Get open/closed issues

get_commits

Recent commit history

repo_stats

Languages breakdown, stars, forks, dates

Related MCP server: MCP GitHub Reader

Quick Start

# Clone
git clone https://github.com/ArnabbLank/github-mcp-server.git
cd github-mcp-server

# Install
pip install -e .

# Configure
cp .env.example .env
# Edit .env with your GitHub token (Settings → Developer settings → Personal access tokens)

# Run
mcp dev server.py

Connect to Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "github": {
      "command": "python",
      "args": ["/path/to/github-mcp-server/server.py"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token",
        "GITHUB_OWNER": "your_username"
      }
    }
  }
}

Restart Claude Desktop. You can now ask things like:

  • "Show me my recent repos"

  • "Read the README from my EnvCraft project"

  • "Search for uses of FastAPI across my repos"

  • "What issues are open on github-mcp-server?"

How It Works

This server implements the Model Context Protocol using fastmcp. Each tool is a Python function decorated with @mcp.tool() — the MCP client (Claude, Cursor) discovers them automatically and calls them when relevant.

┌─────────────┐       MCP (stdio/SSE)       ┌──────────────┐      HTTPS       ┌────────┐
│ Claude/Cursor│ ◄──────────────────────────► │  server.py   │ ◄──────────────► │ GitHub │
│  (MCP Client)│                              │ (MCP Server) │                  │  API   │
└─────────────┘                               └──────────────┘                  └────────┘

Add Your Own Tool

@mcp.tool()
async def my_tool(repo: str, owner: str = "") -> str:
    """Description shown to the LLM."""
    owner = owner or OWNER
    data = await _get(f"/repos/{owner}/{repo}/whatever")
    return format_data(data)

That's it. The LLM sees the function name, docstring, and parameter types — no extra config needed.

Token Permissions

The GitHub token needs these scopes:

  • repo — for private repo access (optional, skip for public-only)

  • read:user — for listing repos

Generate one at: https://github.com/settings/tokens

License

MIT

Available Tools

7 tools
get_commitsC

Get recent commits for a repository.

Inputs: repo (required), limit, owner. Returns: result

get_fileB

Read a file's content from a GitHub repository.

Inputs: repo (required), path (required), branch, owner. Returns: result

get_repo_structureC

Get the file/directory tree of a repository (one level deep).

Inputs: repo (required), path, owner. Returns: result

list_issuesC

List issues for a repository.

Inputs: repo (required), state, owner, limit. Returns: result

list_reposB

List repositories for a user/org. Returns name, language, stars, and last updated.

Inputs: owner, limit. Returns: result

repo_statsB

Get repository stats: languages, size, open issues, forks, creation date.

Inputs: repo (required), owner. Returns: result

search_codeC

Search code across repositories. Optionally filter by owner or language.

Inputs: query (required), owner, language. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action: commits, file content, repo structure, issues, repos list, stats, and code search. No two tools have overlapping purposes.

    Naming Consistency4/5

    Most tools follow a consistent verb_noun snake_case pattern (e.g., get_commits, list_issues). The exception is 'repo_stats', which uses noun_noun, but overall style remains uniform.

    Tool Count5/5

    Seven tools is a well-scoped set for a read-oriented GitHub client. Each tool provides distinct functionality without redundancy.

    Completeness3/5

    Basic read operations are covered (repos, files, commits, issues, search), but gaps exist: no single-repo details, no single-issue view, and no write operations (create/update). Agents may face dead ends.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      An MCP server for gitingest. It allows MCP clients like Claude Desktop, Cursor, Cline etc to quickly extract information about Github repositories including repository summaries, project directory structure, file contents, etc
      3
      138
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A read-only MCP server that exposes GitHub user profiles, repository info, and search via tools for AI assistants like Claude.
      -
    • A
      license
      A
      quality
      D
      maintenance
      GitHub MCP server for Claude Code, Cursor, Cline, Windsurf, and any MCP-compatible client. Exposes GitHub tools (issues, pull requests, code search, file content) to your LLM via the Model Context Protocol.
      7
      MIT