The GitHub MCP Server implements the Model Context Protocol to interact with GitHub issues through Cline. It provides functionality to list and create GitHub issues with secure authentication and comprehensive error handling.
repo
scopeClone the repository:
git clone https://github.com/timbuchinger/mcp-github.git
cd mcp-github
Install dependencies with uv:
pip install uv
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt
Configure environment variables:
cp .env.template .env
Edit the .env
file and add your GitHub Personal Access Token:
GITHUB_TOKEN=your_token_here
To obtain a GitHub token:
repo
scope.env
fileRun the MCP server with the following command:
python -m src.mcp_github.server
The server will start and make two tools available to Cline:
The get_issues
tool retrieves a list of issues from a specified GitHub repository.
Input format:
{
"repo": "owner/repo"
}
Example usage:
To fetch issues from the repository octocat/Hello-World
, provide the following input to the tool:
{
"repo": "octocat/Hello-World"
}
The create_issue
tool allows you to create a new issue in a GitHub repository.
Input format:
{
"repo": "owner/repo",
"title": "Issue title",
"body": "Issue description"
}
Example usage:
To create a new issue in the repository octocat/Hello-World
:
{
"repo": "octocat/Hello-World",
"title": "Bug in login functionality",
"body": "The login button doesn't work when clicked multiple times in succession."
}
The server provides descriptive error messages for common issues:
owner/repo
If you encounter errors, check that:
.env
fileThere 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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.