Back to MCP directory
publicPublicdnsLocal runtime

mcp-python-test

一个基于Python Flask的GitHub仓库管理服务器,通过API接收命令创建GitHub仓库。

article

README

🚀 MCP GitHub 服务器项目

本项目可帮助你搭建一个 MCP 服务器,用于与 GitHub 交互,实现创建仓库等功能。

🚀 快速开始

📦 安装指南

  1. 安装 Python 3.x。
  2. 安装 Flask 和 requests 库,在命令行中执行以下命令:
pip install flask requests
  1. 创建一个 GitHub 个人访问令牌,并启用仓库权限。
  2. 创建 MCP 服务器文件 mcp_github_server.py
  3. 在终端中进行安全设置,设置你的 GitHub 令牌:
# 在 Windows 上
set GITHUB_TOKEN=ghp_YourTokenHere

💻 使用示例

启动服务器

在命令行中执行以下命令来启动 MCP 服务器:

python mcp_github_server.py

向 MCP 服务器发送 POST 请求

发送一个 POST 请求到 http://localhost:5001/command,请求的正文需要采用如下 JSON 格式:

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

通过以上步骤,你就可以使用 MCP 服务器与 GitHub 进行交互,创建私有仓库等操作。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client