This MCP server allows you to interact with GitHub's REST API using the Model Context Protocol framework. It provides functionalities to fetch user information, repository details, and authenticated user data through a structured command interface.
Clone the repository
git clone https://github.com/DivyanshKushwaha/GitHub-MCP-Server-Claude.git
cd GitHub-MCP-Server-Claude
Create a Python virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies
pip install -r requirements.txt
Set up environment variables
Create a .env
file in the project root directory with your GitHub token:
GITHUB_TOKEN=your_personal_access_token
To use this MCP server with the Claude Desktop application, you need to create a configuration file:
Create the Claude Desktop configuration file
Create a file named claude_desktop_config.json
in the following location:
C:\Users\your_username\AppData\Roaming\Claude\
Add the following configuration
{
"mcpServers": {
"MCP_Server": {
"command": "my_env/Scripts/uv",
"args": [
"run",
"D:/MCP_Project/main.py"
]
}
}
}
Note: Update the paths in this configuration to match your environment:
my_env/Scripts/uv
with the path to your Python environmentD:/MCP_Project/main.py
with the actual path to the main.py fileStart the Claude Desktop application
When you launch the Claude Desktop application, it will automatically use the MCP server as configured in your claude_desktop_config.json
file.
The MCP server provides various GitHub-related functionalities:
These commands will be available through the Claude interface once the server is properly configured and running.
You can ask Claude questions like:
The MCP server will process these requests through the GitHub API and return the relevant information.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "MCP_Server" '{"command":"my_env/Scripts/uv","args":["run","D:/MCP_Project/main.py"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"MCP_Server": {
"command": "my_env/Scripts/uv",
"args": [
"run",
"D:/MCP_Project/main.py"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"MCP_Server": {
"command": "my_env/Scripts/uv",
"args": [
"run",
"D:/MCP_Project/main.py"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect