Skip to content

Commit 5fba691

Browse files
committed
Adding separate installation guides, policies doc, and punching up the README intro
1 parent be91795 commit 5fba691

6 files changed

Lines changed: 676 additions & 33 deletions

File tree

README.md

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# GitHub MCP Server
22

3-
The GitHub MCP Server is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)
4-
server that provides seamless integration with GitHub APIs, enabling advanced
5-
automation and interaction capabilities for developers and tools.
3+
The GitHub MCP Server is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) server that connects AI tools directly to GitHub's platform. This gives AI agents, assistants, and chatbots the ability to read repositories and code files, manage issues and PRs, analyze code, and automate workflows—all through natural language interactions.
64

75
### Use Cases
86

9-
- Automating GitHub workflows and processes.
10-
- Extracting and analyzing data from GitHub repositories.
11-
- Building AI powered tools and applications that interact with GitHub's ecosystem.
7+
- Repository Management: Browse code, search files, analyze commits, and understand project structure across any repository you have access to.
8+
- Issue & PR Automation: Create, update, and manage issues and pull requests. Let AI help triage bugs, review code changes, and maintain project boards.
9+
- CI/CD & Workflow Intelligence: Monitor GitHub Actions workflow runs, analyze build failures, manage releases, and get insights into your development pipeline.
10+
- Code Analysis: Examine security findings, review Dependabot alerts, understand code patterns, and get comprehensive insights into your codebase.
11+
- Team Collaboration: Access discussions, manage notifications, analyze team activity, and streamline processes for your team.
12+
13+
Built for developers who want to connect their AI tools to GitHub context and capabilities, from simple natural language queries to complex multi-step agent workflows.
1214

1315
---
1416

@@ -120,6 +122,8 @@ For MCP Hosts that are [Remote MCP-compatible](docs/host-integration.md), choose
120122

121123
See [Remote Server Documentation](docs/remote-server.md) on how to pass additional configuration settings to the remote GitHub MCP Server.
122124

125+
> **For other host applications:** See our **[Installation Guides Index](installation-guides.md)** for detailed setup instructions for other MCP host apps like Claude Desktop, Cursor and Windsurf.
126+
123127
---
124128

125129
## Local GitHub MCP Server
@@ -133,15 +137,36 @@ See [Remote Server Documentation](docs/remote-server.md) on how to pass addition
133137
3. Lastly you will need to [Create a GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new).
134138
The MCP server can use many of the GitHub APIs, so enable the permissions that you feel comfortable granting your AI tools (to learn more about access tokens, please check out the [documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)).
135139

140+
<details><summary><b>Securely Storing Your GitHub PATs</b></summary>
141+
142+
To keep your GitHub PAT secure and reusable across different MCP hosts:
143+
144+
1. Save your GitHub PAT in a `.env` file
145+
```env
146+
GITHUB_PAT=your_token_here
147+
```
148+
2. Ensure `.env` is in your `.gitignore` file to prevent accidental commits.
149+
3. Source the environment variable
150+
```bash
151+
source .env
152+
```
153+
4. You can now reference the token using `$GITHUB_PAT` (or any variable name you choose) in CLI commands or config files.
154+
155+
> Note: the syntax and support for environment variables varies by host app and IDE. Make sure to refer to their documentation for guidance on the proper method for secure token storage and environment variables.
156+
157+
</details>
158+
136159
## Installation
137160

138-
### Usage with VS Code
161+
### Install in GitHub Copilot on VS Code
139162

140163
For quick installation, use one of the one-click install buttons. Once you complete that flow, toggle Agent mode (located by the Copilot Chat text input) and the server will start.
141164

142-
### Usage in other MCP Hosts
165+
More about using MCP server tools in VS Code's [agent mode documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers).
143166

144-
Add the following JSON block to your IDE MCP settings.
167+
<details><summary><b>Install in GitHub Copilot on other IDEs (JetBrains, Visual Studio, Eclipse, etc.)</b></summary>
168+
169+
Add the following JSON block to your IDE's MCP settings.
145170

146171
```json
147172
{
@@ -174,8 +199,11 @@ Add the following JSON block to your IDE MCP settings.
174199
}
175200
```
176201

177-
Optionally, you can add a similar example (i.e. without the mcp key) to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others.
202+
Optionally, you can add a similar example (i.e. without the mcp key) to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with other host applications that accept the same format.
178203

204+
<details>
205+
<summary><b>Example JSON block without the MCP key included<b></summary>
206+
<br>
179207

180208
```json
181209
{
@@ -204,33 +232,23 @@ Optionally, you can add a similar example (i.e. without the mcp key) to a file c
204232
}
205233
}
206234
}
207-
208235
```
209236

210-
More about using MCP server tools in VS Code's [agent mode documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers).
237+
</details>
211238

212-
### Usage with Claude Desktop
239+
</details>
213240

214-
```json
215-
{
216-
"mcpServers": {
217-
"github": {
218-
"command": "docker",
219-
"args": [
220-
"run",
221-
"-i",
222-
"--rm",
223-
"-e",
224-
"GITHUB_PERSONAL_ACCESS_TOKEN",
225-
"ghcr.io/github/github-mcp-server"
226-
],
227-
"env": {
228-
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
229-
}
230-
}
231-
}
232-
}
233-
```
241+
### Install in Other Host Applications
242+
243+
For other MCP host applications, please refer to our installation guides:
244+
245+
- **[Claude Code](install-claude.md)** - Installation guide for Claude Code and Claude Desktop
246+
- **[Cursor](install-cursor.md)** - Installation guide for Cursor IDE
247+
- **[Windsurf](install-windsurf.md)** - Installation guide for Windsurf IDE
248+
249+
For a complete overview of all installation options, see our **[Installation Guides Index](installation-guides.md)**.
250+
251+
> **Note:** Any host application that supports local MCP servers should be able to access the local GitHub MCP server. However, the specific configuration process, syntax and stability of the integration will vary by host application. While many may follow a similar format to the examples above, this is not guaranteed. Please refer to your host application's documentation for the correct MCP configuration syntax and setup process.
234252
235253
### Build from source
236254

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Install GitHub MCP Server in Claude Applications
2+
3+
This guide covers installation for both Claude Code CLI and Claude Desktop applications.
4+
5+
## Claude Code CLI
6+
7+
Claude Code CLI provides command-line access to Claude with MCP server integration.
8+
9+
### Prerequisites
10+
11+
1. Claude Code CLI installed
12+
2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new)
13+
14+
### Installation
15+
16+
Run the following command in the Claude Code CLI, referencing your GitHub PAT:
17+
18+
```bash
19+
claude mcp add-json github '{"command": "github-mcp-server", "args": ["stdio"], "env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_pat"}}'
20+
```
21+
22+
### Configuration Steps
23+
24+
1. Replace `your_github_pat` with your actual GitHub Personal Access Token
25+
2. Ensure you have the necessary permissions on your GitHub PAT for the operations you want to perform
26+
3. The command will add the GitHub MCP Server to your Claude Code configuration
27+
28+
### Troubleshooting Claude Code
29+
30+
- Verify the Claude Code CLI is properly installed and accessible
31+
- Check that your GitHub PAT is valid and has the required permissions
32+
- Ensure the command syntax is correct (note the single quotes around the JSON)
33+
- Review Claude Code documentation for any specific MCP server requirements
34+
35+
---
36+
37+
## Claude Desktop
38+
39+
Claude Desktop provides a user-friendly interface for interacting with the GitHub MCP Server.
40+
41+
### Prerequisites
42+
43+
1. Claude Desktop installed
44+
2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new)
45+
3. [Docker](https://www.docker.com/) installed and running
46+
47+
### Installation Steps
48+
49+
1. Follow the Claude Desktop [MCP install guide](https://modelcontextprotocol.io/quickstart/user)
50+
2. Add the following configuration to your Claude Desktop configuration file
51+
52+
### Configuration
53+
54+
Add the following JSON to your Claude Desktop configuration file, replacing `your_github_pat` with your actual GitHub Personal Access Token:
55+
56+
```json
57+
{
58+
"mcpServers": {
59+
"github": {
60+
"command": "docker",
61+
"args": [
62+
"run",
63+
"-i",
64+
"--rm",
65+
"-e",
66+
"GITHUB_PERSONAL_ACCESS_TOKEN",
67+
"ghcr.io/github/github-mcp-server"
68+
],
69+
"env": {
70+
"GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_pat"
71+
}
72+
}
73+
}
74+
}
75+
```
76+
77+
### Using Environment Variables
78+
79+
You can also use environment variables for better security. Replace `your_github_pat` with a variable reference like `$GITHUB_PAT`:
80+
81+
```json
82+
{
83+
"mcpServers": {
84+
"github": {
85+
"command": "docker",
86+
"args": [
87+
"run",
88+
"-i",
89+
"--rm",
90+
"-e",
91+
"GITHUB_PERSONAL_ACCESS_TOKEN",
92+
"ghcr.io/github/github-mcp-server"
93+
],
94+
"env": {
95+
"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_PAT"
96+
}
97+
}
98+
}
99+
}
100+
```
101+
102+
### Configuration File Location
103+
104+
The Claude Desktop configuration file is typically located at:
105+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
106+
- **Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
107+
- **Linux**: `~/.config/claude/claude_desktop_config.json`
108+
109+
### Troubleshooting Claude Desktop
110+
111+
- Verify Docker is running and accessible
112+
- Check that your GitHub PAT is valid and has the required permissions
113+
- Ensure the configuration file is valid JSON
114+
- Restart Claude Desktop after making configuration changes
115+
- Check Claude Desktop logs for any error messages
116+
117+
### Prerequisites
118+
119+
1. Claude Code CLI installed
120+
2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new)
121+
122+
### Installation
123+
124+
Run the following command in the Claude Code CLI, referencing your GitHub PAT:
125+
126+
```bash
127+
claude mcp add-json github '{"command": "github-mcp-server", "args": ["stdio"], "env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_pat"}}'
128+
```
129+
130+
### Configuration Steps
131+
132+
1. Replace `your_github_pat` with your actual GitHub Personal Access Token
133+
2. Ensure you have the necessary permissions on your GitHub PAT for the operations you want to perform
134+
3. The command will add the GitHub MCP Server to your Claude Code configuration
135+
136+
### Troubleshooting Claude Code
137+
138+
- Verify the Claude Code CLI is properly installed and accessible
139+
- Check that your GitHub PAT is valid and has the required permissions
140+
- Ensure the command syntax is correct (note the single quotes around the JSON)
141+
- Review Claude Code documentation for any specific MCP server requirements
142+
143+
---
144+
145+
## Security Best Practices
146+
147+
Regardless of which Claude application you're using, follow these security guidelines:
148+
149+
- **Keep your GitHub PAT secure** and never commit it to version control
150+
- **Limit the scope** of your GitHub PAT to only the permissions you need
151+
- **Consider using environment variables** for token storage when supported by your setup
152+
- **Regularly rotate** your GitHub Personal Access Tokens
153+
- **Ensure Docker environment is secure** (for Claude Desktop installations)
154+
155+
## Installation Methods
156+
157+
The GitHub MCP Server supports multiple installation approaches:
158+
159+
### Docker (Recommended for Claude Desktop)
160+
- **Pros**: No local build required, consistent environment, easy updates
161+
- **Cons**: Requires Docker installed and running
162+
- **Used by**: Claude Desktop configuration above
163+
164+
### Direct Binary (Used by Claude Code)
165+
- **Pros**: No Docker required, direct execution via stdio
166+
- **Cons**: Requires the `github-mcp-server` binary to be available in PATH
167+
- **Used by**: Claude Code CLI configuration above
168+
169+
### Build from Source (Alternative)
170+
- **Pros**: Latest features, customizable, no Docker dependency
171+
- **Cons**: Requires Go development environment
172+
- **Prerequisites**: [Go 1.24+](https://go.dev/doc/install)
173+
- **Build command**: `go build -o github-mcp-server cmd/github-mcp-server/main.go`
174+
175+
Choose the method that best fits your environment and requirements.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Install GitHub MCP Server in Cursor
2+
3+
## Prerequisites
4+
5+
1. Cursor IDE installed
6+
2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new)
7+
3. [Docker](https://www.docker.com/) installed and running
8+
9+
## Installation Steps
10+
11+
1. Go to `Cursor Settings``Tools & Integrations` → Click `Add Custom MCP` or `New MCP Server`
12+
2. Use the following `mcp.json` structure:
13+
14+
```json
15+
{
16+
"mcpServers": {
17+
"github": {
18+
"command": "docker",
19+
"args": [
20+
"run",
21+
"-i",
22+
"--rm",
23+
"-e",
24+
"GITHUB_PERSONAL_ACCESS_TOKEN",
25+
"ghcr.io/github/github-mcp-server"
26+
],
27+
"env": {
28+
"GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_pat"
29+
}
30+
}
31+
}
32+
}
33+
```
34+
35+
3. Replace `your_github_pat` with your actual GitHub PAT
36+
4. Restart Cursor for changes to apply
37+
38+
## Important Security Notes
39+
40+
⚠️ **Environment Variable Limitations**: Environment-variable interpolation (using a `$GITHUB_PAT` variable) is not supported in Cursor.
41+
42+
### Security Best Practices
43+
44+
- **File Permissions**: Lock down file permissions for the configuration file:
45+
```bash
46+
chmod 600 ~/.codeium/windsurf/mcp.json
47+
```
48+
- **Version Control**: Avoid committing configuration files with tokens to version control
49+
- **Token Scope**: Limit PAT scopes to necessary repositories and tools only
50+
- **Token Rotation**: Regularly rotate your GitHub Personal Access Tokens
51+
52+
## Configuration File Location
53+
54+
The MCP configuration is typically stored at:
55+
- `~/.codeium/windsurf/mcp.json`
56+
57+
## Troubleshooting
58+
59+
- Ensure Docker is running and accessible
60+
- Verify your GitHub PAT is valid and has required permissions
61+
- Check that the JSON configuration is valid
62+
- Restart Cursor after making configuration changes
63+
- Review Cursor logs for any MCP server startup errors
64+
- Ensure the GitHub MCP Server Docker image is accessible (`ghcr.io/github/github-mcp-server`)
65+
66+
## Alternative Setup
67+
68+
If you prefer to manually edit the configuration file, you can directly edit the `mcp.json` file at the location mentioned above with the same JSON structure.

0 commit comments

Comments
 (0)