mcpField
πŸš€
πŸš€ GitHub MCP Server - FastAPI Implementation

πŸš€ GitHub MCP Server - FastAPI Implementation

Local
github.com/snehaapratapDeveloper Tools1Updated 85w ago

About πŸš€ 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

  1. 01Fetch user details and repositories
  2. 02Create and list repository issues
  3. 03Star repositories
  4. 04Optional AI issue summaries
  5. 05Asynchronous FastAPI API

Use cases

  1. 01Review a GitHub account’s repositories
  2. 02Create issues and inspect existing ones
  3. 03Star a repository through an assistant
  4. 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.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

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

MethodEndpointDescription
GET/Health check for MCP server
GET/github/userFetch GitHub user details
GET/github/reposGet all repositories of the authenticated user
POST/github/create-issueCreate an issue in a repository
GET/github/list-issuesList all issues in a repository
PUT/github/star-repoStar a repository
POST/github/summarize-issuesAI-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

Markdown supported

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.