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.
Before installing the GitHub Enterprise MCP server, ensure you have:
git clone https://github.com/yourusername/github-enterprise-mcp.git
cd github-enterprise-mcp
npm install
npm run build
This creates a dist
directory with the compiled JavaScript files.
repo
scope for full control of private repositories
public_repo
scopeOpen VS Code
Locate the Cline MCP settings file at:
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
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": []
}
}
}
Locate the Claude Desktop configuration file at:
%APPDATA%\Claude\claude_desktop_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
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": []
}
}
}
After configuring the MCP settings, restart Cline (VS Code or Claude Desktop) to apply the changes.
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".
The GitHub Enterprise MCP server provides numerous tools for interacting with GitHub:
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?
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?
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".
The search functionality supports GitHub's advanced search syntax:
Search for "useEffect" in TypeScript files in React repositories
Find open issues labeled "bug" that mention "crash" in username/project
Find the most popular JavaScript repositories created in the last month
If you encounter issues:
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"
}
For GitHub Enterprise instances with different authentication methods, check the Octokit documentation for additional configuration options.
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.
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"
]
}
}
}
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.
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.