GitHub MCP Server for Cursor

Supercharge your Cursor experience with GitHub integration through the Model Context Protocol

GitHub MCP Illustration

Features

Repository Management

Access repository information, structure, and file content directly from Cursor

Issue Tracking

List, create, and manage GitHub issues without leaving your coding environment

Project Management

Interact with GitHub projects to organize and track your development work

Dual Transport

Choose between stdio (local) or SSE (networked) transport options for flexibility

Secure Authentication

Secure GitHub API integration with personal access tokens and proper permissions

Extensible Design

Clean architecture makes it easy to extend with additional GitHub functionality

How It Works

1

Install MCP Server

Clone the repository and install dependencies

2

Configure GitHub

Set up your GitHub token and repository details

3

Configure Cursor

Add MCP server configuration to Cursor

4

Start Coding

Use GitHub features directly from Cursor

Installation

Clone and Install
git clone https://github.com/yourusername/github-mcp-server.git
cd github-mcp-server
npm install
Configure Environment
# Create a .env file with your GitHub credentials
GITHUB_TOKEN=your_github_personal_access_token
GITHUB_OWNER=default_repository_owner
GITHUB_REPO=default_repository_name
PORT=3000
HOST=0.0.0.0
NODE_ENV=development
DEFAULT_TRANSPORT=stdio
Configure Cursor
# Create .cursor/mcp.json in your project
{
  "servers": [
    {
      "name": "github-mcp-server",
      "command": "npm",
      "args": ["run", "start:stdio"],
      "cwd": "/path/to/github-mcp-server",
      "env": {
        "GITHUB_TOKEN": "your_github_personal_access_token",
        "GITHUB_OWNER": "your_github_username",
        "GITHUB_REPO": "your_repository_name"
      }
    }
  ]
}
Start the Server
# For local development (stdio transport)
npm run start:stdio

# For networked access (SSE transport)
npm run start:sse

Documentation

Interactive Demo

// Repository information will appear here
// File content will appear here
// Issues will appear here
// Projects will appear here

Frequently Asked Questions

What is MCP?

The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context and tools to LLMs. It acts as a layer between LLMs (like those in Cursor) and APIs (like GitHub), allowing Cursor to interact with GitHub without needing to know the entire GitHub API.

What GitHub permissions do I need?

Your GitHub Personal Access Token needs these permissions: repo (Full repository access), project (Project access), and write:org (Organization access). These permissions allow the MCP server to access repository information, manage issues, and work with projects.

Which transport option should I use?

Use stdio transport for local development (simpler setup) and SSE transport for networked access (more flexible, can be accessed remotely). For most individual users, stdio transport is recommended for its simplicity.

How do I extend the MCP server?

The MCP server follows a clean architecture approach, making it easy to extend. To add new GitHub functionality, implement the corresponding repository interface, update the service layer, and add a new tool definition in the main index.ts file.

Can I use this with other editors?

This MCP server is specifically designed for Cursor, but the Model Context Protocol is an open standard. With some modifications, you could adapt it to work with other editors that support the MCP protocol.

Is my GitHub token secure?

Your GitHub token is stored locally in your .env file and is not transmitted anywhere except to GitHub's API. The MCP server runs locally on your machine, ensuring your credentials remain secure. Always add .env to your .gitignore file to prevent accidental exposure.