一款高性能的MCP(模型上下文协议)服务器,用于GitHub星标仓库分析和时间线追踪。
git clone <repository-url>
cd github-stars-mcp-server
pip install -e .
export GITHUB_TOKEN="your_github_token_here"
export REDIS_URL="redis://localhost:6379/0" # 可选
python -m github_stars_mcp.server
get_user_starred_repositories(
username="", # 空字符串表示当前认证用户
limit=50, # 返回数量限制 (1-100)
cursor="" # 分页游标
)
get_repo_details(
repository_name="owner/repo" # 仓库名称格式: owner/repo
)
get_batch_repo_details(
repository_names=["owner/repo1", "owner/repo2"],
max_concurrent=1
0 # 最大并发请求数 (1-20)
)
create_starred_repo_analysis_bundle(
username="", # GitHub 用户名 (可选)
include_readme=True, # 是否包含 README 内容
max_repositories=100, # 最大分析仓库数 (1-200)
concurrent_requests=10 # 并发请求数 (1-20)
)
GITHUB_TOKEN: GitHub 个人访问令牌 (必需)REDIS_URL: Redis 连接URL (可选,默认: redis://localhost:6379/0 )LOG_LEVEL: 日志级别 (可选,默认: INFO)DANGEROUSLY_OMIT_AUTH: 跳过身份验证检查 (可选,默认: true)包含完整的星标仓库信息,包括:
综合分析报告,包括:
服务器包含全面的错误处理机制:
AuthenticationError: GitHub身份验证失败RateLimitError: API速率限制GitHubAPIError: GitHub API 错误CacheError: 缓存操作错误ConfigurationError: 配置错误pytest
ruff check src/
mypy src/
ruff format src/
MIT 许可证
欢迎提交Issue和Pull Requests!