FastMCP GitHub Automation Server

FastMCP GitHub Automation Server

Provides a comprehensive API wrapper for GitHub operations through a FastMCP-based server, simplifying repository management, pull requests, issues, and other GitHub interactions with secure authentication.

Category
访问服务器

README

GIT-Pilot

<div align="center"> <img src="images/logo.jpg" alt="GIT-Pilot Logo" width="200"/> </div>

Python Version License GitHub

GIT-Pilot is a powerful GitHub automation and management tool that provides a comprehensive API wrapper for GitHub operations. It simplifies GitHub interactions through a FastMCP-based server, making it easy to manage repositories, pull requests, issues, and more.

🌟 Features

🔐 Authentication & Security

  • Secure token management with encryption using Fernet
  • Token expiration and automatic cleanup
  • Rate limit handling and automatic retries
  • Configurable authentication timeouts

📦 Repository Management

  • Create and manage repositories
  • Handle branches and commits
  • File operations (create, update, delete)
  • Repository search and filtering
  • Commit comparison and history

🔄 Pull Request Operations

  • Create and manage pull requests
  • Merge strategies (merge, squash, rebase)
  • Status check validation
  • Conflict detection and handling
  • Draft PR support

📝 Issue Management

  • Create and update issues
  • Label management
  • Assignee handling
  • Comment management
  • Issue search and filtering

🛠 Technical Features

  • Thread-safe operations
  • Resource management
  • Comprehensive error handling
  • Detailed logging
  • Type safety
  • Configuration management
  • FastMCP server integration

🚀 Getting Started

Prerequisites

  • Python 3.12 or higher
  • GitHub account
  • GitHub Personal Access Token
  • FastMCP CLI (optional)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/GIT-Pilot.git
cd GIT-Pilot
  1. Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create and activate a virtual environment:
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install the package using uv:
uv pip install -e .
  1. Set up environment variables: Create a .env file in the project root:
GITHUB_TOKEN=your_github_token_here

API Examples

# Create a repository
await call_tool("create_repository",
    name="my-repo",
    description="My awesome repository",
    private=True,
    has_issues=True,
    has_wiki=True,
    has_projects=True,
    auto_init=True
)

# Create a pull request
await call_tool("create_pull_request",
    repo_path="owner/repo",
    title="New feature",
    head="feature-branch",
    base="main",
    body="Description of changes",
    draft=False
)

# List commits with filtering
await call_tool("list_commits",
    repo_path="owner/repo",
    branch="main",
    author="username",
    since="2024-01-01",
    until="2024-04-21",
    max_results=30
)

🔧 Configuration

The service can be configured through the Config class:

@dataclass
class Config:
    TOKEN_TTL_HOURS: int = 24
    MAX_STORED_TOKENS: int = 1000
    CLEANUP_INTERVAL_SECONDS: int = 3600
    MAX_RETRIES: int = 3
    RETRY_DELAY_SECONDS: int = 5
    MAX_RESULTS_PER_PAGE: int = 100
    ENCRYPTION_KEY: bytes = Fernet.generate_key()

🛡 Security

  • Tokens are encrypted at rest using Fernet
  • Automatic token expiration and cleanup
  • Rate limit protection with retries
  • Input validation
  • Comprehensive error handling
  • Secure token cleanup

🔄 Rate Limiting

The service includes built-in rate limit handling:

  • Automatic retry on rate limit
  • Configurable retry attempts
  • Delay between retries
  • Rate limit status logging
  • Exponential backoff

🧪 Error Handling

Comprehensive error handling for:

  • Authentication failures
  • API errors
  • Rate limits
  • Invalid inputs
  • Resource conflicts
  • Network issues
  • Token validation
  • File operations

📈 Logging

Detailed logging with:

  • Timestamp
  • Log level
  • Function name
  • Line number
  • Error details
  • Stack traces
  • Rate limit information
  • Token operations

🤝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

📝 License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

🙏 Acknowledgments

  • PyGithub for the GitHub API wrapper
  • FastMCP for the server framework
  • Fernet for secure token encryption

📞 Support

🔄 Updates

Stay updated with the latest changes:


Made with ❤️ by the GIT-Pilot team

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选