MCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.
Features
: When creating/updating files or pushing changes, branches are automatically created if they don't exist
MCP Server for the GitHub Enterprise APIs, enabling file operations, repository management, search functionality, and more.
星标
4
工具
—
可用率
—
Automatic Branch Creation
Comprehensive Error Handling: Clear error messages for common issues
Git History Preservation: Operations maintain proper Git history without force pushing
Batch Operations: Support for both single-file and multi-file operations
Advanced Search: Support for searching code, issues/PRs, and users
Cline Installation Guide
This guide will help you install and configure the GitHub Enterprise MCP server in Cline, enabling you to use GitHub API functionality directly through Cline.
Prerequisites
Node.js installed on your system
A GitHub Personal Access Token with appropriate permissions
Cline installed on your system
Installation Steps
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 will create a dist directory with the compiled JavaScript files.
Add the GitHub Enterprise MCP server configuration to the mcpServers object:
{
"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" // For GitHub.com
// For GitHub Enterprise, use your instance URL, e.g., "https://github.yourdomain.com/api/v3"
},
"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 and configured, you can ask Cline to use one of the GitHub tools:
Can you search for repositories with the keyword "react" using the GitHub Enterprise MCP server?
Cline should be able to use the search_repositories tool to search for repositories with the keyword "react".
Interactive Installation with Cline
For an interactive installation experience, copy and paste the following text into Cline, and it will guide you through the installation process:
I want you to help me install the GitHub Enterprise MCP server. Here's what I need you to do:
1. First, explain what the GitHub Enterprise MCP server is and what capabilities it will give you.
2. Guide me through the installation process:
- Help me clone the repository (if I haven't already)
- Help me install dependencies and build the project
- Guide me through creating a GitHub Personal Access Token if I don't have one
- Help me configure the MCP settings in either VS Code or Claude Desktop
- Verify the installation is working
3. Show me some examples of how I can use the GitHub Enterprise MCP server once it's installed.
Please start by explaining what the GitHub Enterprise MCP server is and what it will allow you to do for me.
Example Usage
After installation, you can ask Cline to perform GitHub operations directly, such as:
"Create a new repository called 'my-project'"
"Search for repositories related to machine learning"
"Create a pull request from my feature branch to main"
"Get the contents of the README.md file in repository X"
"List open issues in my repository"
Troubleshooting
If you encounter issues with the GitHub Enterprise MCP server:
Check that the path to the index.js file is correct in your MCP settings
Verify that your GitHub Personal Access Token has the necessary permissions
Ensure that the GitHub API URL is correct for your GitHub instance
Check the logs for any error messages
Additional Configuration Options
GitHub API Version
You can specify a GitHub API version by adding the GITHUB_API_VERSION environment variable:
For GitHub Enterprise instances that use different authentication methods, you may need to provide additional configuration. Refer to the Octokit documentation for more information.
Tools
create_or_update_file
Create or update a single file in a repository
Inputs:
owner (string): Repository owner (username or organization)
repo (string): Repository name
path (string): Path where to create/update the file
content (string): Content of the file
message (string): Commit message
branch (string): Branch to create/update the file in
sha (optional string): SHA of file being replaced (for updates)
Returns: File content and commit details
push_files
Push multiple files in a single commit
Inputs:
owner (string): Repository owner
repo (string): Repository name
branch (string): Branch to push to
files (array): Files to push, each with path and content
message (string): Commit message
Returns: Updated branch reference
search_repositories
Search for GitHub repositories
Inputs:
query (string): Search query
page (optional number): Page number for pagination
perPage (optional number): Results per page (max 100)
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
G
Github Enterprice
lessinthought·4 个星标·
MCP Server for the GitHub Enterprise APIs, enabling file operations, repository management, search functionality, and more.