GithubMCPDemo

mustafaalkan64/GithubMCPDemo

3.1

If you are the rightful owner of GithubMCPDemo and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Github MCP Demo is a sample implementation of a Model Context Protocol (MCP) server for GitHub, integrating with OpenAI to enable natural-language interactions with GitHub repositories.

Github MCP AI Integration and AI Agent

Github MCP Demo is a sample implementation of a Model Context Protocol (MCP) server for GitHub that integrates with OpenAI to enable natural-language interactions with GitHub repositories.
It demonstrates how to use MCP to bridge GitHub data (commits, pull requests, issues, repository content) with chat-based AI completion.


πŸš€ Features

  • MCP Server for GitHub β€” fetch repository data via MCP requests.
  • Chat Completion with OpenAI β€” query and interact with GitHub data conversationally.
  • Example Tools β€” list repositories, retrieve commits, read file contents, etc.
  • Configurable β€” easily point the MCP server to different GitHub repos and models.
  • Docker Support β€” run locally or in a container.

πŸ“‚ Project Structure

GithubMCPDemo/

β”œβ”€β”€ GithubMCPDemo.csproj # Project file

β”œβ”€β”€ Program.cs # Entry point

β”œβ”€β”€ Services/ # MCP server logic

β”œβ”€β”€ Models/ # Data models for GitHub responses

β”œβ”€β”€ Dockerfile # Docker build instructions

β”œβ”€β”€ README.md # This file


πŸ› οΈ Requirements

  • .NET 9 SDK
  • GitHub Personal Access Token
  • OpenAI API key

Demo

βš™οΈ Setup

1️⃣ Clone the Repository git clone https://github.com/mustafaalkan64/GithubMCPDemo.git cd GithubMCPDemo

2️⃣ Configure Environment Variables Create a .env file or export these variables: GITHUB_TOKEN=your_github_token OPENAI_API_KEY=your_openai_api_key

3️⃣ Run Locally dotnet restore dotnet run

4️⃣ Run with Docker docker build -t github-mcp-demo . docker run -e GITHUB_TOKEN=your_github_token
-e OPENAI_API_KEY=your_openai_api_key
-p 5000:5000 github-mcp-demo πŸ’¬ Example Chat Queries Once running, you can interact with the MCP server through your OpenAI client:

🧩 How It Works MCP Server handles requests to GitHub’s REST API.

OpenAI processes natural language queries and translates them into MCP commands.

Responses are fed back to the user with context-aware explanations or summaries.

πŸ“œ License This project is licensed under the MIT License.

🀝 Contributing Contributions, issues, and feature requests are welcome!