|
| 1 | +# Installing GitHub MCP Server in GitHub Copilot IDEs |
| 2 | + |
| 3 | +This guide covers installation for GitHub Copilot in JetBrains IDEs (IntelliJ IDEA, PyCharm, WebStorm, etc.), Visual Studio, Eclipse, and other supported development environments. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- **GitHub Copilot subscription** (Individual, Business, or Enterprise) |
| 8 | +- **MCP support enabled** in your IDE (check your IDE's latest version) |
| 9 | +- **GitHub Personal Access Token** (if not using OAuth) |
| 10 | + |
| 11 | +## Remote GitHub MCP Server (Recommended) |
| 12 | + |
| 13 | +The remote server is hosted by GitHub and provides the easiest setup experience with automatic updates. |
| 14 | + |
| 15 | +### Step 1: Check IDE Compatibility |
| 16 | + |
| 17 | +Ensure your IDE supports remote MCP servers: |
| 18 | +- **Visual Studio**: Version 17.14 or later |
| 19 | +- **JetBrains IDEs**: Latest versions with Copilot plugin |
| 20 | +- **Eclipse**: Latest version with GitHub Copilot extension |
| 21 | + |
| 22 | +### Step 2: Configure Remote Server |
| 23 | + |
| 24 | +Add the GitHub MCP Server to your IDE's MCP configuration. The exact location varies by IDE: |
| 25 | + |
| 26 | +**For IDEs supporting OAuth (recommended):** |
| 27 | +```json |
| 28 | +{ |
| 29 | + "mcpServers": { |
| 30 | + "github": { |
| 31 | + "url": "https://api.githubcopilot.com/mcp/" |
| 32 | + } |
| 33 | + } |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +**For IDEs requiring Personal Access Token:** |
| 38 | +```json |
| 39 | +{ |
| 40 | + "mcpServers": { |
| 41 | + "github": { |
| 42 | + "url": "https://api.githubcopilot.com/mcp/", |
| 43 | + "authorization_token": "Bearer <your GitHub PAT>" |
| 44 | + } |
| 45 | + } |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +### Step 3: IDE-Specific Configuration |
| 50 | + |
| 51 | +#### Visual Studio |
| 52 | +1. Open **Tools** → **Options** → **GitHub Copilot** → **MCP Servers** |
| 53 | +2. Click **Add Server** and paste the JSON configuration |
| 54 | +3. Restart Visual Studio |
| 55 | + |
| 56 | +#### JetBrains IDEs (IntelliJ, PyCharm, WebStorm, etc.) |
| 57 | +1. Go to **Settings** → **Tools** → **GitHub Copilot** → **MCP Integration** |
| 58 | +2. Add the server configuration |
| 59 | +3. Apply changes and restart the IDE |
| 60 | + |
| 61 | +#### Eclipse |
| 62 | +1. Navigate to **Window** → **Preferences** → **GitHub Copilot** → **Model Context Protocol** |
| 63 | +2. Add the remote server configuration |
| 64 | +3. Restart Eclipse |
| 65 | + |
| 66 | +> **Note:** Configuration paths may vary depending on your IDE version. Consult your IDE's documentation for the exact MCP configuration location. |
| 67 | +
|
| 68 | +## Local GitHub MCP Server (Alternative) |
| 69 | + |
| 70 | +If your IDE doesn't support remote MCP servers or you prefer local installation, use the Docker-based local server. |
| 71 | + |
| 72 | +### Prerequisites |
| 73 | +- **Docker** installed and running |
| 74 | +- **GitHub Personal Access Token** with appropriate permissions |
| 75 | + |
| 76 | +### Configuration |
| 77 | + |
| 78 | +Add this configuration to your IDE's MCP settings: |
| 79 | + |
| 80 | +```json |
| 81 | +{ |
| 82 | + "mcpServers": { |
| 83 | + "github": { |
| 84 | + "command": "docker", |
| 85 | + "args": [ |
| 86 | + "run", |
| 87 | + "-i", |
| 88 | + "--rm", |
| 89 | + "-e", |
| 90 | + "GITHUB_PERSONAL_ACCESS_TOKEN", |
| 91 | + "ghcr.io/github/github-mcp-server" |
| 92 | + ], |
| 93 | + "env": { |
| 94 | + "GITHUB_PERSONAL_ACCESS_TOKEN": "<your GitHub PAT>" |
| 95 | + } |
| 96 | + } |
| 97 | + } |
| 98 | +} |
| 99 | +``` |
| 100 | + |
| 101 | +## Creating a GitHub Personal Access Token |
| 102 | + |
| 103 | +If using PAT authentication: |
| 104 | + |
| 105 | +1. Go to [GitHub Settings → Personal Access Tokens](https://github.com/settings/personal-access-tokens/new) |
| 106 | +2. Click **Generate new token (classic)** |
| 107 | +3. Select appropriate scopes based on your needs: |
| 108 | + - `repo` - for repository access |
| 109 | + - `read:org` - for organization information |
| 110 | + - `workflow` - for GitHub Actions access |
| 111 | +4. Copy the generated token and use it in your configuration |
| 112 | + |
| 113 | +## Verification |
| 114 | + |
| 115 | +After configuration: |
| 116 | + |
| 117 | +1. Restart your IDE completely |
| 118 | +2. Open a project with GitHub repositories |
| 119 | +3. Try asking Copilot: "List the recent issues in this repository" |
| 120 | +4. Copilot should now be able to access GitHub data and perform repository operations |
| 121 | + |
| 122 | +## Troubleshooting |
| 123 | + |
| 124 | +### Common Issues |
| 125 | + |
| 126 | +**MCP server not connecting:** |
| 127 | +- Verify your IDE supports MCP integration |
| 128 | +- Check that Docker is running (for local server) |
| 129 | +- Ensure your GitHub PAT has the required permissions |
| 130 | + |
| 131 | +**Authentication errors:** |
| 132 | +- Verify your GitHub PAT is valid and has appropriate scopes |
| 133 | +- For OAuth, ensure you've completed the authentication flow |
| 134 | + |
| 135 | +**Tools not appearing:** |
| 136 | +- Restart your IDE after configuration changes |
| 137 | +- Check IDE logs for MCP-related error messages |
| 138 | + |
| 139 | +### Getting Help |
| 140 | + |
| 141 | +- Check your IDE's documentation for MCP configuration specifics |
| 142 | +- Review GitHub MCP Server logs for detailed error information |
| 143 | +- Ensure you're using compatible versions of your IDE and Copilot plugin |
| 144 | + |
| 145 | +## Next Steps |
| 146 | + |
| 147 | +Once installed, explore the available toolsets: |
| 148 | +- **Repository Management**: Browse code, analyze commits |
| 149 | +- **Issue & PR Operations**: Create and manage issues/pull requests |
| 150 | +- **CI/CD Integration**: Monitor GitHub Actions workflows |
| 151 | +- **Code Security**: Review security findings and alerts |
| 152 | + |
| 153 | +For advanced configuration options like toolsets and read-only mode, see the main [README documentation](../README.md). |
0 commit comments