GitHub Enterprise MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
An MCP (Model Context Protocol) server for integration with GitHub Enterprise API. This server provides an MCP interface to easily access repository information, issues, PRs, and more from GitHub Enterprise in Cursor.
Compatibility
This project is primarily designed for GitHub Enterprise Server environments, but it also works with:
- GitHub.com
- GitHub Enterprise Cloud
> **Note**: Some enterprise-specific features (like license information and enterprise statistics) will not work with GitHub.com or GitHub Enterprise Cloud.
Key Features
- Retrieve repository list from GitHub Enterprise instances
- Get detailed repository information
- List repository branches
- View file and directory contents
- Manage issues and pull requests
- Repository management (create, update, delete)
- GitHub Actions workflows management
- User management (list, create, update, delete, suspend/unsuspend users)
- Access enterprise statistics
- Enhanced error handling and user-friendly response formatting
Getting Started
Prerequisites
- Node.js 18 or higher
- Access to a GitHub Enterprise instance
- Personal Access Token (PAT)
Docker Installation and Setup
Option 1: Running with Docker
1. Build the Docker image:
2. Run the Docker container with environment variables:
> **Note**: The Dockerfile is configured to run with --transport http by default. If you need to change this, you can override the command:
Option 2: Using Docker Compose
1. Create a .env file in the project root with the required environment variables:
2. Start the container with Docker Compose:
3. Check the logs:
4. Stop the container:
Installation and Setup
Local Development (Using Concurrent Mode)
This method is recommended for active development with automatic recompilation and server restarts:
1. Clone the repository and install required packages:
2. Run the development server:
This will:
- Compile TypeScript code automatically when files change
- Restart the server when compiled files are updated
- Run the server in HTTP mode for URL-based connections
3. Connect to Cursor using URL mode as described below
Installation and Setup for Production
Option 1: Using URL Mode (Recommended for Local Development)
This method is the most stable and recommended for local development or testing:
1. Clone the repository and install required packages:
2. Build the project:
3. Run the server:
4. Connect to Cursor using URL mode:
- Add the following to your Cursor's .cursor/mcp.json file:
Option 2: Install as a Global Command (npm link)
This method is useful for local development:
Option 3: Using npx (When Package is Published)
If the package is published to the public npm registry:
Integration with AI Tools
Claude Desktop
Add the following to your claude_desktop_config.json:
Replace YOUR_GITHUB_TOKEN and YOUR_GITHUB_ENTERPRISE_URL with your actual values.
Cursor
Recommended: URL Mode (Most Stable)
For the most reliable operation in Cursor, using URL mode is recommended:
1. Start the server in a separate terminal window:
2. Configure Cursor's MCP settings:
- Open Cursor and go to **Settings**
- Navigate to **AI > MCP Servers**
- Edit your .cursor/mcp.json file:
3. Restart Cursor to apply the changes
Alternative: Command Mode
Alternatively, you can configure Cursor to use the command mode, although URL mode is more reliable:
1. Open Cursor and go to **Settings**
2. Navigate to **AI > MCP Servers**
3. Click **Add MCP Server**
4. Enter the following details:
- **Name**: GitHub Enterprise
- **Command**: npx
- **Arguments**: @ddukbg/github-enterprise-mcp
- **Environment Variables**:
- GITHUB_ENTERPRISE_URL: Your GitHub Enterprise API URL
- GITHUB_TOKEN: Your GitHub personal access token
Alternatively, you can manually edit your .cursor/mcp.json file to include: