Skip to main content
Glama
GitHub MCP Server

GitHub MCP Server

by luizHramoss

GitHub MCP Server

Custom MCP (Model Context Protocol) server, written in TypeScript, that connects GitHub to the GitHub REST API.

What it does

It exposes 6 tools that Claude can call:

Tool

Description

list_repos

Lists the authenticated user's repositories

get_repo

Details of a specific repository

list_issues

Lists a repository's issues

create_issue

Creates a new issue

get_file_content

Reads the contents of a file in the repository

search_code

Searches code on GitHub

Related MCP server: PR Reviewer MCP Server

1. Generate a GitHub Personal Access Token

  1. Go to GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens

  2. Create a token with the minimum required permissions:

    • Contents: Read (for get_file_content)

    • Issues: Read and write (for list_issues/create_issue)

    • Metadata: Read (always required)

  3. Copy the generated token (it starts with github_pat_...)

Security tip: never commit the token to the repository. Use an environment variable.

2. Install and build

npm install
npm run build

This generates build/index.js, which is the server executable (it communicates via stdio, the standard MCP protocol).

3. Test locally (optional, without Claude)

export GITHUB_PERSONAL_ACCESS_TOKEN="seu_token_aqui"
npm start

If GitHub MCP server rodando via stdio. appears in stderr, it is working. To test the tools interactively, use the MCP Inspector:

npx @modelcontextprotocol/inspector node build/index.js

4. Connect to Claude Desktop

Edit the Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add:

{
  "mcpServers": {
    "github": {
      "command": "node",
      "args": ["/caminho/absoluto/para/github-mcp-server/build/index.js"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "seu_token_aqui"
      }
    }
  }
}

Restart Claude Desktop. The GitHub tools should appear in the conversation's tools icon (🔨).

5. Next steps (ideas to expand and boost your portfolio)

  • Add authoring tools: create_pull_request, merge_pull_request, create_branch

  • Add real (cursor-based) pagination instead of just per_page

  • Rate limiting and caching (GitHub limits authenticated requests to 5000 req/h)

  • Automated tests with Vitest/Jest

  • CI with GitHub Actions running lint + tests + build on every push

  • Publish as a npm package (npx github-mcp-server)

  • Dockerize the server (good hook to connect with your other DevOps projects)

Project structure

github-mcp-server/
├── src/
│   └── index.ts      # lógica do servidor e definição das tools
├── build/             # gerado pelo `npm run build`
├── package.json
├── tsconfig.json
└── README.md

Available Tools

6 tools
create_issueB

Cria uma nova issue em um repositório

Inputs: repo (required), owner (required), title (required), body, +1 more.

get_file_contentB

Lê o conteúdo de um arquivo em um repositório

Inputs: path (required), repo (required), owner (required), ref.

get_repoC

Obtém detalhes de um repositório específico

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

list_issuesC

Lista issues de um repositório

Inputs: repo (required), owner (required), state.

list_reposA

Lista os repositórios do usuário autenticado no GitHub

Inputs: sort, per_page.

search_codeA

Busca código no GitHub usando a sintaxe de busca do GitHub

Inputs: query (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct resource/action: repository listing/detail, issue listing/creation, file reading, and code search. No tools appear to overlap in purpose.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern such as list_repos, get_repo, list_issues, and create_issue. The naming is predictable and internally consistent.

    Tool Count5/5

    Six tools provide a reasonable, well-scoped surface for basic GitHub repository queries, issue management, and code search. Each tool earns its place without redundancy.

    Completeness3/5

    The set covers a useful read-heavy workflow and issue creation, but it lacks operations like updating/closing issues, repository creation, and pull request access. These are notable gaps within the GitHub domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables to interact with GitHub repositories directly from Claude, supporting actions like viewing repos, checking status, committing and pushing changes, and managing pull requests.
      544 npm
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude to query GitHub repositories in plain English, fetching recent activity, release notes, issue triage, and health summaries via the GitHub API.
      -