The Model Context Protocol server enables direct interaction between Claude and your GitHub repositories, streamlining code management and development tasks. This guide shows you how to configure the MCP server for seamless integration with Claude Desktop on both Windows and Mac systems.
Required tools and accounts
Before starting the setup process, make sure you have:
- Node.js and npm installed on your computer
- Claude Desktop latest version
- Active GitHub account with proper access rights
Get your Github access token
The MCP server needs a Personal Access Token to interact with your repositories. Here’s how to create one:
- Access GitHub’s Personal access tokens page through your account settings
- Select “Generate new token” button
- Name your token “Claude MCP Access” or something similar
- Choose the appropriate access levels:
- For complete private repository access, enable “repo”
- For public repositories only, enable “public_repo”
- Click “Generate token” at the bottom
- Save your token securely for later use
Install MCP server components
Run this command in your terminal to install the GitHub MCP server globally:
npm install -g @modelcontextprotocol/server-github
Set up server configuration
Configure your token by setting an environment variable:
export GITHUB_PERSONAL_ACCESS_TOKEN="your_token_here"
Replace “your_token_here” with your actual GitHub token.
Configure Claude Desktop settings
- Find your configuration file location:
- Windows:
%APPDATA%/Claude/config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Add these settings to your config file:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
}
}
}
}
Make sure to insert your actual GitHub token in place of “your_token_here”.
Apply changes
- Close Claude Desktop completely
- Launch Claude Desktop again
Test the connection
- Start a new Claude conversation
- Ask Claude to list your repositories or create an issue
- Verify that Claude can perform GitHub operations successfully
The GitHub MCP server integration now enables Claude Desktop to access and manage your repositories directly through natural language commands.