πŸš€ GitHub MCP Server - FastAPI Implementation

by snehaapratap

1 stars
186 downloads
Not rated
GitHub

Description

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

About

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

Details

Author
snehaapratap
GitHub stars
1
Downloads
186
Categories
Developer Tools

- 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

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name πŸš€ GitHub MCP Server - FastAPI Implementation
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, create a virtual environment, install dependencies, and set your GITHUB_TOKEN environment variable. Then run uvicorn server:app --reload to start the server on http://127.0.0.1:8000. Use the provided API endpoints via cURL or an AI assistant.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "\ud83d\ude80 github mcp server - fastapi implementation": {
            "mcp-server-snehaapratap": {
                "command": "python3",
                "args": [
                    "-m",
                    "venv",
                    "venv"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-server-snehaapratap": {
        "command": "python3",
        "args": [
            "-m",
            "venv",
            "venv"
        ]
    }
}

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

---

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.