vnoi-mcp
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., "@vnoi-mcp Read problem post and solve it in C++17, submit, then fix any WA verdicts."
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.
🧑💻 vnoi-mcp
Let AI read problems, write code, and submit on VNOI Online Judge.
An MCP server that connects Claude, LM Studio, Cursor, and other MCP clients to VNOJ: read statements, submit solutions, and get per-test verdicts, all without leaving the chat.
✨ What it does
One prompt is all it takes:
"Solve contest
vnoicup25_r1: read each problem, write a C++17 solution, submit it, and if it fails, read the verdict, fix it, and resubmit."
The model then loops on its own:
list_problems ─► get_problem ─► write code ─► submit
▲ │
└─ WA/TLE ◄──┘It's especially handy for problem setters: have the AI solve your problems independently and submit, to surface weak tests, wrong tests, or ambiguous statements.
Related MCP server: cf-mcp-orange
🧰 Tools
Tool | Arguments | Returns |
|
| Problems in a contest: code, name, time limit, memory limit, points |
|
| Full statement as Markdown: limits, description, I/O format, subtasks, samples |
|
| Submits, waits for judging to finish, returns per-test results (grouped by batch if any) |
|
| Results of an existing submission |
Example vnoi_submit output:
Submission ID: 1234567
Batch #1 (25/25 points)
Test 1: AC | 0.009s | 680.00 KB
Test 2: AC | 0.010s | 672.00 KB
Batch #2 (0/25 points)
Test 1: TLE | >1.000s | 660.00 KBLanguage | ID | Language | ID | |
C++17 (default) |
| Python 3 |
| |
C++20 |
| PyPy 3 |
| |
C++23 |
| Java 25 |
| |
C |
| Rust |
|
🚀 Quick start
Requirements: Python 3.12+ and uv.
git clone https://github.com/RMQuan/vnoi-mcp.git
cd vnoi-mcp
uv sync
cp .env.example .env1. Get your session cookie
Log in to oj.vnoi.info in your browser.
Open DevTools (
Cmd + Option + I/F12) → Application → Cookies →https://oj.vnoi.info.Copy the value of
sessionidinto.env:
VNOI_SESSION=paste_your_sessionid_heresessionid grants full access to your VNOI account, just like a password. Never share or commit it. .env is already in .gitignore.
2. Test it
uv run mcp dev server.pyThe MCP Inspector opens in your browser → Connect → Tools → try vnoi_get_problem with problem_code = post.
3. Connect a client
Claude Code
claude mcp add vnoi -- uv --directory /path/to/vnoi-mcp run server.pyLM Studio / Cursor / Claude Desktop (mcp.json)
{
"mcpServers": {
"vnoi": {
"command": "uv",
"args": ["--directory", "/path/to/vnoi-mcp", "run", "server.py"]
}
}
}If a macOS app can't finduv, replace "uv" with its full path from which uv (e.g. /opt/homebrew/bin/uv).
⚙️ How it works
VNOJ (a fork of DMOJ) has no submission API, so the server acts like a browser:
GET /problem/<code>/submit → grab csrfmiddlewaretoken (HTML) + csrftoken cookie
POST /problem/<code>/submit → source, language, token → 302 → /submission/<id>
GET /submission/<id> → poll until grading ends, then parse the results tableFile | Role |
| Declares the MCP tools and turns errors into readable messages for the model |
| Logged-in session (cookie from |
| Lists problems in a contest |
| Converts a problem statement to Markdown |
| Submits, waits for judging, parses results (with or without batches) |
🩺 Troubleshooting
Error | Fix |
| Create |
Cookie expired / redirected to the login page | Log in again in your browser and copy the new |
| Check the contest code and make sure you have joined the contest |
| Possibly blocked by Cloudflare; retry later or refresh your cookie |
| The judge queue is busy; call |
🔒 Limitations
The server acts as your VNOI account, so it can only see and do what you can in your browser:
Contests: you must have joined a contest before
vnoi_list_problemsandvnoi_get_problemcan read its problems. Contests that haven't started, or whose problems are hidden from you, return an error.Hidden / private problems: only accessible if your account has author, tester, or curator permissions on them.
Submissions: subject to the same rules as manual submissions: per-problem submission limits, allowed languages, and the contest's time window.
Results:
vnoi_get_resultcan only read submissions your account is allowed to view.Session lifetime: the cookie expires when you log out or after a period of inactivity; you'll need to refresh
VNOI_SESSIONthen.One account: the server uses a single cookie from
.env; there is no multi-account support.No official API: results come from parsing VNOJ's HTML. Compile-error output and unusual verdict layouts are handled on a best-effort basis.
⚠️ Use responsibly
Do not use this in live rated contests. Letting an AI solve problems for you is cheating and violates VNOI's rules.
Intended for practice, virtual contests, and testing problem sets as a setter.
Don't spam submissions: VNOI's judges are a shared community resource.
The tool parses HTML, so it may break if VNOI changes its layout. Please open an issue if it does.
📄 License
MIT © 2026 RMQuan. Provided "as is", without warranty of any kind; use at your own risk.
Available Tools
4 toolsvnoi_get_problemA
Lấy đề bài đầy đủ (bao gồm Points, Time limit, Memory limit, loại INPUT (stdin, file), kiểu OUTPUT (stdout, file), đề bài, định dạng Input, định dạng Output, subtask, test mẫu, giải thích) dạng Markdown. problem_code: mã bài, ví dụ "vnoicup25_r1_a".
Inputs: problem_code (required). Returns: result
vnoi_get_resultA
Xem lại kết quả của một bài đã nộp (dùng khi vnoi_submit báo hết thời gian chờ). submission_id: ID của submission, ví dụ "1234567".
Inputs: submission_id (required). Returns: result
vnoi_list_problemsA
Liệt kê các bài trong một contest VNOI (mã bài, tên, time limit, memory limit, điểm). contest_id: mã contest, ví dụ "vnoicup25_r1".
Inputs: contest_id (required). Returns: result
vnoi_submitA
Nộp code lên VNOI, đợi chấm xong rồi trả về kết quả từng test (batch, trạng thái AC/WA/TLE/..., thời gian, bộ nhớ). problem_code: mã bài, ví dụ "vnoicup25_r1_a". code: mã nguồn. language: mã ngôn ngữ — 4 = C++17 (mặc định), 14 = C++20, 23 = C++23, 9 = Python 3, 17 = PyPy 3.
Inputs: code (required), problem_code (required), language. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct step: listing problems in a contest, fetching a full problem statement, submitting code, and retrieving a past submission. The only potential overlap is vnoi_submit vs vnoi_get_result, since both return judging results, but the descriptions explicitly state get_result is the fallback when submit times out. That clarification makes misselection unlikely.
All four tools use a uniform vnoi_ prefix with snake_case verb_noun structure (list_problems, get_problem, submit, get_result). vnoi_submit drops the object noun, but the verb is unambiguous and the pattern reads consistently across the set.
Four tools map cleanly onto the four steps of the judge workflow (enumerate → read → submit → verify), with no redundant or speculative tools. The surface is minimal but every tool earns its place for the competitive-programming-judge domain.
The core solve-a-problem loop is covered end to end, but there is no way to discover contest IDs (no list_contests) or browse a problem archive, so an agent must already know a contest code. There is also no submission-history or user-status tool, which leaves notable gaps beyond the happy path.
Maintenance
Related MCP Connectors
The official Upwork MCP server, letting AI agents connect to Upwork and act on your behalf.
One connector for 15,000+ MCP servers plus your team's private MCPs, from any AI client.
Connect AI clients to your Dactic work context through a hosted MCP service.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides tools for AI agents to interact with the Orange Juice Online Judge API by managing problems and code submissions. Users can list problems, retrieve detailed descriptions, submit source code, and track submission status through natural language.51MIT
- 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
- FlicenseNot gradedqualityDmaintenanceEnables Claude to fetch and analyze your public LeetCode submission history, weak areas, and daily challenge via a remote MCP server.-
- 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-