MCP cover image
See in Github
2025-03-15

1

Github Watches

0

Github Forks

1

Github Stars

🚀 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


相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • Entdecken Sie die umfassendste und aktuellste Sammlung von MCP-Servern auf dem Markt. Dieses Repository dient als zentraler Hub und bietet einen umfangreichen Katalog von Open-Source- und Proprietary MCP-Servern mit Funktionen, Dokumentationslinks und Mitwirkenden.

  • OffchainLabs
  • GO -Umsetzung des Ethereum -Beweises des Anteils

  • modelcontextprotocol
  • Modellkontext -Protokollserver

  • huahuayu
  • Ein einheitliches API-Gateway zur Integration mehrerer Ethercan-ähnlicher Blockchain-Explorer-APIs mit Modellkontextprotokoll (MCP) für AI-Assistenten.

  • Mintplex-Labs
  • Die All-in-One-Desktop & Docker-AI-Anwendung mit integriertem Lappen, AI-Agenten, No-Code-Agent Builder, MCP-Kompatibilität und vielem mehr.

    Reviews

    1 (1)
    Avatar
    user_RRsEsOxb
    2025-04-16

    I've been using the mcp-server by snehaapratap and it has been incredibly reliable and efficient. The seamless integration and robust performance make it a top choice for any server-based applications. The documentation is clear, and the community around it is very supportive. Highly recommend checking it out at https://github.com/snehaapratap/mcp-server!