result = check_ci_status(
branch="feature-branch",
owner="your-username",
repo="your-repo"
)
创建PR
result = create_pr_with_content(
title="feat: add new feature",
problem="Current behavior lacks X functionality",
solution="Implement X using approach Y",
key_changes="- Added X component\n- Updated Y module",
issue=42, # Optional: links to issue #42
owner="your-username",
repo="your-repo"
)
发展
先决条件
Python>=3.10
uv(推荐)或pip
GitHub个人访问令牌
设置
git clone https://github.com/rriesco/github-mcp-server.git
cd github-mcp-server
uv sync
运行测试
# Unit tests only (fast)
uv run pytest -m "not integration" -v
# Integration tests (requires GITHUB_TOKEN, TEST_OWNER, TEST_REPO)
uv run pytest -m integration -v
# All tests with coverage
uv run pytest --cov=src --cov-report=term-missing
类型检查
uv run mypy src/github_mcp_server --strict
建筑
Claude Code / MCP Client
|
| MCP Protocol (stdio)
v
┌─────────────────────────────┐
│ Python FastMCP Server │
│ - Tool Registry │
│ - PyGithub Client │
│ - Error Handling │
│ - Type Validation │
└─────────────┬───────────────┘
|
| PyGithub REST API
v
GitHub API