Testing the GitHub MCP Server with Cursor
This document provides instructions for testing the GitHub MCP server with Cursor.
Prerequisites
Before testing, ensure you have:
- Installed the GitHub MCP server and its dependencies
- Set up your GitHub Personal Access Token with appropriate permissions
- Configured the
.env
file with your GitHub credentials
- Installed Cursor (latest version)
Testing with stdio Transport
Step 1: Configure Cursor
Create a .cursor/mcp.json
file in your project root:
{
"servers": [
{
"name": "github-mcp-server",
"command": "npm",
"args": ["run", "start:stdio"],
"cwd": "/absolute/path/to/github-mcp-server",
"env": {
"GITHUB_TOKEN": "your_github_personal_access_token",
"GITHUB_OWNER": "your_github_username",
"GITHUB_REPO": "your_repository_name"
}
}
]
}
Step 2: Start Cursor
Open your project in Cursor.
Step 3: Verify MCP Server Detection
Cursor should automatically detect and connect to the MCP server. You can verify this by:
- Opening the Cursor command palette (Cmd+Shift+P or Ctrl+Shift+P)
- Typing "MCP" and selecting "MCP: List Available Servers"
- Confirming that "github-mcp-server" appears in the list
Step 4: Test GitHub Functionality
Try using the following GitHub operations in Cursor:
- View Repository Structure:
- Open the command palette
- Type "GitHub" and select "GitHub: View Repository Structure"
- Enter the repository owner and name when prompted
- View File Content:
- Open the command palette
- Type "GitHub" and select "GitHub: View File Content"
- Enter the repository owner, name, and file path when prompted
- List Issues:
- Open the command palette
- Type "GitHub" and select "GitHub: List Issues"
- Enter the repository owner and name when prompted
Testing with SSE Transport
Step 1: Start the MCP Server with SSE Transport
cd github-mcp-server
npm run start:sse
This will start the server on http://localhost:3000/sse by default.
Step 2: Configure Cursor
Create a .cursor/mcp.json
file in your project root:
{
"servers": [
{
"name": "github-mcp-server",
"url": "http://localhost:3000/sse"
}
]
}
Step 3: Start Cursor and Test
Follow the same steps as for stdio transport to verify the MCP server is detected and to test GitHub functionality.
Troubleshooting
MCP Server Not Detected
If Cursor doesn't detect the MCP server:
- Verify the server is running
- Check the
.cursor/mcp.json
configuration
- Restart Cursor
- Check the Cursor logs for any error messages
GitHub API Errors
If you encounter GitHub API errors:
- Verify your GitHub token has the necessary permissions
- Check that the repository exists and is accessible
- Ensure you're not hitting GitHub API rate limits
Transport Issues
If you have issues with a specific transport:
- Try switching between stdio and SSE transports
- For SSE, ensure the port is not blocked by a firewall
- Check for any network connectivity issues
Next Steps
After successful testing, you can:
- Extend the MCP server with additional GitHub functionality
- Customize the implementation for your specific needs
- Deploy the SSE transport version for team use