Home / MCP / GitHub Enterprise MCP Server
Provides programmatic access to GitHub operations via MCP, including file management, repository handling, search, and issues/pull requests actions.
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.
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.
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.
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": []
}
}
}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.
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.
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.
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.
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.
Create or update a single file in a repository with a commit message and optional branch and SHA for updates.
Push multiple files in a single commit to a repository, specifying the target branch and commit message.
Search for repositories with a query and pagination options.
Create a new repository with optional description, privacy setting, and initial content.
Retrieve contents of a file or directory from a repository at a specific path and branch.
Create a new issue with optional description, assignees, labels, and milestone.
Create a new pull request with title, body, head and base branches, and optional flags.
Fork a repository to your account or organization.
Create a new branch from a source branch in a repository.
List and filter issues for a repository by state, labels, sort, and date.
Update an existing issue with new title, body, state, labels, assignees, or milestone.
Add a comment to a specific issue in a repository.
Search code across repositories with a code query and optional sorting.
Search issues and pull requests with query, sort, and pagination.
Search for users with a query and optional sorting and pagination.
Get commits for a branch in a repository with pagination.
Retrieve a specific issue by number.
Retrieve details of a specific pull request including diff and reviews.
List and filter pull requests by state, head, base, sort, and pagination.
Create a review on a pull request with optional line comments.
Merge a pull request using a selected method with optional commit details.
Get the list of files changed in a pull request.
Get the combined status checks for a pull request.
Update a pull request branch with the latest changes from the base branch.
Get review comments on a pull request.
Get the reviews on a pull request.