Skip to content
Back to search

mcp-server-codechef

codechef-mcp (Unified Edition)

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/iamrudhresh--mcp-server-codechef/badge.svg)](/listings/iamrudhresh--mcp-server-codechef)

HTML

<a href="/listings/iamrudhresh--mcp-server-codechef"><img src="/api/listings/iamrudhresh--mcp-server-codechef/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

npm install
npm test
npm start

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 180 lines
  1. # codechef-mcp (Unified Edition)
  2. [![npm](https://img.shields.io/npm/v/codechef-mcp)](https://www.npmjs.com/package/codechef-mcp)
  3. [![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
  4. [![node](https://img.shields.io/badge/node-%3E%3D20-brightgreen)](package.json)
  5. [![python](https://img.shields.io/badge/python-%3E%3D3.10-blue)](requirements.txt)
  6. The unified, complete **Model Context Protocol (MCP)** server for CodeChef. It bridges AI assistants (such as Claude Desktop, Cursor, OpenCode, and Gemini) with CodeChef for both **User Profiling & Analytics** and **Contest Participation & Problem Solving**.
  7. Available in two seamless runtimes:
  8. * **Node.js (ESM)**: Lightweight, zero-config stdio MCP server for profile analytics and contest browsing.
  9. * **Python (FastMCP)**: Full-featured engine supporting all tools, Docker sandbox code execution (C++, Python, Java, Go, Rust), and Playwright browser submission/verdict polling over STDIO or streamable HTTP/SSE.
  10. ---
  11. ## 🚀 Capabilities & Tools
  12. ### 1. User Profiles & Analytics
  13. | Tool | Description |
  14. | --- | --- |
  15. | `get_profile` | Structured user profile (name, stars, current/highest rating, division, global/country rank, problems solved, contest count, recent form). |
  16. | `get_rating_history` | Chronological contest history with rating after each contest, rating deltas (`ratingChange`), and ranks. |
  17. | `get_activity` | Submission heat map summary: total submissions, active days, average submissions per active day, busiest day, and monthly breakdown. |
  18. | `get_contests` | Contests participated in with problems solved in each, merged with rating change and rank. |
  19. | `get_solved_problems` | Unique problems solved by a user mapped to their source contest. |
  20. | `compare_users` | Compact side-by-side comparison for 2–5 handles. |
  21. ### 2. Contest Management & Problem Solving
  22. | Tool | Description |
  23. | --- | --- |
  24. | `open_contest` | Open contest and fetch metadata, start/end dates, problem list, and category details. |
  25. | `list_problems` | List all problems in a contest with codes, names, and submission counts. |
  26. | `get_problem` | Fetch clean problem statements (Markdown), constraints, time/memory limits, and sample test cases. |
  27. | `validate_complexity` | Static heuristic time/space complexity analysis (loop nesting depth & annotations). |
  28. | `generate_tests` | Generate adversarial edge cases (minimum/maximum bounds, all identical, sorted, boundary flips, random cases). |
  29. | `get_contest_progress`* | Track attempted, solved, and remaining problems in an active contest. |
  30. ### 3. Execution, Submission & Automated Repair (Python Engine)
  31. | Tool | Description |
  32. | --- | --- |
  33. | `run_code`* | Execute code in an isolated Docker sandbox with zero network access, memory limits, CPU caps, and timeouts (supports C++, Python, Java, Go, Rust). |
  34. | `evaluate_confidence`* | Pre-submission confidence evaluation against sample and adversarial tests. |
  35. | `submit_solution`* | Automate CodeChef submission via Playwright browser automation. |
  36. | `get_submission_status`* | Poll submission verdict (AC, WA, TLE, RE) and runtime metrics. |
  37. | `retry_solution`* | Self-repair diagnosis pipeline that analyzes failure causes and suggests code fixes. |
  38. | `get_submission_history`* | Retrieve past submission history from local SQLite database. |
  39. *\* Advanced execution and submission tools run via the Python engine.*
  40. ---
  41. ## 📂 Project Structure
  42. ```text
  43. codechef-mcp/
  44. │
  45. ├── app/ # Python FastMCP Server
  46. │ ├── browser/ # Profile scrapers, Playwright submitters, API clients
  47. │ │ ├── profile.py # User profile, rating history, heatmap & comparison
  48. │ │ ├── contest.py # Contest metadata & problem list fetching
  49. │ │ ├── problem.py # Problem statement & sample test parser
  50. │ │ ├── login.py # Playwright authentication manager
  51. │ │ ├── submission.py # Code submission automation
  52. │ │ └── verdict.py # Verdict polling loop
  53. │ ├── models/ # SQLAlchemy SQLite schema (contests, submissions, logs)
  54. │ ├── retry_engine/ # Failure diagnostic & repair pipeline
  55. │ ├── sandbox/ # Docker runner & multi-language configurations
  56. │ ├── solver/ # Sequential contest solver state
  57. │ ├── tools/ # FastMCP tool registrations (18 tools)
  58. │ ├── utils/ # Structured logging & Redis/in-memory cache
  59. │ ├── config.py # Configuration loader
  60. │ ├── main.py # Streamable HTTP ASGI app
  61. │ └── mcp_server.py # FastMCP server instance
  62. │
  63. ├── src/ # Node.js MCP Server
  64. │ ├── api.js # Node API router
  65. │ ├── contest.js # Contest metadata, problem statement & complexity analyzer
  66. │ ├── errors.js # Error definitions
  67. │ ├── http.js # HTTP fetch client with caching & rate limits
  68. │ ├── parse.js # Profile HTML & inline script JSON parser
  69. │ ├── server.js # Stdio server entrypoint
  70. │ └── tools.js # Stdio tool definitions (11 tools)
  71. │
  72. ├── tests/ # Python test suite (33 unit tests)
  73. ├── test/ # Node.js test suite (34 unit tests)
  74. ├── docs/ # PRD and cloud deployment guides (Fly.io, Render)
  75. ├── Dockerfile # Container definition
  76. ├── docker-compose.yml # Docker Compose definition
  77. ├── run_server.py # Python server CLI runner (STDIO & HTTP)
  78. ├── requirements.txt # Python dependencies
  79. └── package.json # Node.js package definition
  80. ```
  81. ---
  82. ## 🛠️ Usage & Setup
  83. ### Running via Node.js
  84. #### 1. Instant run via npx:
  85. ```bash
  86. npx codechef-mcp
  87. ```
  88. #### 2. Local installation:
  89. ```bash
  90. npm install
  91. npm test
  92. npm start
  93. ```
  94. ### Running via Python
  95. #### 1. Setup virtual environment:
  96. ```bash
  97. python -m venv venv
  98. # Windows:
  99. .\venv\Scripts\activate
  100. # Linux/macOS:
  101. source venv/bin/activate
  102. pip install -r requirements.txt
  103. playwright install chromium
  104. ```
  105. #### 2. Run Python tests:
  106. ```bash
  107. pytest tests/ -v
  108. ```
  109. #### 3. Run Python Server:
  110. ```bash
  111. # STDIO Transport:
  112. python run_server.py
  113. # Streamable HTTP/SSE Transport:
  114. python run_server.py --http --port 8000
  115. ```
  116. ---
  117. ## 🔌 Connecting to AI Clients
  118. ### Claude Desktop
  119. Add to your `claude_desktop_config.json`:
  120. ```json
  121. {
  122. "mcpServers": {
  123. "codechef": {
  124. "command": "node",
  125. "args": ["E:/PERSONAL/OpenSource/codechef-mcp/src/server.js"]
  126. }
  127. }
  128. }
  129. ```
  130. Or for the Python full-suite server:
  131. ```json
  132. {
  133. "mcpServers": {
  134. "codechef": {
  135. "command": "E:/PERSONAL/OpenSource/codechef-mcp/venv/Scripts/python.exe",
  136. "args": ["E:/PERSONAL/OpenSource/codechef-mcp/run_server.py"]
  137. }
  138. }
  139. }
  140. ```
  141. ### Cursor / Web Agents (HTTP/SSE)
  142. Run:
  143. ```bash
  144. python run_server.py --http --port 8000
  145. ```
  146. Connect to `http://localhost:8000/mcp`.
  147. ---
  148. ## 📄 License
  149. MIT License.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.