Load GitHub token from environment or set manually
LocalAbout Load GitHub token from environment or set manually
A custom Python MCP server example for creating GitHub repositories through a local HTTP endpoint. It is for developers who want to submit repository creation requests using a GitHub token supplied through an environment variable or other manual setup.
Key features
- 01GitHub token configuration
- 02Repository creation requests
- 03Local POST endpoint
Use cases
- 01Create a private GitHub repository
- 02Submit repository details to a local server
MCP support
The project is a custom MCP server that accepts a POST request at `/command` with a command name and input. The README shows a `create-repo` request.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project README-
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" } }
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.