Get the FREE Ultimate OpenClaw Setup Guide →

github

A model context protocol server for GitHub API

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio parassolanki-github-mcp-server npx -y github-mcp-server \
  --env GITHUB_PERSONAL_ACCESS_TOKEN="your_personal_github_access_token"

How to use

This MCP server provides a GitHub integration for use with the Model Context Protocol. It exposes a set of tools that allow an LLM to search repositories, issues, commits, code, users, topics, labels, and pull requests on GitHub, as well as list and retrieve details for issues and pull requests. The tools are designed to be called by natural language prompts that map to GitHub API operations such as search_repositories, search_issues, search_commits, search_code, search_users, search_topics, search_labels, list_repositories_issues, get_issue, list_repositories_pull_requests, get_pull_request, and more. This enables an LLM to retrieve structured information from GitHub in a guided manner, supporting tasks like code research, project discovery, and issue tracking without leaving the MCP-enabled interface.

How to install

Prerequisites:

  • Node.js and npm (or npx available)
  • Internet access to fetch the GitHub MCP server package

Installation steps:

  1. Ensure you have a GitHub Personal Access Token (PAT) with the required scopes for your use case. Generate one from GitHub and keep it secure.

  2. Install and run the MCP server via npx. The README uses npx to install and run github-mcp-server:

# Optional: if you want to preinstall locally
npm install -g github-mcp-server

# Run the MCP server via npx (as described in the README)
npx -y github-mcp-server
  1. Configure Claude Desktop (or your client) with the following JSON snippet to point at the MCP server:
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "github-mcp-server"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your_personal_github_access_token"
      }
    }
  }
}
  1. Provide your GitHub PAT in the environment variable (GITHUB_PERSONAL_ACCESS_TOKEN) to authorize access to GitHub on behalf of your account.

  2. Verify the server is reachable from your MCP-enabled client and begin issuing prompts that invoke the available tools.

Additional notes

Tips and caveats:

  • The GITHUB_PERSONAL_ACCESS_TOKEN should have appropriate scopes for the actions you intend to perform (e.g., repo, read:user).
  • The environment variable in the config is a placeholder; replace it with your actual token or a secure secret mechanism provided by your deployment environment.
  • If you encounter rate limits, consider optimizing queries or authenticating with a token that has higher rate limits.
  • The tools expose multiple sorting and filtering options (e.g., sort fields like created, updated, comments; direction asc/desc). Use precise queries to minimize results and API usage.
  • For local development, pnpm should be available if you continue using the repository’s tooling as shown in the README (pnpm install, pnpm dev, pnpm build, etc.).

Related MCP Servers

Sponsor this space

Reach thousands of developers