Codeforces Tool is a command-line interface tool for Codeforces.
This is a fork of the original cf-tool with browser mode support to bypass Cloudflare protection.
Clone the repository and build with make (go >= 1.12):
# Clone the repository
git clone https://github.com/NetWilliam/cf-tool.git
cd cf-tool
# Build with make
make build
# (Optional) Install to ~/go/bin
make installThe compiled binary will be at ./bin/cf. You can move it to anywhere you like or add it to your PATH.
cf-tool uses Browser Mode to bypass Cloudflare protection on Codeforces. You need to install:
-
mcp-chrome - Chrome extension that exposes Chrome DevTools Protocol via MCP
-
mcp-chrome-bridge - Node.js bridge service
# Install mcp-chrome-bridge
npm install -g @hangwin/mcp-chrome-bridge
# Or using pnpm
pnpm add -g @hangwin/mcp-chrome-bridgeThen:
- Download mcp-chrome extension
- Extract to a folder
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the extension folder
- Run
mcp-chrome-bridgein a terminal (it runs onhttp://127.0.0.1:12306/mcp)
# Test MCP connection
cf mcp-ping
# Test browser automation
cf mockaImportant: Make sure both commands succeed before using cf-tool!
For more details about mcp-chrome, visit: https://github.com/hangwin/mcp-chrome/
This fork adds two new commands for browser mode testing:
Test the connection to MCP Chrome Server.
cf mcp-pingExpected output:
✅ MCP Chrome Server is running
Test browser automation capabilities. Opens Chrome, navigates to Google and searches for "billboard quarterly chart", then returns page content to verify browser automation is working correctly.
cf mockaThis command is used to verify that cf-tool can correctly control your browser.
The following commands have been tested and verified to work with browser mode:
-
cf parse- Fetch problem samples -
cf gen- Generate code from template -
cf test- Compile and test locally -
cf submit- Submit code to Codeforces -
cf open- Open problems in browser -
cf sid- Open submission page -
cf race- Contest countdown and parsing -
cf clone- Clone user submissions (partially working, behavior unclear)
For detailed usage of all cf-tool commands (parse, submit, race, etc.), please refer to the original repository.
All original commands are supported in this fork with browser mode enabled by default for network operations.
Yes. Due to Cloudflare protection on Codeforces, all network-dependent commands now require browser mode.
Run cf mcp-ping. If it shows "✅ MCP Chrome Server is running", browser mode is ready.
No. The old HTTP mode cannot bypass Cloudflare protection and is no longer supported.
MIT License - Same as the original cf-tool