Home / MCP / GitHub Enterprise MCP Server

GitHub Enterprise MCP Server

Provides programmatic access to GitHub operations via MCP, including file management, repository handling, search, and issues/pull requests actions.

javascript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "github_enterprise": {
            "command": "node",
            "args": [
                "/absolute/path/to/github-enterprise-mcp/dist/index.js"
            ],
            "env": {
                "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_TOKEN",
                "GITHUB_API_URL": "https://api.github.com",
                "GITHUB_API_VERSION": "2022-11-28"
            }
        }
    }
}

You can run the GitHub Enterprise MCP Server to interact with the GitHub API from your own tooling. It lets you perform repository operations, code search, issue management, pull requests, and more through a programmable MCP interface, while preserving Git history and enabling batch operations.

How to use

You will connect to the GitHub Enterprise MCP Server using an MCP client. The server exposes a set of tools that map to common GitHub API actions, such as creating or updating files, searching repositories, managing issues and pull requests, and retrieving file contents. Use these tools to automate workflows, run batch operations, and integrate GitHub actions into your own automation pipelines.

How to install

Prerequisites you need before installation are clear and straightforward.

1) Install Node.js on your system.

2) Install npm, which comes bundled with Node.js.

3) Ensure you have a GitHub Personal Access Token with appropriate permissions.

4) Install the MCP client you will use to communicate with the server. You will run the MCP server locally in a stdio configuration.

Step-by-step commands to set up and run the GitHub Enterprise MCP Server locally.

Additional configuration and startup

Configure the MCP server as a local stdio service. You run the server via Node and point to the built entry script. The following configuration demonstrates how to wire the server into your MCP client environment. It includes the required environment variables for authentication and API access.

{
  "mcpServers": {
    "github_enterprise": {
      "type": "stdio",
      "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"
        // For GitHub Enterprise, replace with your instance URL, e.g. "https://github.yourdomain.com/api/v3"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Verification

To verify the MCP server is installed and ready, ask your MCP client to perform a simple search or file operation using the GitHub Enterprise MCP server. For example, you can request a repository search with a keyword like the following through your MCP client: use the search_repositories tool with a query such as your keyword.

Examples of common tasks

Create a new file in a repository, push updates across multiple files in a single commit, search for code across repositories, or list issues and pull requests. The tools cover authentication, repository creation, file management, issue tracking, PR operations, and code search, enabling you to automate many GitHub workflows.

Security and best practices

Store your GitHub Personal Access Token securely and only grant the minimum permissions needed for your automation. Rotate tokens periodically and restrict access to the MCP server to trusted networks or environments.

Troubleshooting

If you encounter issues, verify the following: the path to the entry script is correct in your MCP client configuration, your GitHub token has the necessary permissions, and the API URL matches your GitHub instance. Check logs for error messages and ensure the MCP server is not disabled.

Notes

You can build and run the MCP server locally by installing dependencies, building the project, and starting the server as described in the steps above.

Available tools

create_or_update_file

Create or update a single file in a repository with a commit message and optional branch and SHA for updates.

push_files

Push multiple files in a single commit to a repository, specifying the target branch and commit message.

search_repositories

Search for repositories with a query and pagination options.

create_repository

Create a new repository with optional description, privacy setting, and initial content.

get_file_contents

Retrieve contents of a file or directory from a repository at a specific path and branch.

create_issue

Create a new issue with optional description, assignees, labels, and milestone.

create_pull_request

Create a new pull request with title, body, head and base branches, and optional flags.

fork_repository

Fork a repository to your account or organization.

create_branch

Create a new branch from a source branch in a repository.

list_issues

List and filter issues for a repository by state, labels, sort, and date.

update_issue

Update an existing issue with new title, body, state, labels, assignees, or milestone.

add_issue_comment

Add a comment to a specific issue in a repository.

search_code

Search code across repositories with a code query and optional sorting.

search_issues

Search issues and pull requests with query, sort, and pagination.

search_users

Search for users with a query and optional sorting and pagination.

list_commits

Get commits for a branch in a repository with pagination.

get_issue

Retrieve a specific issue by number.

get_pull_request

Retrieve details of a specific pull request including diff and reviews.

list_pull_requests

List and filter pull requests by state, head, base, sort, and pagination.

create_pull_request_review

Create a review on a pull request with optional line comments.

merge_pull_request

Merge a pull request using a selected method with optional commit details.

get_pull_request_files

Get the list of files changed in a pull request.

get_pull_request_status

Get the combined status checks for a pull request.

update_pull_request_branch

Update a pull request branch with the latest changes from the base branch.

get_pull_request_comments

Get review comments on a pull request.

get_pull_request_reviews

Get the reviews on a pull request.