github-enterprise-mcp-server
v1.1.2
Published
MCP server for GitHub Enterprise API - local/internal use only. No authentication info included.
Maintainers
Readme
GitHub Enterprise MCP Server
MCP server for the GitHub Enterprise API. Use with Claude Desktop or any MCP client. Local/internal use only. No authentication info is included in the package.
Installation
npm install github-enterprise-mcp-serverOr run directly with npx (no install):
npx github-enterprise-mcp-server --endpoint https://your-ghe.example.com/api/v3 --token ghp_YOUR_TOKENMCP server configuration
To use this server from an MCP client (Claude Desktop, Cursor, etc.), you need the endpoint (HTTPS) and a Personal Access Token.
1. Claude Desktop
Config file location (by OS):
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Example 1 – npx with env vars (recommended; token not visible in process list):
{
"mcpServers": {
"github-enterprise": {
"command": "npx",
"args": ["-y", "github-enterprise-mcp-server"],
"env": {
"GITHUB_ENTERPRISE_ENDPOINT": "https://your-ghe.example.com/api/v3",
"GITHUB_ENTERPRISE_TOKEN": "ghp_YOUR_PERSONAL_ACCESS_TOKEN"
}
}
}
}Note: Including
-yinargsmakes npx run without prompting. Always use-yso Cursor does not time out waiting for the MCP server.
Example 2 – local build with args:
{
"mcpServers": {
"github-enterprise": {
"command": "node",
"args": [
"/absolute/path/to/github-enterprise-mcp-server/dist/index.js",
"--endpoint", "https://your-ghe.example.com/api/v3",
"--token", "ghp_YOUR_TOKEN"
]
}
}
}2. Cursor
Config file location:
- User global:
~/.cursor/mcp.json(macOS/Linux) or%USERPROFILE%\.cursor\mcp.json(Windows) - Per project:
.cursor/mcp.jsonin the project root
Example – npx with env vars (recommended):
{
"mcpServers": {
"github-enterprise": {
"command": "npx",
"args": ["-y", "github-enterprise-mcp-server"],
"env": {
"GITHUB_ENTERPRISE_ENDPOINT": "https://your-ghe.example.com/api/v3",
"GITHUB_ENTERPRISE_TOKEN": "ghp_YOUR_PERSONAL_ACCESS_TOKEN"
}
}
}
}Important: Without
-y, npx may prompt for install confirmation and Cursor may fail to start the MCP server in time.
Example – run from a local clone of this repo:
{
"mcpServers": {
"github-enterprise": {
"command": "node",
"args": [
"/path/to/github_ent_mcp_server/mcp-server/dist/index.js",
"--endpoint", "https://your-ghe.example.com/api/v3",
"--token", "ghp_YOUR_TOKEN"
]
}
}
}After restarting Cursor, the MCP server list should show github-enterprise if configured correctly.
Troubleshooting: MCP not working in Cursor after npm install
1) Use
-ywith npx
Setargsto["-y", "github-enterprise-mcp-server"]. Without-y, npx may prompt and the MCP connection can time out.2) Env vars not passed
Some clients may not passenvto the child process. In that case pass options on the command line (token will be visible in config and process list; use with care):"command": "npx", "args": [ "-y", "github-enterprise-mcp-server", "--endpoint", "https://your-ghe.example.com/api/v3", "--token", "ghp_YOUR_TOKEN" ]3) Test in terminal
Run with the same config in a terminal to see errors (endpoint format, token format, HTTPS, etc.):GITHUB_ENTERPRISE_ENDPOINT="https://your-ghe.example.com/api/v3" GITHUB_ENTERPRISE_TOKEN="ghp_..." npx -y github-enterprise-mcp-server4) Config file location
Cursor reads only the user global~/.cursor/mcp.jsonor the project root.cursor/mcp.json. Check path and JSON syntax (commas, quotes).5) Timeout exceeded / connection cancelled
Cursor kills the MCP process if it does not start in time. Startup validation (GitHub API/user) has a default 60s timeout. To increase it, set e.g.GITHUB_ENTERPRISE_STARTUP_VALIDATION_TIMEOUT_MS=90000(milliseconds) inenv. If Cursor still times out, run the server via local install:npm install -g github-enterprise-mcp-server, then usecommand:"node",args:["$(npm root -g)/github-enterprise-mcp-server/dist/index.js", ...].
3. Other MCP clients
Add an entry under mcpServers in the same shape:
- command:
nodeornpx - args:
["path-or-package-name", "--endpoint", "https://...", "--token", "ghp_..."]
Or just the package name:["github-enterprise-mcp-server"] - env (recommended): Pass
GITHUB_ENTERPRISE_ENDPOINTandGITHUB_ENTERPRISE_TOKENso the token is not on the command line.
Security: If the token is stored in a config file, add that file to .gitignore and do not commit it.
Security
- HTTPS only: HTTP endpoints are rejected.
- Token format: Tokens must match GitHub token format (
ghp_,ghs_, etc.). - Startup validation: The server validates endpoint and token before starting (calls
/user). Default timeout for this call is 60s; setGITHUB_ENTERPRISE_STARTUP_VALIDATION_TIMEOUT_MS(milliseconds) to increase it. - Recommended scopes:
repo,read:org. The server runs even without these; it only prints a warning if scopes are missing.read:orgis only needed for org-related APIs; for repos/issues/PRs,repois enough. SetGITHUB_ENTERPRISE_SKIP_SCOPE_WARNING=1ortrueto hide the warning. - Self-signed certificates: Disabled by default. Enable with
--allow-self-signed-certorALLOW_SELF_SIGNED_CERT=true(logs a security warning). - Debug logs: Normal startup/shutdown messages are not written to stderr (so Cursor won’t show them as
[error]). SetGITHUB_ENTERPRISE_DEBUG=1orDEBUG=1to see e.g. "Registered N tools", "running on stdio".
If your token is compromised
- Revoke the token immediately in GitHub Enterprise (Settings → Developer settings → Personal access tokens).
- Create a new token and update your config.
- Check audit logs for unauthorized access.
Available tools
- Repositories:
github-repo-get,github-repo-list,github-repo-create,github-repo-update,github-repo-delete - Issues:
github-issue-get,github-issue-list,github-issue-create,github-issue-update,github-issue-close,github-issue-comment - Pull requests:
github-pr-get,github-pr-list,github-pr-create,github-pr-merge,github-pr-review - Branches:
github-branch-list,github-branch-get,github-branch-create,github-branch-delete - Commits:
github-commit-get,github-commit-list,github-commit-compare - Contents (repository files):
github-contents-get,github-contents-create-or-update,github-contents-delete - Git (low-level):
github-commit-create,github-ref-update,github-tag-list,github-tag-create
Full tool list and GitHub API mapping: docs/tools-and-api.md.
Publishing to npm
How to publish the package to an npm registry.
Versioning
npm uses Semantic Versioning (SemVer): MAJOR.MINOR.PATCH (e.g. 1.0.0).
| Type | When to bump | Example |
|---------|----------------|----------------|
| MAJOR | Breaking changes (API removal/behavior change) | 1.0.0 → 2.0.0 |
| MINOR | New backward-compatible features | 1.0.0 → 1.1.0 |
| PATCH | Backward-compatible bug fixes | 1.0.0 → 1.0.1 |
Bumping version (updates version in package.json and Git tag):
# Patch (1.0.0 → 1.0.1) – bug fixes
npm version patch
# Minor (1.0.0 → 1.1.0) – new features
npm version minor
# Major (1.0.0 → 2.0.0) – breaking changes
npm version major- Use
-m "message"withnpm versionto set the Git commit message, e.g.npm version patch -m "Fix retry timeout". - With a Git repo,
npm version patchcreates a commit and tag (e.g.v1.0.1). Use--no-git-tag-versionto only updatepackage.jsonwithout committing or tagging.
1. Pre-publish checklist
cd mcp-server
npm run build
npm run audit- The
filesfield inpackage.jsonincludes onlydistandREADME.md; source and tests are not published. - On the public npm registry, the package name must be globally unique. If
github-enterprise-mcp-serveris already taken, use a scoped name like@your-org/github-enterprise-mcp-server.
2. Publish to the public npm (npmjs.com)
npm account: Sign up at https://www.npmjs.com/signup.
Log in (once per machine):
npm loginEnter username, password, email, and OTP if enabled.
Check name availability (optional):
npm search github-enterprise-mcp-serverIf the name exists, change
nameinpackage.jsonor publish as a scoped package.Publish:
npm publish- Scoped packages (e.g. for an org): set
"name": "@your-org/github-enterprise-mcp-server", then:- Private:
npm publish --access restricted - Public:
npm publish --access public
- Private:
- Scoped packages (e.g. for an org): set
3. Private / internal registry
For an internal registry (e.g. Nexus, Verdaccio, GitHub Packages, Azure Artifacts):
Set registry URL:
npm config set registry https://your-registry.company.com/npm/Or in
package.jsonfor this project only:"publishConfig": { "registry": "https://your-registry.company.com/npm/" }Authentication (depends on the registry):
- Configure token or credentials in
.npmrc(see registry docs). - Example:
//your-registry.company.com/npm/:_authToken=YOUR_TOKEN
- Configure token or credentials in
Publish:
npm publish
After publishing:
- Public npm:
npm install github-enterprise-mcp-serverornpx github-enterprise-mcp-server ... - Internal registry: set registry and auth, then use
npm install/npxas usual.
Build
npm run buildData and retention
This server does not store any persistent data. All requests go to the GitHub Enterprise API using the credentials you provide.
