home / mcp / github mcp server
A FastAPI MCP server implementing the Model Context Protocol for GitHub interactions
Configuration
View docs{
"mcpServers": {
"ds231-mcp-server": {
"command": "uvicorn",
"args": [
"server:app",
"--reload",
"--port",
"8000"
],
"env": {
"GITHUB_TOKEN": "YOUR_TOKEN_HERE"
}
}
}
}You run a lightweight FastAPI MCP server that connects to GitHub using the Model Context Protocol. This server lets you retrieve repository details, list issues, create issues, and add comments, all from a local or remote MCP client. It’s useful for automating GitHub workflows and integrating GitHub data into your MCP tooling.
With a client that speaks MCP, you can perform common GitHub interactions through the server. You can fetch repository details to verify ownership and configuration, enumerate issues to surface open work items, create new issues when work needs to be tracked, and add comments to existing issues to capture updates. All actions are exposed via MCP endpoints that map to GitHub API interactions, allowing you to integrate GitHub data and actions into your automation flows.
Prerequisites: Python 3.9+ and a Unix-like shell (Linux/macOS) or PowerShell on Windows.
# 1) Clone the repository
# (Run this in your preferred directory)
git clone https://example.com/repo/ds231/mcp-server.git
cd mcp-server
# 2) Create a virtual environment
python -m venv venv
source venv/bin/activate
# 3) Install dependencies
pip install -r requirements.txt
# 4) Create a .env file with your GitHub Personal Access Token
# Replace YOUR_TOKEN_HERE with your actual token
GITHUB_TOKEN=YOUR_TOKEN_HEREConfiguration, security, and usage notes follow. Ensure your GitHub token is kept secret and never committed to version control. Only enable the server in trusted environments and restrict access to the port you run on.
Start the server once dependencies are installed and the token is set.
uvicorn server:app --reload --port 8000Fetches repository details for a given owner and repository, returning metadata such as description, default branch, and topics.
Retrieves a list of issues for the specified repository, including status, labels, and assignees.
Creates a new issue in the specified repository with a title and optional body and labels.
Adds a comment to a specified issue number within a repository.