π GitHub MCP Server - FastAPI Implementation
LocalAbout π GitHub MCP Server - FastAPI Implementation
A FastAPI-based MCP server for connecting AI assistants with GitHub. It supports repository and issue tasks, with optional issue summarization.
Key features
- 01Fetch user details and repositories
- 02Create and list repository issues
- 03Star repositories
- 04Optional AI issue summaries
- 05Asynchronous FastAPI API
Use cases
- 01Review a GitHub accountβs repositories
- 02Create issues and inspect existing ones
- 03Star a repository through an assistant
- 04Summarize repository issues
MCP support
Exposes GitHub account, repository, and issue operations to MCP clients through a FastAPI server.
Configuration
Local server config is the same for every client. Copy it into your clientβs MCP config file.
We havenβt collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEπ GitHub MCP Server - FastAPI Implementation
π Overview
This project implements a Model Context Protocol (MCP) server using FastAPI, enabling AI assistants like Claude to interact with GitHub. The server provides API endpoints to fetch user details, manage repositories, create issues, and automate GitHub workflows.
β¨ Features
- β Fetch GitHub user details and repositories
- β Create and manage issues in repositories
- β List all issues in a repository
- β Star a repository
- β AI-powered GitHub Issue Summarization (Optional)
- β Secure API with GitHub OAuth Token
- β Asynchronous FastAPI implementation
π οΈ Setup & Installation
1οΈβ£ Clone the Repository
git clone https://github.com/snehaapratap/mcp-server.git
cd mcp-server
2οΈβ£ Create & Activate a Virtual Environment
python3 -m venv venv
source venv/bin/activate
3οΈβ£ Install Dependencies
pip install -r requirements.txt
4οΈβ£ Set Up Environment Variables
Create a .env file in the root directory and add your GitHub Personal Access Token (PAT):
GITHUB_TOKEN=your_personal_access_token
5οΈβ£ Run the FastAPI Server
uvicorn server:app --reload
The server will start on http://127.0.0.1:8000.
π₯ API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Health check for MCP server |
| GET | /github/user | Fetch GitHub user details |
| GET | /github/repos | Get all repositories of the authenticated user |
| POST | /github/create-issue | Create an issue in a repository |
| GET | /github/list-issues | List all issues in a repository |
| PUT | /github/star-repo | Star a repository |
| POST | /github/summarize-issues | AI-powered issue summarization (Optional) |
β‘ Usage Examples (cURL)
πΉ Get User Details
curl -X GET "http://127.0.0.1:8000/github/user"
πΉ Fetch Repositories
curl -X GET "http://127.0.0.1:8000/github/repos"
πΉ Create an Issue
curl -X POST "http://127.0.0.1:8000/github/create-issue?owner=your-username&repo=your-repo&title=New%20Issue&body=This%20is%20a%20test%20issue"
πΉ Star a Repository
curl -X PUT "http://127.0.0.1:8000/github/star-repo?owner=your-username&repo=your-repo"
π₯ Slides
π View the Slides
π‘οΈ Error Handling
The API handles errors gracefully and returns meaningful messages:
{
"error": "Invalid GitHub Token",
"hint": "Ensure your token has the 'repo' scope."
}
π― Future Enhancements
- πΉ Support for pull requests management
- πΉ Implement WebSockets for real-time GitHub notifications
- πΉ Deploy on AWS/GCP with CI/CD pipeline
π‘ Contributing
Want to improve this project? Feel free to open a pull request or file an issue!
π¨βπ» Author
πΉ Sneha P Pratap
πΉ GitHub: @snehaapratap
πΉ LinkedIn: Sneha Prem Pratap
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.