GitHub登录自动化工具

一个基于MCP服务器和Playwright的GitHub登录自动化工具,支持环境变量配置和扩展其他GitHub工作流。

  • by Nikhil-Kandekar
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 Nikhil-Kandekar/mcp-server-demo

使用说明

MCP服务器演示-GitHub登录自动化

该项目展示了 MCP(模型上下文协议)服务器 与 剧作家 自动登录GitHub。

🚀 特性

  • GitHub登录自动化的MCP服务器实现
  • 基于Playwright的浏览器自动化
  • 凭据的环境变量支持
  • 易于扩展到其他GitHub工作流

📂 项目结构

mcp-server-demo/
│── server.py        # MCP server implementation
│── client.py        # Example MCP client to interact with server
│── requirements.txt # Dependencies
│── README.md        # Project documentation

🔧 安装

  1. 克隆存储库:

    git clone https://github.com/Nikhil-Kandekar/mcp-server-demo.git
    cd mcp-server-demo
    
  2. 创建虚拟环境(推荐):

    python3 -m venv .venv
    source .venv/bin/activate   # On Linux/Mac
    .venv\Scripts\activate    # On Windows
    
  3. 安装依赖项:

    pip install -r requirements.txt
    

⚙️ 环境变量

将您的GitHub凭据设置为环境变量:

export GITHUB_USERNAME="your-username"
export GITHUB_PASSWORD="your-password"

对于Windows PowerShell:

setx GITHUB_USERNAME "your-username"
setx GITHUB_PASSWORD "your-password"

▶️ 运行MCP服务器

使用以下命令启动MCP服务器:

python server.py

▶️ 运行客户端

运行示例客户端以触发GitHub登录自动化:

python client.py

🛠️ 开发说明

  • 如果在无头环境(例如服务器/CI)中运行,请设置 无头模式 在Playwright配置中。
  • 对于没有显示器的Linux服务器上的headed模式,请使用 xvfb-run:
    xvfb-run -a python client.py
    

📌 路线图

  • []扩展用于创建仓库的工具
  • []添加GitHub Actions工作流演示
  • []将服务器Docker化

🤝 贡献

欢迎拉取请求!对于重大更改,请先打开一个问题来讨论您想要更改的内容。

📜 许可证

该项目根据MIT许可证获得许可。


作者 尼希尔 坎迪卡尔