Supercharge your Cursor experience with GitHub integration through the Model Context Protocol
Access repository information, structure, and file content directly from Cursor
List, create, and manage GitHub issues without leaving your coding environment
Interact with GitHub projects to organize and track your development work
Choose between stdio (local) or SSE (networked) transport options for flexibility
Secure GitHub API integration with personal access tokens and proper permissions
Clean architecture makes it easy to extend with additional GitHub functionality
Clone the repository and install dependencies
Set up your GitHub token and repository details
Add MCP server configuration to Cursor
Use GitHub features directly from Cursor
git clone https://github.com/yourusername/github-mcp-server.git
cd github-mcp-server
npm install
# 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
# 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"
}
}
]
}
# For local development (stdio transport)
npm run start:stdio
# For networked access (SSE transport)
npm run start:sse
// Repository information will appear here
// File content will appear here
// Issues will appear here
// Projects will appear here
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.
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.
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.
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.
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.
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.