|
1 | 1 | # Installing GitHub MCP Server in GitHub Copilot IDEs |
2 | 2 |
|
3 | | -This guide covers installation for GitHub Copilot in Visual Studio, JetBrains IDEs (IntelliJ IDEA, PyCharm, WebStorm, etc.), Eclipse, and other supported development environments. |
| 3 | +Quick setup guide for the GitHub Model Context Protocol (MCP) server across different IDEs with GitHub Copilot. For GitHub Copilot in VS Code, view the install instructions in the [README.md](/README.md) |
4 | 4 |
|
5 | | -## Prerequisites |
| 5 | +## Important Prerequisites |
6 | 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) |
| 7 | +- **Organization Policy**: To use GitHub Copilot with the Remote MCP Server, your organization must enable the Editor Preview Policy while MCP support remains in public preview |
| 8 | +- **Authentication Methods**: |
| 9 | + - VS Code supports both OAuth and PAT for remote servers |
| 10 | + - All other IDEs (Visual Studio, JetBrains, Xcode, Eclipse) currently support PAT-only for remote servers |
| 11 | + - All IDEs support local server installation with PAT authentication |
10 | 12 |
|
11 | | -## Remote GitHub MCP Server (Recommended) |
| 13 | +--- |
12 | 14 |
|
13 | | -The remote server is hosted by GitHub and provides the easiest setup experience with automatic updates. |
| 15 | +## Important Notes on GitHub MCP Server |
14 | 16 |
|
15 | | -### Step 1: Check IDE Compatibility |
| 17 | +- **Official Migration**: The GitHub MCP server has migrated to GitHub's official repository at [github/github-mcp-server](https://github.com/github/github-mcp-server) |
| 18 | +- **Docker Image**: The official Docker image is now `ghcr.io/github/github-mcp-server` |
| 19 | +- **npm Package**: The npm package `@modelcontextprotocol/server-github` is still maintained but includes a deprecation notice |
| 20 | +- **Remote Server**: The remote server URL remains `https://api.githubcopilot.com/mcp/` |
16 | 21 |
|
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 |
| 22 | +--- |
21 | 23 |
|
22 | | -### Step 2: Configure Remote Server |
| 24 | +## Visual Studio Setup |
23 | 25 |
|
24 | | -Add the GitHub MCP Server to your IDE's MCP configuration. The exact location varies by IDE: |
| 26 | +Requires Visual Studio 2022 version 17.14 or later. Visual Studio supports both remote and local GitHub MCP server configurations. |
25 | 27 |
|
26 | | -**OAuth flow for IDEs that support OAuth (recommended):** |
| 28 | +### Remote Server Configuration (PAT Only) |
| 29 | +Visual Studio currently supports PAT authentication only for remote MCP servers. |
| 30 | + |
| 31 | +1. Create an `.mcp.json` file in your solution directory |
| 32 | +2. Add this configuration: |
27 | 33 | ```json |
28 | 34 | { |
29 | | - "mcpServers": { |
| 35 | + "servers": { |
30 | 36 | "github": { |
31 | | - "url": "https://api.githubcopilot.com/mcp/" |
| 37 | + "type": "http", |
| 38 | + "url": "https://api.githubcopilot.com/mcp/", |
| 39 | + "headers": { |
| 40 | + "Authorization": "Bearer YOUR_GITHUB_PAT" |
| 41 | + } |
32 | 42 | } |
33 | 43 | } |
34 | 44 | } |
35 | 45 | ``` |
| 46 | +3. Save the file and restart Visual Studio |
| 47 | +4. Open Agent Mode in Copilot Chat to access MCP tools |
| 48 | + |
| 49 | +### Local Server Configuration |
| 50 | +Requires Docker installed and running. |
36 | 51 |
|
37 | | -**Using a Personal Access Token:** |
38 | 52 | ```json |
39 | 53 | { |
40 | | - "mcpServers": { |
| 54 | + "inputs": [ |
| 55 | + { |
| 56 | + "id": "github_pat", |
| 57 | + "description": "GitHub personal access token", |
| 58 | + "type": "promptString", |
| 59 | + "password": true |
| 60 | + } |
| 61 | + ], |
| 62 | + "servers": { |
41 | 63 | "github": { |
42 | | - "url": "https://api.githubcopilot.com/mcp/", |
43 | | - "authorization_token": "Bearer <your GitHub PAT>" |
| 64 | + "type": "stdio", |
| 65 | + "command": "docker", |
| 66 | + "args": [ |
| 67 | + "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", |
| 68 | + "ghcr.io/github/github-mcp-server" |
| 69 | + ], |
| 70 | + "env": { |
| 71 | + "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_pat}" |
| 72 | + } |
44 | 73 | } |
45 | 74 | } |
46 | 75 | } |
47 | 76 | ``` |
48 | 77 |
|
49 | | -### Step 3: IDE-Specific Configuration |
| 78 | +**Documentation:** [Visual Studio MCP Guide](https://learn.microsoft.com/en-us/visualstudio/ide/mcp-servers?view=vs-2022) |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +## JetBrains IDEs Setup |
| 83 | + |
| 84 | +Agent mode and MCP support available in public preview across IntelliJ IDEA, PyCharm, WebStorm, and other JetBrains IDEs. |
| 85 | + |
| 86 | +### Remote Server Configuration (PAT Only) |
| 87 | +1. Install/update the GitHub Copilot plugin |
| 88 | +2. Click **GitHub Copilot icon** → **Edit Settings** → **MCP Servers** → **Edit in mcp.json** |
| 89 | +3. Add configuration: |
| 90 | +```json |
| 91 | +{ |
| 92 | + "servers": { |
| 93 | + "github": { |
| 94 | + "url": "https://api.githubcopilot.com/mcp/", |
| 95 | + "requestInit": { |
| 96 | + "headers": { |
| 97 | + "Authorization": "Bearer YOUR_GITHUB_PAT" |
| 98 | + } |
| 99 | + } |
| 100 | + } |
| 101 | + } |
| 102 | +} |
| 103 | +``` |
| 104 | +4. Restart IDE and use Agent mode in Copilot Chat |
50 | 105 |
|
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 |
| 106 | +### Local Server Configuration |
55 | 107 |
|
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 |
| 108 | +#### Option 1: Using Docker (Recommended) |
| 109 | +Requires Docker installed and running. |
| 110 | +```json |
| 111 | +{ |
| 112 | + "servers": { |
| 113 | + "github": { |
| 114 | + "command": "docker", |
| 115 | + "args": [ |
| 116 | + "run", "-i", "--rm", |
| 117 | + "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", |
| 118 | + "ghcr.io/github/github-mcp-server" |
| 119 | + ], |
| 120 | + "env": { |
| 121 | + "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT" |
| 122 | + } |
| 123 | + } |
| 124 | + } |
| 125 | +} |
| 126 | +``` |
60 | 127 |
|
61 | | -#### Eclipse |
62 | | -1. Navigate to **Window** → **Preferences** → **GitHub Copilot** → **Model Context Protocol** |
63 | | -2. Add the remote server configuration |
64 | | -3. Restart Eclipse |
| 128 | +#### Option 2: Using npx |
| 129 | +Note: The npm package `@modelcontextprotocol/server-github` has moved to GitHub's official repository but is still functional. |
| 130 | +```json |
| 131 | +{ |
| 132 | + "servers": { |
| 133 | + "github": { |
| 134 | + "command": "npx", |
| 135 | + "args": ["-y", "@modelcontextprotocol/server-github"], |
| 136 | + "env": { |
| 137 | + "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT" |
| 138 | + } |
| 139 | + } |
| 140 | + } |
| 141 | +} |
| 142 | +``` |
65 | 143 |
|
66 | | -> **Note:** Configuration paths may vary depending on your IDE version. Consult your IDE's documentation for the exact MCP configuration location. |
| 144 | +**Documentation:** [Copilot Plugin for JetBrains IDEs](https://plugins.jetbrains.com/plugin/17718-github-copilot) |
67 | 145 |
|
68 | | -## Local GitHub MCP Server (Alternative) |
| 146 | +--- |
69 | 147 |
|
70 | | -If your IDE doesn't support remote MCP servers or you prefer local installation, use the Docker-based local server. |
| 148 | +## Xcode Setup |
71 | 149 |
|
72 | | -### Prerequisites |
73 | | -- **Docker** installed and running |
74 | | -- **GitHub Personal Access Token** with appropriate permissions |
| 150 | +Agent mode and MCP support now available in public preview for Xcode. |
75 | 151 |
|
76 | | -### Configuration |
| 152 | +### Remote Server Configuration (PAT Only) |
| 153 | +1. Install/update [GitHub Copilot for Xcode](https://github.com/github/CopilotForXcode) |
| 154 | +2. Open **GitHub Copilot for Xcode app** → **Agent Mode** → **🛠️ Tool Picker** → **Edit Config** |
| 155 | +3. Configure your MCP servers: |
| 156 | +```json |
| 157 | +{ |
| 158 | + "servers": { |
| 159 | + "github": { |
| 160 | + "url": "https://api.githubcopilot.com/mcp/", |
| 161 | + "requestInit": { |
| 162 | + "headers": { |
| 163 | + "Authorization": "Bearer YOUR_GITHUB_PAT" |
| 164 | + } |
| 165 | + } |
| 166 | + } |
| 167 | + } |
| 168 | +} |
| 169 | +``` |
77 | 170 |
|
78 | | -Add this configuration to your IDE's MCP settings: |
| 171 | +### Local Server Configuration |
79 | 172 |
|
| 173 | +#### Option 1: Using Docker (Recommended) |
| 174 | +Requires Docker installed and running. |
80 | 175 | ```json |
81 | 176 | { |
82 | | - "mcpServers": { |
| 177 | + "servers": { |
83 | 178 | "github": { |
84 | 179 | "command": "docker", |
85 | 180 | "args": [ |
86 | | - "run", |
87 | | - "-i", |
88 | | - "--rm", |
89 | | - "-e", |
90 | | - "GITHUB_PERSONAL_ACCESS_TOKEN", |
| 181 | + "run", "-i", "--rm", |
| 182 | + "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", |
91 | 183 | "ghcr.io/github/github-mcp-server" |
92 | 184 | ], |
93 | 185 | "env": { |
94 | | - "GITHUB_PERSONAL_ACCESS_TOKEN": "<your GitHub PAT>" |
| 186 | + "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT" |
| 187 | + } |
| 188 | + } |
| 189 | + } |
| 190 | +} |
| 191 | +``` |
| 192 | + |
| 193 | +#### Option 2: Using npx |
| 194 | +Note: The npm package `@modelcontextprotocol/server-github` has moved to GitHub's official repository but is still functional. |
| 195 | +```json |
| 196 | +{ |
| 197 | + "servers": { |
| 198 | + "github": { |
| 199 | + "command": "npx", |
| 200 | + "args": ["-y", "@modelcontextprotocol/server-github"], |
| 201 | + "env": { |
| 202 | + "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT" |
95 | 203 | } |
96 | 204 | } |
97 | 205 | } |
98 | 206 | } |
99 | 207 | ``` |
100 | 208 |
|
101 | | -## Creating a GitHub Personal Access Token |
| 209 | +**Documentation:** [Xcode Copilot Guide](https://devblogs.microsoft.com/xcode/github-copilot-exploring-agent-mode-and-mcp-support-in-public-preview-for-xcode/) |
102 | 210 |
|
103 | | -If using PAT authentication: |
| 211 | +--- |
104 | 212 |
|
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 |
| 213 | +## Eclipse Setup |
112 | 214 |
|
113 | | -## Verification |
| 215 | +MCP support available with Eclipse 2024-09+ and latest GitHub Copilot extension. |
114 | 216 |
|
115 | | -After configuration: |
| 217 | +### Remote Server Configuration (PAT Only) |
| 218 | +1. Install GitHub Copilot extension from Eclipse Marketplace |
| 219 | +2. Click **GitHub Copilot icon** → **Edit Preferences** → **MCP Servers** |
| 220 | +3. Add GitHub MCP server configuration: |
| 221 | +```json |
| 222 | +{ |
| 223 | + "servers": { |
| 224 | + "github": { |
| 225 | + "url": "https://api.githubcopilot.com/mcp/", |
| 226 | + "requestInit": { |
| 227 | + "headers": { |
| 228 | + "Authorization": "Bearer YOUR_GITHUB_PAT" |
| 229 | + } |
| 230 | + } |
| 231 | + } |
| 232 | + } |
| 233 | +} |
| 234 | +``` |
| 235 | +4. Restart Eclipse |
116 | 236 |
|
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 |
| 237 | +### Local Server Configuration |
| 238 | +Eclipse supports local MCP server installation using Docker or npx, following the same configuration patterns as shown in the JetBrains section above. |
121 | 239 |
|
122 | | -## Troubleshooting |
| 240 | +**Documentation:** [Eclipse Copilot Extension](https://marketplace.eclipse.org/content/github-copilot) |
| 241 | + |
| 242 | +--- |
| 243 | + |
| 244 | +## GitHub Personal Access Token |
123 | 245 |
|
124 | | -### Common Issues |
| 246 | +For PAT authentication, create a token with appropriate scopes: |
| 247 | +- `repo` - For repository access |
| 248 | +- `read:packages` - Required for local Docker-based installation |
| 249 | +- Additional scopes based on the tools you plan to use |
125 | 250 |
|
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 |
| 251 | +See our [Personal Access Token documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) for setup instructions. |
130 | 252 |
|
131 | | -**Authentication errors:** |
132 | | -- Verify your GitHub PAT is valid and has appropriate scopes |
133 | | -- For OAuth, ensure you've completed the authentication flow |
| 253 | +--- |
134 | 254 |
|
135 | | -**Tools not appearing:** |
136 | | -- Restart your IDE after configuration changes |
137 | | -- Check IDE logs for MCP-related error messages |
| 255 | +## Usage |
| 256 | + |
| 257 | +After setup: |
| 258 | +1. Restart your IDE completely |
| 259 | +2. Open Agent mode in Copilot Chat |
| 260 | +3. Click the tools icon to see available MCP tools |
| 261 | +4. Try: *"List recent issues in this repository"* |
| 262 | +5. Copilot can now access GitHub data and perform repository operations |
| 263 | + |
| 264 | +--- |
| 265 | + |
| 266 | +## Troubleshooting |
138 | 267 |
|
139 | | -### Getting Help |
| 268 | +- **Connection issues**: Verify GitHub PAT permissions and IDE version compatibility |
| 269 | +- **Authentication errors**: |
| 270 | + - Check if your organization has enabled the Editor Preview Policy |
| 271 | + - Ensure PAT has correct scopes |
| 272 | + - For Enterprise Managed Users with PAT restrictions, OAuth is not available |
| 273 | +- **Tools not appearing**: Restart IDE after configuration changes and check error logs |
| 274 | +- **Local server issues**: Ensure Docker is running (for Docker-based setups) or Node.js is installed (for npx-based setups) |
140 | 275 |
|
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 |
| 276 | +--- |
144 | 277 |
|
145 | | -## Next Steps |
| 278 | +## What's Next |
146 | 279 |
|
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 |
| 280 | +All IDEs now support the GitHub MCP server, with both remote and local installation options. While VS Code offers support for OAuth authentication, OAuth support is coming to all Copilot IDEs in the coming months. |
152 | 281 |
|
153 | | -For advanced configuration options like toolsets and read-only mode, see the main [README documentation](../README.md). |
| 282 | +**Advanced configuration:** See the [GitHub MCP Server repository](https://github.com/github/github-mcp-server) for toolsets, read-only mode, and additional options. |
0 commit comments