MCP Chef
Enables AI agents to participate in CodeChef contests by fetching problems, generating and testing solutions in a secure sandbox, and submitting answers.
README
CodeChef Contest MCP Server
An AI-powered competitive programming assistant implementing the Model Context Protocol (MCP). This server allows AI agents (like Claude Desktop or Cursor) to participate in CodeChef contests: fetching problems, generating/testing solutions in a secure sandbox, managing retry states, submitting answers, and tracking contest progress.
š Features
- Contest Management: Open contests, retrieve problem lists, and track solved vs. remaining problems.
- Browser Automation: Playwright-based logins, problem-statement scraping, submission uploads, and verdict polling.
- Secure Sandbox: Docker-isolated compilation and execution (supports C++, Python, Java, Go, Rust) with no internet access, limited CPU/memory, and execution timeouts.
- Validation & Retry: Custom edge-case generator, confidence evaluator, and self-repair engine to analyze verdicts and repair failing solutions iteratively.
š Project Structure
MCP_Chef/
ā
āāā app/
ā āāā browser/ # Playwright-based browser automation (login, submit, poll)
ā āāā models/ # SQLAlchemy database schema (SQLite)
ā āāā retry_engine/ # Diagnosis & self-repair pipeline
ā āāā sandbox/ # Secure Docker runner configuration & language setup
ā āāā solver/ # Sequential contest solver state (Q1 ā Q5)
ā āāā tools/ # Exposed MCP tool decorators
ā āāā utils/ # Structured logger and cache layer
ā āāā main.py # Streamable HTTP ASGI app
ā āāā mcp_server.py # FastMCP server instantiation
ā
āāā tests/ # Automated test suite
āāā Dockerfile # Multi-stage container definition
āāā docker-compose.yml # Compose configuration (App, Redis)
āāā run_server.py # Unified server CLI entrypoint (STDIO & HTTP)
āāā .env # Local configuration file (not tracked in Git)
š ļø Local Setup
Prerequisites
- Python 3.10+
- Docker (Required for sandbox execution)
- Node.js (Optional, for
localtunneltesting)
Step 1: Install Dependencies
Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
playwright install chromium
Step 2: Configure Environment
Copy the example environment file and add your CodeChef credentials:
cp .env.example .env
Open [.env](file:///Users/ayushkumarsingh/Downloads/MCP_Chef/.env) and set your CodeChef username and password.
Step 3: Run Tests
Verify your local installation:
python -m pytest tests/ -v
š» Running the Server
1. STDIO Transport (For Claude Desktop)
To run the server locally over Standard Input/Output:
python run_server.py
Add the configuration to your Claude Desktop config (e.g., ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"codechef": {
"command": "/Users/ayushkumarsingh/Downloads/MCP_Chef/venv/bin/python",
"args": ["/Users/ayushkumarsingh/Downloads/MCP_Chef/run_server.py"]
}
}
}
2. HTTP Transport (For Cursor/Web Clients)
To run the server over HTTP/SSE:
python run_server.py --http --port 8000
Then configure your client to connect to:
http://localhost:8000/mcp
āļø Deployment
We have configured deployment setups for both container and VM platforms:
- Render (Free Tier): For a quick deployment that does not require a card, see the [Render Deployment Guide](file:///Users/ayushkumarsingh/Downloads/MCP_Chef/render_deployment.md).
- Fly.io (VM with Sandbox): For running with the secure Docker sandbox enabled, see the [Fly.io Deployment Guide](file:///Users/ayushkumarsingh/Downloads/MCP_Chef/fly_io_deployment.md).
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.