Github-MCP-Server-Demo
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.
-
Install Python 3.x
-
Install Flask and requests: pip install flask requests
-
Create a GitHub Personal Access Token with repo scope
-
Create mcp server file. [mcp_github_server.py]
-
Set your GitHub token securely (in terminal): set GITHUB_TOKEN=ghp_YourTokenHere # on Windows
-
Run it: python mcp_github_server.py
-
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" } }