GitHub Enterprise MCP server

Integrates with GitHub's API to enable natural language-driven repository management, code manipulation, and issue tracking for streamlined development workflows.
Back to servers
Provider
piyushgIITian
Release date
Mar 31, 2025
Language
TypeScript
Stats
3 stars

The GitHub Enterprise MCP Server is a powerful tool that enables file operations, repository management, search functionality, and more through the GitHub API. It works with Cline to give you direct access to GitHub functionality without leaving your development environment.

Installation

Prerequisites

Before installing the GitHub Enterprise MCP server, ensure you have:

  1. Node.js installed on your system
  2. A GitHub Personal Access Token with appropriate permissions
  3. Cline installed on your system

Step-by-Step Installation

1. Clone the Repository

git clone https://github.com/yourusername/github-enterprise-mcp.git
cd github-enterprise-mcp

2. Install Dependencies and Build

npm install
npm run build

This creates a dist directory with the compiled JavaScript files.

3. Create a GitHub Personal Access Token

  1. Go to GitHub Personal Access Tokens in GitHub Settings > Developer settings
  2. Click "Generate new token"
  3. Select which repositories you'd like this token to access (Public, All, or Select)
  4. Create a token with the repo scope for full control of private repositories
    • For public repositories only, select just the public_repo scope
  5. Copy the generated token

4. Configure Cline MCP Settings

For Cline VS Code Extension
  1. Open VS Code

  2. Locate the Cline MCP settings file at:

    • Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
    • macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
    • Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  3. Add the GitHub Enterprise MCP server configuration:

{
  "mcpServers": {
    "github-enterprise": {
      "command": "node",
      "args": [
        "/absolute/path/to/github-enterprise-mcp/dist/index.js"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-personal-access-token",
        "GITHUB_API_URL": "https://api.github.com"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}
For Claude Desktop App
  1. Locate the Claude Desktop configuration file at:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. Add the GitHub Enterprise MCP server configuration:

{
  "mcpServers": {
    "github-enterprise": {
      "command": "node",
      "args": [
        "/absolute/path/to/github-enterprise-mcp/dist/index.js"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-personal-access-token",
        "GITHUB_API_URL": "https://api.github.com"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

5. Restart Cline

After configuring the MCP settings, restart Cline (VS Code or Claude Desktop) to apply the changes.

Verification

To verify that the GitHub Enterprise MCP server is properly installed, ask Cline:

Can you search for repositories with the keyword "react" using the GitHub Enterprise MCP server?

Cline should use the search_repositories tool to search for repositories with the keyword "react".

Using the GitHub Enterprise MCP Server

Available Tools

The GitHub Enterprise MCP server provides numerous tools for interacting with GitHub:

Repository Management

  • Create a repository: Create new GitHub repositories
  • Fork a repository: Fork existing repositories
  • Create a branch: Create new branches in repositories

File Operations

  • Create or update files: Add or modify individual files
  • Push multiple files: Commit multiple file changes at once
  • Get file contents: Retrieve file or directory contents

Issues and Pull Requests

  • Create and manage issues: Create, list, and update issues
  • Create pull requests: Open PRs between branches
  • Review pull requests: Create reviews on PRs
  • Merge pull requests: Merge approved PRs
  • View PR details: Get files, comments, and status checks

Search Functionality

  • Search repositories: Find repositories matching specific criteria
  • Search code: Find code across GitHub repositories
  • Search issues/PRs: Locate issues and pull requests
  • Search users: Find GitHub users

Common Use Cases

Working with Files

To create or update a file:

Can you create a new file called README.md in my repository username/project with some basic documentation about the project?

To get file contents:

Can you show me the contents of the package.json file in the main branch of repository username/project?

Working with Repositories

To create a new repository:

Please create a new public repository called "my-awesome-project" with a basic README.

To search for repositories:

Can you find the top 5 most popular machine learning repositories on GitHub?

Working with Issues and PRs

To create an issue:

Create an issue in my repository username/project titled "Fix navigation bug" with a description of the problem.

To create a pull request:

Create a pull request from my feature-branch to main in username/project with the title "Add new login feature".

Search Query Syntax

The search functionality supports GitHub's advanced search syntax:

Code Search Examples

Search for "useEffect" in TypeScript files in React repositories

Issues Search Examples

Find open issues labeled "bug" that mention "crash" in username/project

Repository Search Examples

Find the most popular JavaScript repositories created in the last month

Troubleshooting

If you encounter issues:

  1. Check that the path to index.js is correct in your MCP settings
  2. Verify your GitHub Personal Access Token has necessary permissions
  3. Ensure the GitHub API URL is correct for your GitHub instance
  4. Look for error messages in the logs

Additional Configuration

GitHub API Version

You can specify a GitHub API version:

"env": {
  "GITHUB_PERSONAL_ACCESS_TOKEN": "your-personal-access-token",
  "GITHUB_API_URL": "https://api.github.com",
  "GITHUB_API_VERSION": "2022-11-28"
}

Enterprise Authentication

For GitHub Enterprise instances with different authentication methods, check the Octokit documentation for additional configuration options.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later