npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mechris3/github-enterprise-mcp-server

v1.0.7

Published

MCP server for GitHub Enterprise — PR reviews, comments, diffs, and more. No Docker required.

Readme

github-enterprise-mcp-server

GitHub repo

An MCP (Model Context Protocol) server for GitHub Enterprise and github.com. Provides AI assistants with tools to read, review, and manage pull requests — no Docker required.

Why This Exists

  • GitHub's official MCP server requires Docker or Go tooling
  • GitHub's remote MCP server doesn't work with self-hosted GitHub Enterprise instances
  • Other third-party servers don't support custom GHE base URLs

This server is a pure Node.js package. It works with any GitHub Enterprise instance and public github.com, configurable via a single environment variable.

Quick Start

Option 1: npx (recommended)

Add to your MCP configuration (e.g. .kiro/settings/mcp.json):

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@mechris3/github-enterprise-mcp-server@latest"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here",
        "GITHUB_BASE_URL": "https://github.example.com/api/v3"
      }
    }
  }
}

For public github.com, omit GITHUB_BASE_URL — it defaults to https://api.github.com.

Option 2: Clone and build

git clone https://github.com/mechris3/github-enterprise-mcp-server.git
cd github-enterprise-mcp-server
npm install && npm run build

Then in your MCP config:

{
  "mcpServers": {
    "github": {
      "command": "node",
      "args": ["/path/to/github-enterprise-mcp-server/dist/index.js"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here",
        "GITHUB_BASE_URL": "https://github.example.com/api/v3"
      }
    }
  }
}

Configuration

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | GITHUB_TOKEN | Yes* | GitHub Personal Access Token | | GITHUB_TOKEN_FILE | Yes* | Path to a file containing the token (alternative to GITHUB_TOKEN) | | GITHUB_BASE_URL | No | API base URL. Defaults to https://api.github.com |

*One of GITHUB_TOKEN or GITHUB_TOKEN_FILE must be set.

Token Resolution Priority

  1. GITHUB_TOKEN environment variable (used directly)
  2. GITHUB_TOKEN_FILE environment variable (reads token from file at this path)

Base URL Examples

| Instance | Base URL | |----------|----------| | github.com | https://api.github.com (default) | | GitHub Enterprise | https://github.example.com/api/v3 |

PAT Scopes Required

Generate a Classic Personal Access Token at github.com/settings/tokens (or https://your-ghe-host/settings/tokens for GHE) with:

  • repo — Full repository access (read/write PRs, comments, files)

Available Tools

Pull Request — Read

| Tool | Description | |------|-------------| | get_pull_request | Get PR details (title, body, state, author, branches) | | list_pull_requests | List PRs for a repo, filtered by state/branch/sort | | get_diff | Get the full unified diff of a PR | | get_file_contents | Read a file from a specific branch, tag, or commit | | get_pull_request_files | List changed files with status and patch info |

Pull Request — Write

| Tool | Description | |------|-------------| | create_pull_request | Open a new PR from a head branch into a base branch (supports draft) | | mark_pull_request_ready | Promote a draft PR to ready-for-review (GraphQL) |

Review Comments — CRUD

| Tool | Description | |------|-------------| | get_review_comments | Get all review comments with thread structure (via GraphQL) | | create_review_comment | Post a new comment on a specific line in the diff | | add_reply_to_comment | Reply to an existing review comment thread | | edit_review_comment | Edit the body of an existing review comment | | delete_review_comment | Delete a review comment |

Reviews

| Tool | Description | |------|-------------| | create_review | Submit a batched review with verdict and line comments |

Authentication Examples

Below are complete mcp.json configurations showing the full file structure. Place this at .kiro/settings/mcp.json (Kiro), .vscode/mcp.json (VS Code), or wherever your MCP host reads its config.

GitHub Enterprise — token directly in config

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@mechris3/github-enterprise-mcp-server@latest"],
      "env": {
        "GITHUB_TOKEN": "ghp_xxxxxxxxxxxx",
        "GITHUB_BASE_URL": "https://github.yourcompany.com/api/v3"
      }
    }
  }
}

GitHub Enterprise — token from a file

Useful for shared machines, secrets managers, or token rotation:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@mechris3/github-enterprise-mcp-server@latest"],
      "env": {
        "GITHUB_TOKEN_FILE": "~/.config/github-mcp/token",
        "GITHUB_BASE_URL": "https://github.yourcompany.com/api/v3"
      }
    }
  }
}

The file should contain only the token string (no newline, no quotes).

GitHub Enterprise — token from system environment

Set GITHUB_TOKEN in your shell profile (.zshrc, .bashrc, etc.):

export GITHUB_TOKEN="ghp_xxxxxxxxxxxx"

Then omit it from the config — the server inherits it from the process environment:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@mechris3/github-enterprise-mcp-server@latest"],
      "env": {
        "GITHUB_BASE_URL": "https://github.yourcompany.com/api/v3"
      }
    }
  }
}

Public github.com

Omit GITHUB_BASE_URL entirely — it defaults to https://api.github.com:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@mechris3/github-enterprise-mcp-server@latest"],
      "env": {
        "GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
      }
    }
  }
}

Using a local build instead of npx

If you cloned and built the repo yourself:

{
  "mcpServers": {
    "github": {
      "command": "node",
      "args": ["/absolute/path/to/github-enterprise-mcp-server/dist/index.js"],
      "env": {
        "GITHUB_TOKEN": "ghp_xxxxxxxxxxxx",
        "GITHUB_BASE_URL": "https://github.yourcompany.com/api/v3"
      }
    }
  }
}

Requirements

  • Node.js 18+ (uses native fetch)
  • A GitHub PAT with the repo scope
  • An MCP-compatible host (Kiro, VS Code with MCP extension, Cursor, Claude Desktop, etc.)

Troubleshooting

"No GitHub token found"

Set either GITHUB_TOKEN or GITHUB_TOKEN_FILE in your MCP config's env block.

401 Unauthorized

Your token is invalid or expired. Generate a new PAT with the repo scope.

404 Not Found

Either the repo doesn't exist, you don't have access, or the base URL is wrong. For GHE, ensure the URL ends with /api/v3.

GraphQL errors on get_review_comments

This tool uses GraphQL. Ensure your GHE instance supports the GraphQL API (available in GHE 2.12+). The tool automatically falls back to REST if GraphQL fails (you'll still get comments, just without thread structure).

Network errors

Ensure the machine running the MCP server can reach your GitHub Enterprise instance. VPN may be required for on-prem installations.

For AI Assistants / Contributors

See CONTEXT.md for architecture details, conventions, and a step-by-step guide for adding new tools. This file is designed to be consumed by LLMs working on the codebase.

License

MIT