logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

github-enterprice-mcp

Interact with GitHub repositories, manage file operations, automate branch creation, and perform advanced searches on code and issues.

Author

github-enterprice-mcp logo

piyushgIITian

MIT License

Quick Info

GitHub GitHub Stars 2
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

githubrepositoriespiyushgiitianpiyushgiitian githubgithub enterpricetools piyushgiitian

GitHub Enterprise MCP Server

MCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.

Features

  • Automatic Branch Creation: When creating/updating files or pushing changes, branches are automatically created if they don't exist
  • 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

  1. Node.js installed on your system
  2. A GitHub Personal Access Token with appropriate permissions
  3. 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.

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 have access to (Public, All, or Select)
  4. Create a token with the repo scope ("Full control of private repositories")
  5. Alternatively, if working only with public repositories, select only the public_repo scope
  6. 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:
  3. Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
  4. macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  5. Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

  6. 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": []
    }
  }
}

Replace /absolute/path/to/github-enterprise-mcp/dist/index.js with the absolute path to the built index.js file.

For Claude Desktop App
  1. Locate the Claude Desktop configuration file at:
  2. Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  4. Linux: ~/.config/Claude/claude_desktop_config.json

  5. 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:

  1. Check that the path to the index.js file is correct in your MCP settings
  2. Verify that your GitHub Personal Access Token has the necessary permissions
  3. Ensure that the GitHub API URL is correct for your GitHub instance
  4. 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:

"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 that use different authentication methods, you may need to provide additional configuration. Refer to the Octokit documentation for more information.

Tools

  1. create_or_update_file
  2. Create or update a single file in a repository
  3. 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)
  4. Returns: File content and commit details

  5. push_files

  6. Push multiple files in a single commit
  7. 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
  8. Returns: Updated branch reference

  9. search_repositories

  10. Search for GitHub repositories
  11. Inputs:
    • query (string): Search query
    • page (optional number): Page number for pagination
    • perPage (optional number): Results per page (max 100)
  12. Returns: Repository search results

  13. create_repository

  14. Create a new GitHub repository
  15. Inputs:
    • name (string): Repository name
    • description (optional string): Repository description
    • private (optional boolean): Whether repo should be private
    • autoInit (optional boolean): Initialize with README
  16. Returns: Created repository details

  17. get_file_contents

  18. Get contents of a file or directory
  19. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • path (string): Path to file/directory
    • branch (optional string): Branch to get contents from
  20. Returns: File/directory contents

  21. create_issue

  22. Create a new issue
  23. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • title (string): Issue title
    • body (optional string): Issue description
    • assignees (optional string[]): Usernames to assign
    • labels (optional string[]): Labels to add
    • milestone (optional number): Milestone number
  24. Returns: Created issue details

  25. create_pull_request

  26. Create a new pull request
  27. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • title (string): PR title
    • body (optional string): PR description
    • head (string): Branch containing changes
    • base (string): Branch to merge into
    • draft (optional boolean): Create as draft PR
    • maintainer_can_modify (optional boolean): Allow maintainer edits
  28. Returns: Created pull request details

  29. fork_repository

  30. Fork a repository
  31. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • organization (optional string): Organization to fork to
  32. Returns: Forked repository details

  33. create_branch

  34. Create a new branch
  35. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • branch (string): Name for new branch
    • from_branch (optional string): Source branch (defaults to repo default)
  36. Returns: Created branch reference

  37. list_issues

    • List and filter repository issues
    • Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • state (optional string): Filter by state ('open', 'closed', 'all')
    • labels (optional string[]): Filter by labels
    • sort (optional string): Sort by ('created', 'updated', 'comments')
    • direction (optional string): Sort direction ('asc', 'desc')
    • since (optional string): Filter by date (ISO 8601 timestamp)
    • page (optional number): Page number
    • per_page (optional number): Results per page
    • Returns: Array of issue details
  38. update_issue

    • Update an existing issue
    • Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • issue_number (number): Issue number to update
    • title (optional string): New title
    • body (optional string): New description
    • state (optional string): New state ('open' or 'closed')
    • labels (optional string[]): New labels
    • assignees (optional string[]): New assignees
    • milestone (optional number): New milestone number
    • Returns: Updated issue details
  39. add_issue_comment

    • Add a comment to an issue
    • Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • issue_number (number): Issue number to comment on
    • body (string): Comment text
    • Returns: Created comment details
  40. search_code

    • Search for code across GitHub repositories
    • Inputs:
    • q (string): Search query using GitHub code search syntax
    • sort (optional string): Sort field ('indexed' only)
    • order (optional string): Sort order ('asc' or 'desc')
    • per_page (optional number): Results per page (max 100)
    • page (optional number): Page number
    • Returns: Code search results with repository context
  41. search_issues

    • Search for issues and pull requests
    • Inputs:
    • q (string): Search query using GitHub issues search syntax
    • sort (optional string): Sort field (comments, reactions, created, etc.)
    • order (optional string): Sort order ('asc' or 'desc')
    • per_page (optional number): Results per page (max 100)
    • page (optional number): Page number
    • Returns: Issue and pull request search results
  42. search_users

    • Search for GitHub users
    • Inputs:
    • q (string): Search query using GitHub users search syntax
    • sort (optional string): Sort field (followers, repositories, joined)
    • order (optional string): Sort order ('asc' or 'desc')
    • per_page (optional number): Results per page (max 100)
    • page (optional number): Page number
    • Returns: User search results
  43. list_commits

  44. Gets commits of a branch in a repository
  45. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • page (optional string): page number
    • per_page (optional string): number of record per page
    • sha (optional string): branch name
  46. Returns: List of commits

  47. get_issue

  48. Gets the contents of an issue within a repository
  49. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • issue_number (number): Issue number to retrieve
  50. Returns: Github Issue object & details

  51. get_pull_request

  52. Get details of a specific pull request
  53. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • pull_number (number): Pull request number
  54. Returns: Pull request details including diff and review status

  55. list_pull_requests

  56. List and filter repository pull requests
  57. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • state (optional string): Filter by state ('open', 'closed', 'all')
    • head (optional string): Filter by head user/org and branch
    • base (optional string): Filter by base branch
    • sort (optional string): Sort by ('created', 'updated', 'popularity', 'long-running')
    • direction (optional string): Sort direction ('asc', 'desc')
    • per_page (optional number): Results per page (max 100)
    • page (optional number): Page number
  58. Returns: Array of pull request details

  59. create_pull_request_review

  60. Create a review on a pull request
  61. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • pull_number (number): Pull request number
    • body (string): Review comment text
    • event (string): Review action ('APPROVE', 'REQUEST_CHANGES', 'COMMENT')
    • commit_id (optional string): SHA of commit to review
    • comments (optional array): Line-specific comments, each with:
    • path (string): File path
    • position (number): Line position in diff
    • body (string): Comment text
  62. Returns: Created review details

  63. merge_pull_request

  64. Merge a pull request
  65. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • pull_number (number): Pull request number
    • commit_title (optional string): Title for merge commit
    • commit_message (optional string): Extra detail for merge commit
    • merge_method (optional string): Merge method ('merge', 'squash', 'rebase')
  66. Returns: Merge result details

  67. get_pull_request_files

  68. Get the list of files changed in a pull request
  69. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • pull_number (number): Pull request number
  70. Returns: Array of changed files with patch and status details

  71. get_pull_request_status

  72. Get the combined status of all status checks for a pull request
  73. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • pull_number (number): Pull request number
  74. Returns: Combined status check results and individual check details

  75. update_pull_request_branch

  76. Update a pull request branch with the latest changes from the base branch (equivalent to GitHub's "Update branch" button)
  77. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • pull_number (number): Pull request number
    • expected_head_sha (optional string): The expected SHA of the pull request's HEAD ref
  78. Returns: Success message when branch is updated

  79. get_pull_request_comments

  80. Get the review comments on a pull request
  81. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • pull_number (number): Pull request number
  82. Returns: Array of pull request review comments with details like the comment text, author, and location in the diff

  83. get_pull_request_reviews

  84. Get the reviews on a pull request
  85. Inputs:
    • owner (string): Repository owner
    • repo (string): Repository name
    • pull_number (number): Pull request number
  86. Returns: Array of pull request reviews with details like the review state (APPROVED, CHANGES_REQUESTED, etc.), reviewer, and review body

Search Query Syntax

  • language:javascript: Search by programming language
  • repo:owner/name: Search in specific repository
  • path:app/src: Search in specific path
  • extension:js: Search by file extension
  • Example: q: "import express" language:typescript path:src/
  • is:issue or is:pr: Filter by type
  • is:open or is:closed: Filter by state
  • label:bug: Search by label
  • author:username: Search by author
  • Example: q: "memory leak" is:issue is:open label:bug
  • type:user or type:org: Filter by account type
  • followers:>1000: Filter by followers
  • location:London: Search by location
  • Example: q: "fullstack developer" location:London followers:>100

For detailed search syntax, see GitHub's searching documentation.

Setup

Personal Access Token

Create a GitHub Personal Access Token with appropriate permissions: - Go to Personal access tokens (in GitHub Settings > Developer settings) - Select which repositories you'd like this token to have access to (Public, All, or Select) - Create a token with the repo scope ("Full control of private repositories") - Alternatively, if working only with public repositories, select only the public_repo scope - Copy the generated token

Usage with Claude Desktop

To use this with Claude Desktop, add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "github": {
      "command": "node",
      "args": [
        "/path/to/github-enterprise-mcp/dist/index.js"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

Build

# 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.

See Also

`