Codeforces MCP
Provides tools for interacting with Codeforces data, including user profiles and rating history, recent submissions and verdicts, problem search by tags/rating/name, upcoming and past contests, contest standings and submissions, rating changes, and logged-in account features such as friends, accessible contests, and gym standings.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Codeforces MCPGive me five DP problems rated around 1400 that I haven't tried."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Codeforces MCP
Connect your AI assistant to your Codeforces account, so you can plan and review your practice just by asking.
Works with Claude Code, Codex, Claude.ai and any app that supports MCP.
Why I built this
Practicing on Codeforces means a lot of tab-switching: finding problems at the right rating, checking which ones you've already solved, looking up upcoming contests, reviewing your verdicts and rating history. I wanted to just ask instead:
"Give me five DP problems rated around 1400 that I haven't tried."
"Which of my recent submissions failed, and on what?"
"When's the next Div. 2, and how did my last three contests go?"
This MCP server lets your AI assistant answer questions like these from live Codeforces data. It's built for practice β finding the right next problem and learning from your mistakes β not for solving problems for you, and never for rated contests.
What you can ask
Goal | Try asking |
π― Find your next problem | "Five DP problems rated 1400β1600, most solved first.""Recent greedy + math problems around 1200." |
π Learn from mistakes | "Which of my last 30 submissions failed, and on which test?""Which tags show up most in my wrong answers?" |
π Track your progress | "Summarize my rating over my last 10 contests.""What was my best contest ever?" |
ποΈ Plan contests | "What contests are coming up this week?""When's the next Div. 2?" |
π After a contest | "How much rating did I gain in the last round?""Show contest 2000's standings for me and my friends." |
π₯ Friends and gyms π | "Which of my friends are online right now?""List the private gyms I can access." |
π‘ Tip: tell your assistant your handle once β "My Codeforces handle is tourist" β so it knows who "my" is. (Codeforces doesn't share which account a key belongs to.)
Related MCP server: mcp-codeforces
Server address
https://codeforces-mcp.rajaa-ai.co.in/mcpContents: For users Β· For developers
For users
1. Get a Codeforces API key
Open codeforces.com/settings/api β Add API key. Keep the Key and Secret handy.
2. Add the server to your app
App | How |
Claude Code |
|
Codex CLI |
|
Claude.ai / Desktop | Settings β Connectors β Add custom connector β paste the address β Connect |
Cursor, VS Code, others | Add a remote (HTTP) MCP server with the address above |
For apps that use an mcpServers JSON file:
{ "mcpServers": { "codeforces": { "url": "https://codeforces-mcp.rajaa-ai.co.in/mcp" } } }3. Log in
A browser page opens. Enter your API key and secret β Connect account. Done.
π Only enter your key on that page β never paste it into a chat.
4. Ask away
Start with "My Codeforces handle is β¦", then try anything from What you can ask.
What it can do
Tool | What it does |
| Profiles, ratings and ranks |
| Rating history |
| Recent submissions and verdicts |
| Upcoming and past contests or gyms |
| Search problems by tags, rating and name |
| Contest standings |
| Submissions in a contest |
| Rating changes after a contest |
| Your friends |
| Contests you can access, including private gyms |
| Standings for your gyms and mashups |
π = uses your logged-in account. Everything else works for any public handle.
Good to know
Read-only β it can't submit solutions or change anything on your account.
Your key stays private β encrypted on the server, never sent to the AI.
Shared speed limit β about one Codeforces request every 2 seconds for everyone, so busy moments may say "try again shortly".
Not for rated contests β Codeforces rules ban AI help during rated rounds.
Troubleshooting
You see | Do this |
Could not verify your Codeforces credentials | Check the key and secret aren't swapped or missing characters |
Start the connection again | The page expired β reconnect from your app |
Too many requests / Codeforces is busy | Wait a minute and retry |
To disconnect: remove the server from your app, then delete the key at codeforces.com/settings/api.
For developers
How it works
AI app ββMCPβββΆ Cloudflare Worker ββsigned API callsβββΆ codeforces.com
β
ββ OAuth login page (asks for your API key + secret)
ββ KV: encrypted credentials and tokens
ββ Durable Object: one shared request queue (β1 call / 2.1 s)The AI app only ever receives an MCP access token. Your Codeforces key is encrypted at rest and used only by the server to sign requests.
Run locally (stdio)
Needs Node.js 22.15+.
git clone https://github.com/rajaaiitd/codeforces-mcp.git
cd codeforces-mcp && npm ci
npm run smoke # starts the server and lists its toolsPoint your app at it (see mcp-config.example.json):
{ "mcpServers": { "codeforces": { "command": "node", "args": ["/full/path/to/codeforces-mcp/src/index.js"] } } }Optional: set CODEFORCES_API_KEY and CODEFORCES_API_SECRET in the app's settings to unlock the π tools.
Deploy your own server
See DEPLOY.md β Cloudflare Workers, with automatic deploys on every push. Your own copy gets its own speed limit.
Commands
npm test # unit, OAuth and MCP tests
npm run smoke # stdio smoke check (add -- --live to call Codeforces)
npm run dev # Cloudflare Worker locally on :8787
npm run deploy # deploy to CloudflareProject layout
src/api.js Codeforces request signing, throttling, caching
src/tools.js Public tool schemas, filters, pagination
src/account-tools.js Logged-in tools
src/server.js MCP tool registration
src/index.js Local stdio entry point
src/cloudflare/ Worker, OAuth login page, Durable Object
test/ TestsReferences: Codeforces API Β· MCP TypeScript SDK
License
MIT. Independent project, not affiliated with Codeforces.
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analyβ¦
Connects AI assistants to TrackingTime for querying time entries, projects, tasks, customers, and team data using natural language.
Query your Twitch streams, events, supporters, raids & rankings from an AI assistant via OAuth.
Related MCP Servers
- AlicenseAqualityDmaintenanceA complete, all-in-one MCP server for Codeforces, enabling AI assistants to access user profiles, compare users, search problems, get practice recommendations, and more.83MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to access Codeforces public data (users, contests, problems, etc.) via natural language or direct tool calls through Pipeworx gateway.12 npmMIT
- FlicenseAqualityCmaintenanceEnables coding agents to discover unsolved Codeforces practice problems, analyze tag performance, and inspect submissions, profiles, rating history, and upcoming contests through MCP-compatible clients.6-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with GitHub data and Codeforces competitive programming analytics, including profiles, repositories, commits, PRs, issues, contest history, weak-topic analysis, and problem recommendations.MIT