Cover image
Try Now
2025-03-16

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

GitHub MCP Server Integration

This project demonstrates a Model Context Protocol (MCP) Server that integrates with the GitHub API. It allows AI Assistants like Claude or OpenAI GPT to interact with GitHub using MCP.


🌐 Live Demo

👉 Deployed Server Link
👉 .well-known/ai-plugin.json endpoint:

https://github-mcp-server-production.up.railway.app/.well-known/ai-plugin.json

📖 Project Overview

This MCP Server exposes a REST API that allows AI Assistants to:

  • Get user GitHub profile information
  • List repositories for a user
  • Create an issue in a repository

The server follows Model Context Protocol (MCP) standards to ensure interoperability with AI systems.


🔧 Tech Stack

  • FastAPI (Python framework for building APIs)
  • OpenAPI (Standard for describing REST APIs)
  • ai-plugin.json (MCP metadata configuration)
  • GitHub REST API v3
  • Deployed on Railway

✨ Features

  • MCP-compliant server with OpenAPI documentation
  • Secure interaction with GitHub using a personal access token
  • AI Assistants can:
    • Fetch GitHub user details
    • List repositories by username
    • Create issues on repositories

📂 Project Structure

├── ai-plugin.json             # MCP Plugin metadata for AI Assistants
├── openapi.yaml               # OpenAPI spec describing the available endpoints
├── main.py                    # FastAPI MCP server code
├── requirements.txt           # Python dependencies
└── README.md                  # Project documentation (this file)

🚀 How It Works

1. FastAPI Server

  • Exposes REST API endpoints like:
    • /github/user
    • /github/repos/{username}
    • /github/repos/{owner}/{repo}/issues

2. ai-plugin.json

  • Metadata for AI assistants to understand the MCP server:
    • Plugin name, description
    • Authentication method
    • OpenAPI URL reference

3. openapi.yaml

  • Defines all routes and parameters for the AI assistant to interact with.

🔐 Authentication

  • GitHub Personal Access Token (PAT)
    • Set as an environment variable: GITHUB_TOKEN
    • Use in your .env file or directly in Railway's environment settings.

⚙️ Setup Instructions (Local Development)

Prerequisites:

  • Python 3.9+
  • GitHub Personal Access Token (PAT) with repo permissions

Clone the repo:

git clone https://github.com/yourusername/github-mcp-server.git
cd github-mcp-server

Install dependencies:

pip install -r requirements.txt

Create .env file:

GITHUB_TOKEN=your_personal_access_token

Run the FastAPI server:

uvicorn main:app --reload

Visit: http://localhost:8000/docs for the Swagger UI


🌍 Deployment (Railway)

  1. Login at Railway
  2. Create a new project → Deploy from GitHub → Select your MCP repo
  3. Add the GITHUB_TOKEN as an environment variable in Railway
  4. Confirm the start command:
    uvicorn main:app --host 0.0.0.0 --port 8000
    
  5. Deploy & get your production URL (e.g., https://github-mcp-server-production.up.railway.app)

🤖 Demonstration with AI Assistants

Claude AI / OpenAI GPT Plugin (optional based on access)

  • Register your .well-known/ai-plugin.json URL in the AI assistant settings.
  • Interact using natural language prompts:
    "List my GitHub repositories."
    "Create an issue in my repo named 'sample-repo'."
    

📜 OpenAPI Endpoints

Endpoint Method Description
/github/user GET Get authenticated user info
/github/repos/{username} GET List repositories of a user
/github/repos/{owner}/{repo}/issues POST Create an issue in a repo

📝 Example Requests

Get user info

curl -X GET https://github-mcp-server-production.up.railway.app/github/user

List repos

curl -X GET https://github-mcp-server-production.up.railway.app/github/repos/<username>

Create an issue

curl -X POST https://github-mcp-server-production.up.railway.app/github/repos/<owner>/<repo>/issues \
  -H "Content-Type: application/json" \
  -d '{"title": "Bug found!", "body": "Please fix this bug."}'

相关推荐

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

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

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

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

  • Khalid kalib
  • Write professional emails

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

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

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

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • OffchainLabs
  • Aller la mise en œuvre de la preuve de la participation Ethereum

  • huahuayu
  • Une passerelle API unifiée pour intégrer plusieurs API d'explorateur de blockchain de type étherscan avec la prise en charge du protocole de contexte modèle (MCP) pour les assistants d'IA.

  • deemkeen
  • Contrôlez votre MBOT2 avec un combo d'alimentation: MQTT + MCP + LLM

    Reviews

    2 (1)
    Avatar
    user_5DPXomYJ
    2025-04-16

    As a loyal user of the GitHub-MCP-Server created by faheema15, I can confidently say it has revolutionized my workflow. The intuitive interface and robust functionality make it an essential tool for any project. Highly recommended for developers looking to streamline their development process! Check it out on GitHub.