mcp-server-codeforces
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| HOST | No | HTTP transport bind address. | 0.0.0.0 |
| PORT | No | HTTP transport bind port. | 8000 |
| CACHE_TTL | No | Cache lifetime in seconds. | 600 |
| MAX_RETRIES | No | Retry attempts for transient failures. | 3 |
| PROBLEMSET_TTL | No | Problemset cache lifetime in seconds. | 1800 |
| CODEFORCES_LANG | No | Language for names. | en |
| REQUEST_TIMEOUT | No | Per-request timeout in seconds. | 30 |
| MIN_REQUEST_INTERVAL | No | Seconds between upstream calls. | 1.1 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Codeforces MCP Server — read-only access to the official Codeforces API.
Capabilities: problemset search by id/title/tag/rating, problem metadata, practice-ladder filtering, user profiles and rating history, submission history, derived performance analytics, head-to-head comparison, the rated leaderboard, contest listings and standings, rating changes, and live platform activity.
This server never submits code, never executes code, and never accepts Codeforces credentials. Call get_capabilities to enumerate the supported surface and get_health to diagnose failures.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_problemsA | Search the official Codeforces problemset by problem id ('158A', '158/A'), title, tag ('dp', 'greedy', 'binary search') or rating ('1500', '1200-1600'). Multi-word queries must match every token, so 'dp 1500' returns 1500-rated dynamic programming problems. Prefer this over scraping codeforces.com. |
| get_problem_metadataA | Fetch official metadata for one problem by id ('158A', '158/A' or '158-A'): name, rating, tags, solved count and canonical URL. Note: the Codeforces API does not expose the full problem statement, so this returns metadata only. |
| list_problemsA | Browse the problemset with structured filters instead of a text query. Returns the most-solved problems matching ALL given tags within the rating range. Ideal for building practice ladders. |
| get_user_infoA | Fetch structured profile data for 1-10 Codeforces handles: rating, max rating, rank/tier, country, organization, contribution and registration date. |
| get_user_ratingB | Return a user's full contest rating history (newest first) with per-contest rating deltas, ranks, tier labels, best rating, biggest gain and biggest drop. Use for trend questions. |
| get_user_submissionsB | Return a user's recent submissions, compacted to verdict, problem, language, runtime and memory. Raw Codeforces submission objects are very large; this trims them for LLM context. |
| get_user_statsA | Compute derived analytics from a user's submission history: unique problems solved vs attempted, acceptance rate, verdict breakdown, favourite languages, strongest tags, solved-by-rating distribution and hardest solved problem. Answers 'how good is X' in one call. |
| compare_usersA | Fetch compact side-by-side profiles for 2-5 handles sorted by rating. Handy for 'who is stronger' or team-selection questions. |
| get_rated_usersA | Return the top rated Codeforces users, optionally only currently-active users or above a minimum rating. The upstream list has hundreds of thousands of entries, so results are always capped to protect context size. |
| get_contest_listA | List Codeforces contests with start time, duration, type and phase. Filter by phase (BEFORE = upcoming, CODING = running, FINISHED = past) or switch to the gym archive. |
| get_upcoming_contestsA | Return the next scheduled Codeforces contests, soonest first, including how many hours away each one starts. Use for 'when is the next contest' questions. |
| get_contest_standingsA | Fetch the standings table for a contest: contest metadata, the problem list, and a bounded window of ranked rows with points, penalty, hacks and per-problem results. Pass 'handles' to look up specific competitors instead of the top of the table. |
| get_contest_rating_changesA | Return the rating deltas applied after a rated contest: handle, rank, old rating, new rating and the computed change. Only available once the contest has been rated. |
| get_contest_statusA | Return submissions made in a specific contest, optionally narrowed to a single handle. Useful for reviewing what a competitor submitted and which verdicts they received. |
| get_recent_submissionsA | Return the most recent submissions across the whole Codeforces platform, compacted to verdict, problem, language and runtime. Useful for sampling live activity. |
| get_capabilitiesA | Report which Codeforces operations this server supports, which are degraded, and which are deliberately unsupported (this adapter is strictly read-only and never submits code or accepts credentials). Call this first to discover the safe surface area. |
| get_healthA | Probe the official Codeforces API and report transport, schema, auth and upstream health, plus the last observed error and request latency. Use this to diagnose failing tool calls. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 17 tools
Most tools target distinct resources and actions, and descriptions clarify the boundaries between users, problems, submissions, and contests. A few pairs still have some overlap, especially search_problems vs list_problems for problemset discovery and get_contest_list vs get_upcoming_contests for contest listing.
The set uses consistent snake_case with verb_noun naming such as get_user_info, get_user_rating, search_problems, and list_problems. There are minor deviations like get_contest_list instead of list_contests, and get_recent_submissions vs get_user_submissions, but the pattern remains readable and predictable.
At 17 tools, the surface is slightly above the typical 3-15 range, but the breadth is justified by covering problems, users, submissions, contests, and diagnostics. Each tool has a plausible role, though a couple of pairs could potentially be consolidated.
The read-only Codeforces domain is well covered across problem discovery, user analytics, submission history, contest listings, standings, and rating changes. Minor gaps remain, such as fetching a specific submission or full problem statement, with the latter explicitly limited by the upstream API.