基于 Codeforces Polygon API 的 MCP 工具集
Project description
CF-Polygon-MCP
基于 Codeforces Polygon API 的 MCP 工具集,提供一系列工具函数用于管理 Polygon 平台上的题目。
功能特性
- 获取题目列表,支持多种筛选条件
- 创建新的空题目
- 获取题目详细信息(时限、内存限制等)
- 获取题目描述、题解、输入输出格式等
- 获取和保存题目陈述资源、源文件、辅助文件
- 获取和保存测试脚本、测试点、validator/checker 测试、测试组
- 获取题目解决方案
- 获取题目验证器、额外验证器、检查器、交互器,并支持设置验证器/检查器/交互器
- 获取和保存题目标签、通用描述、通用题解
- 获取历史包、下载包、构建包、提交工作副本
- 提供出题流程辅助工具,包括 readiness 检查、打包等待和发布编排
- 通过 Polygon 账号密码下载 problem package、problem.xml、contest.xml、statements.pdf
- 获取比赛题目列表
- 更新题目信息
- 更新/丢弃工作副本
- 更新题目描述
配置
向 mcp.json 中添加:
"cf-polygon-mcp": {
"command": "uvx",
"args": ["cf-polygon-mcp"],
"env": {
"POLYGON_API_KEY": "your_key",
"POLYGON_API_SECRET": "your_secret",
"POLYGON_LOGIN": "your_login",
"POLYGON_PASSWORD": "your_password"
}
}
在使用前,需要设置 Polygon API 密钥。可在 Polygon 设置页面 获取 API Key 和 Secret。
开发
- 确保你已经安装了 Python 3.11 及以上版本。
- 克隆项目:
git clone https://github.com/gsh20040816/cf-polygon-mcp.git
cd cf-polygon-mcp
- 安装依赖:
uv sync
- 运行项目:
uv run mcp dev main.py
- 运行测试:
python -m unittest discover -s tests -v
GitHub 自动发版
仓库包含 GitHub Actions 工作流 publish.yml。当代码 push 到 main 后,工作流会:
- 使用 Python 3.11 安装依赖与运行测试
- 运行
python -m unittest discover -s tests -v - 构建
sdist和wheel - 如果
pyproject.toml中的版本尚未发布到 PyPI,则自动发布
要让自动发布生效,需要先在 PyPI 的 Trusted Publisher 中添加这个 GitHub 仓库:
- Owner:
gsh20040816 - Repository name:
cf-polygon-mcp - Workflow name:
publish.yml - Environment name:
pypi
许可证
说明
本项目由 AI 生成。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cf_polygon_mcp-0.10.0.tar.gz.
File metadata
- Download URL: cf_polygon_mcp-0.10.0.tar.gz
- Upload date:
- Size: 70.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e90c56f2da05f0bfceb7b828c3169ebb4d7604f723723e43c3829fe5f0a97bb2
|
|
| MD5 |
b3f8c29869a4e019c2ef75acb6cd780c
|
|
| BLAKE2b-256 |
7d78e217705d702c36d77837d8282f18819e02a0aa75320f790736f040bb5f33
|
Provenance
The following attestation bundles were made for cf_polygon_mcp-0.10.0.tar.gz:
Publisher:
publish.yml on gsh20040816/cf-polygon-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cf_polygon_mcp-0.10.0.tar.gz -
Subject digest:
e90c56f2da05f0bfceb7b828c3169ebb4d7604f723723e43c3829fe5f0a97bb2 - Sigstore transparency entry: 1054694632
- Sigstore integration time:
-
Permalink:
gsh20040816/cf-polygon-mcp@16931e0dd6dc9774373761c26caa6ae7b7cc4989 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/gsh20040816
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16931e0dd6dc9774373761c26caa6ae7b7cc4989 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cf_polygon_mcp-0.10.0-py3-none-any.whl.
File metadata
- Download URL: cf_polygon_mcp-0.10.0-py3-none-any.whl
- Upload date:
- Size: 84.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29c9f9818213afe078c2432f60033b97e19b8e2c6f43ddf25242e7e5e5f42802
|
|
| MD5 |
cc65249fce84ae80ae5cee2eaccc80ef
|
|
| BLAKE2b-256 |
83573cb489be72036a57c87393884ff57ef8d9a4275f34271d81b2f5b073b72e
|
Provenance
The following attestation bundles were made for cf_polygon_mcp-0.10.0-py3-none-any.whl:
Publisher:
publish.yml on gsh20040816/cf-polygon-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cf_polygon_mcp-0.10.0-py3-none-any.whl -
Subject digest:
29c9f9818213afe078c2432f60033b97e19b8e2c6f43ddf25242e7e5e5f42802 - Sigstore transparency entry: 1054694729
- Sigstore integration time:
-
Permalink:
gsh20040816/cf-polygon-mcp@16931e0dd6dc9774373761c26caa6ae7b7cc4989 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/gsh20040816
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16931e0dd6dc9774373761c26caa6ae7b7cc4989 -
Trigger Event:
push
-
Statement type: