SuperAPIAI Directory

onlinecompiler-mcp

github.com · AI developer platforms

onlinecompiler-mcp is an MCP server provided by OnlineCompiler.io that lets AI assistants and coding tools such as Claude, ChatGPT, Gemini CLI, Cursor, and Codex run and evaluate code directly. It supports 46 programming languages, and every run starts a fresh gVisor sandbox (512 MB of memory, 30-second timeout, no network access). Users can sign in via OAuth or connect with an API key to the hosted address, with no installation required; they can also run the server themselves using Streamable HTTP or stdio transport. The main tools include listing compilers, executing code, evaluating against test cases, and online judging against saved problems.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux · API

About this tool

Purpose onlinecompiler-mcp is an MCP (Model Context Protocol) server that connects OnlineCompiler.io's code execution and judging capabilities to AI assistants and coding tools, so that models can actually run code within a conversation or coding workflow rather than only generating it. The clients mentioned in the official description include Claude, ChatGPT, Gemini CLI, Cursor, and Codex.

Key capabilities

  • Multilingual execution: supports 46 languages, including Python, C, C++, Fortran, Java, C#, F#, Visual Basic, Go, Rust, PHP, Ruby, Haskell, TypeScript (Deno), JavaScript (Node.js), Kotlin, R, Bash, SQL (SQLite), SQL (DuckDB), Swift, COBOL, Perl, Julia, Pascal, Octave, Assembly (NASM), Lua, OCaml, Common Lisp, Erlang, Elixir, Prolog, D, FreeBASIC, Dart, Clojure, Groovy, Scala, Zig, Nim, Crystal, Ada, PowerShell, Racket, and Objective-C. list_compilers returns the current language list and versions.
  • Sandbox isolation: every run starts a fresh gVisor sandbox configured with 512 MB RAM, a 30-second timeout, and no network access.
  • run_code: executes code with the specified compiler, and can accept standard input, a time limit (greater than 0 and no more than 30 seconds, default 30 seconds), and up to 20 auxiliary files or input data totaling no more than 1,000,000 decoded bytes. It returns output, error, status, exit_code, time, memory, truncated, files, files_truncated; PNGs are returned as MCP image content, and SVG, CSV, JSON, and text files are listed as text (truncated at 64 KB). python-3.14 comes preinstalled with numpy, pandas, scipy, scikit-learn, matplotlib, seaborn, statsmodels, sympy, openpyxl, pillow, duckdb, polars, wordcloud, pgmpy, and nltk; files written by the program to $OUTPUT_DIR can be returned (png, svg, csv, json, txt, up to 8 files, 2 MB), and plt.show() saves each open figure as a PNG.
  • judge_code: evaluates a program against test cases, with up to 10 tests per run, each test counting as one run. Supports checkers such as trim (default), exact, tokens, float, rows, table, and table_ordered; returns the overall verdict, a score from 0 to 100, and the verdict for each test.
  • judge_problem: judges against a user's saved problem; hidden tests return only the verdict, not the input or expected output. Parameters include problem (problem id or slug), code, and mode (all by default, samples for samples only). Returns verdict, score, per-test verdicts, summary, submission id, signature receipt, and problem id and version.

Usage Hosted access requires no installation: point the MCP client at https://api.onlinecompiler.io/mcp。认证有两种方式:OAuth Login (claude.ai, Claude Desktop and mobile, ChatGPT, Claude Code, Codex, and other clients that support MCP login will open the OnlineCompiler.io login page; you can use Google or an email link. After approval, the app will appear on the API Keys page under the corresponding name; disable that key to disconnect); or use an API Key, sent as Authorization: Bearer <key> (a bare key also works). A free key can be obtained on the API Keys page. An incorrect or disabled key returns 401. Both methods count toward run usage according to your plan. Self-hosting (0.6.0 and later): onlinecompiler-mcp provides Streamable HTTP on port 8080 (MCP_HOST, MCP_PORT) and accepts the caller's key as a Bearer token; onlinecompiler-mcp --transport stdio is for local clients and reads the key from ONLINECOMPILER_API_KEY. Client configuration: In claude.ai or Claude Desktop, open Customize → Connectors → Add custom connector, paste the hosted address, and log in to approve; ChatGPT requires enabling developer mode in settings before adding a custom connector; in Claude Code, run /mcp, select onlinecompiler, and log in, or use the claude mcp add command with an API key; Gemini CLI can install the repository extension (which adds the hosted server and context files and uses OAuth login), or you can manually add the server in ~/.gemini/settings.json; the repository is also a Claude Code plugin marketplace; for Codex, see llms-install.md: use the URL as a remote server with an Authorization header, or specify an environment variable via bearer_token_env_var in ~/.codex/config.toml; for VS Code (Copilot / Claude extension), write to .vscode/mcp.json; for Cursor, write to .cursor/mcp.json.

Use cases Suitable for letting AI assistants actually verify code when answering programming questions, quickly trying out multi-language snippets in coding tools, automatically evaluating students' or candidates' code with test cases, and performing online judging based on saved problem sets.

Limits The sandbox has no network access, 512 MB of memory, and a maximum of 30 seconds per run; judge_code supports at most 10 tests per run; file uploads are limited to 20 files and 1,000,000 decoded bytes in total; output files are limited to 8 files and 2 MB; text file content is truncated at 64 KB. Run usage is counted according to your plan. Specific plan, pricing, and quota information was not provided.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools