About codeforces-mcp
codeforces-mcp is an MCP server for competitive programmers and AI coding assistants working with Codeforces. It retrieves problems and user statistics, supports local solution testing, and can use stress tests to isolate failing cases.
Key features
- 01Fetch user ratings, ranks, and verdicts
- 02Retrieve problem statements and sample tests
- 03Compile and run C++ or Python solutions locally
- 04Stress-test optimized code against brute force
- 05Reduce failing tests to minimal cases
- 06Queue and cache API requests
Use cases
- 01Review a Codeforces profile and recent results
- 02Retrieve a problem and its official samples
- 03Test a solution locally before submission
- 04Find a minimal failing case with stress testing
MCP support
Exposes Codeforces profile, problem, local execution, and stress-testing capabilities to MCP clients such as AI coding assistants.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMECodeforces MCP Server
A Model Context Protocol (MCP) server for Codeforces competitive programming. This server enables AI coding assistants (like Claude, Cursor, and Cline) to autonomously fetch problem statements, analyze your submission history, recommend upsolving targets, and run automated local stress tests.
Features
- Profile & Stats: Fetch live user ratings, ranks, and recent verdict breakdowns.
- Problem Scraping: Bypasses Cloudflare to extract full problem descriptions and exact sample test cases.
- Local Sandbox: Compiles and executes C++ or Python solutions locally against official sample inputs.
- Automated Stress Testing: Isolates minimal failing test cases by running your optimized code against a brute-force script and a random generator.
- Rate-Limit Safe: Built-in queuing and caching ensures you never hit the Codeforces API 1-request-per-2-seconds limit.
Installation & Usage
You can run this server seamlessly using uvx without manual installation. Add the following configuration to your preferred AI IDE.
Cursor
Add this to your MCP configuration (Settings > Features > MCP):
{
"mcpServers": {
"codeforces-mcp": {
"command": "uvx",
"args": ["codeforces-mcp"]
}
}
}
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.