Github-MCP-Server-Demo

Github-MCP-Server-Demo

2.2

This project sets up a Model Context Protocol (MCP) server that facilitates interaction with GitHub through a local server using Python and Flask. It enables performing GitHub operations like repository creation via structured POST requests.

  1. Install Python 3.x

  2. Install Flask and requests: pip install flask requests

  3. Create a GitHub Personal Access Token with repo scope

  4. Create mcp server file. [mcp_github_server.py]

  5. Set your GitHub token securely (in terminal): set GITHUB_TOKEN=ghp_YourTokenHere # on Windows

  6. Run it: python mcp_github_server.py

    image

  7. How to Send Post Request to Mcp Server,

    Send a POST request to http://localhost:5001/command with JSON like:

    BODY: { "name": "create-repo", "input": { "repo_name": "mcp-python-test", "private": true, "description": "Repository created via custom MCP Python server" } }

    image