GitHub Repository Integration MCP server

Integrates GitHub repositories with Cursor IDE, enabling direct access and interaction with GitHub content within the editor using only a Personal Access Token for authentication.
Back to servers
Setup instructions
Provider
juicetea
Release date
Mar 04, 2025
Language
TypeScript

This server enables Model Context Protocol (MCP) integration with Cursor IDE, allowing you to connect to GitHub's MCP server and utilize custom MCP commands and tools within your development environment.

Installation

To get started with the MCP Cursor Project, follow these steps:

  1. Install the required dependencies:
npm install
  1. Set up your GitHub Personal Access Token as an environment variable:
export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here
  1. Start the MCP server:
npm start

Configuration

Setting Up MCP Server

The MCP server is configured through the .cursor/mcp.json file in your project. This file tells Cursor IDE how to connect to the GitHub MCP server.

Here's the required configuration:

{
    "mcpServers": {
        "github": {
            "command": "npx",
            "args": [
                "-y",
                "cross-env",
                "GITHUB_PERSONAL_ACCESS_TOKEN=${your_token}",
                "npx",
                "-y",
                "@modelcontextprotocol/server-github"
            ]
        }
    }
}

Configuration Parameters

  • Replace ${your_token} with your actual GitHub Personal Access Token
  • The configuration uses cross-env to ensure environment variables work across different operating systems
  • The server runs using the @modelcontextprotocol/server-github package

Usage

Once you have the MCP server running, you can use it within Cursor IDE to:

  • Access GitHub repositories directly
  • Use custom MCP commands within your development workflow
  • Leverage Cursor IDE extensions that integrate with the MCP server

Working with GitHub Integration

The GitHub MCP server provides context from your repositories to enhance coding assistance. With a proper configuration, the server can:

  • Pull relevant code examples from your repositories
  • Provide context-aware suggestions
  • Access repository information for better code completion

Make sure your server is running (npm start) before attempting to use these features in Cursor IDE.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "github" '{"command":"npx","args":["-y","cross-env","GITHUB_PERSONAL_ACCESS_TOKEN=${your_token}","npx","-y","@modelcontextprotocol/server-github"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

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.

Adding an MCP server to Cursor globally

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": {
        "github": {
            "command": "npx",
            "args": [
                "-y",
                "cross-env",
                "GITHUB_PERSONAL_ACCESS_TOKEN=${your_token}",
                "npx",
                "-y",
                "@modelcontextprotocol/server-github"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "github": {
            "command": "npx",
            "args": [
                "-y",
                "cross-env",
                "GITHUB_PERSONAL_ACCESS_TOKEN=${your_token}",
                "npx",
                "-y",
                "@modelcontextprotocol/server-github"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later