Skip to main content

OnlineCompiler MCP Server

An MCP server that lets AI assistants execute code in 46 programming languages via OnlineCompiler.io.

Each run starts a fresh gVisor sandbox (512 MB RAM, 30 s timeout, no network access).

Supported Languages

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 list with versions.

Setup

Point your MCP client at the URL. No install needed.

https://api.onlinecompiler.io/mcp

There are two ways in:

  • Sign in (OAuth). Clients that support MCP sign-in (claude.ai, Claude Desktop and mobile, ChatGPT, Claude Code, Codex) open an OnlineCompiler.io sign-in page (Google or an email link) and ask you to approve. The app then appears as a key named after it, for example "Claude (connected app)", on your API Keys page. Disable that key to disconnect the app.
  • API key. Send your key as Authorization: Bearer <key> (the bare key works too). Get a free key on the API Keys page.

Runs count against your plan either way. A wrong or disabled key gets 401.

Tools

list_compilers

List all available compilers with their identifiers.

run_code

Execute code with a specified compiler.

Parameters:

  • code (required): Source code to execute
  • compiler (required): Compiler identifier from list_compilers (e.g. python-3.14, gcc-15)
  • input (optional): Standard input for the program
  • time_limit (optional): Seconds the run may take, above 0 and at most 30 (default 30)
  • files (optional): Input files, up to 8 and 1,000,000 decoded bytes, each {"name": "data.csv", "content": "...", "encoding": "utf8" or "base64"}; the program finds them in its working directory

python-3.14 includes numpy, pandas, scipy, scikit-learn, matplotlib, seaborn, statsmodels, sympy, openpyxl, pillow and duckdb. Files a program writes to $OUTPUT_DIR come back (png, svg, csv, json, txt; up to 8 files and 2 MB), and plt.show() saves each open figure as a PNG.

Returns: output, error, status, exit_code, time, memory, truncated, files, files_truncated. PNG files arrive as MCP image content; SVG, CSV, JSON and text files are listed with their text (cut at 64 KB).

run_tests

Check a program against test cases and judge it like an online judge. At most 10 tests per call, each counting as one run. Every test runs unless the code fails to compile or the request runs out of time.

Parameters:

  • code (required): Source code to check
  • compiler (required): Compiler identifier from list_compilers
  • tests (required): Up to 10 objects, each {"input": "...", "expected_output": "..."}
  • time_limit (optional): Seconds per test, above 0 and at most 30 (default 2); compiling does not count, and Java, Groovy and F# get a start-up allowance on top
  • checker (optional): trim (default), exact, tokens, float or rows (unordered lines, numbers within tolerance)
  • files (optional): Input files shared by every test, same shape as in run_code

Returns: an overall verdict, a score from 0 to 100 and a verdict per test.

judge_problem

Judge code against one of your stored problems. Hidden tests return only their verdict, never their input or expected output. Nothing is invented: a missing problem or a failed run is an error (for example HTTP 404: Problem not found).

Parameters:

  • problem (required): The id or slug of one of your stored problems
  • compiler (required): Compiler identifier from list_compilers
  • code (required): Source code to judge
  • mode (optional): all (default) runs every test; samples runs only the sample tests

Returns: a verdict, a score, a per-test verdict, a summary, a submission id, a signed receipt, and the problem id and version.

Client Configuration

claude.ai, Claude Desktop and mobile

In claude.ai or Claude Desktop, open Customize, then Connectors, then Add custom connector. Paste https://api.onlinecompiler.io/mcp, sign in to OnlineCompiler.io when asked and approve. The connector belongs to your Claude account, so it works in the Claude mobile apps too.

ChatGPT

Turn on developer mode in ChatGPT's settings, add a custom connector with https://api.onlinecompiler.io/mcp and sign in when asked.

Claude Code

claude mcp add --transport http onlinecompiler https://api.onlinecompiler.io/mcp

Then run /mcp inside Claude Code, pick onlinecompiler and sign in. To use an API key instead:

claude mcp add onlinecompiler https://api.onlinecompiler.io/mcp --transport http --header "Authorization: Bearer YOUR_API_KEY"

Codex

codex mcp add onlinecompiler --url https://api.onlinecompiler.io/mcp
codex mcp login onlinecompiler

To use an API key instead, skip the login and put the key in the environment variable that bearer_token_env_var names, in ~/.codex/config.toml:

[mcp_servers.onlinecompiler]
url = "https://api.onlinecompiler.io/mcp"
bearer_token_env_var = "ONLINECOMPILER_API_KEY"

VS Code (Copilot / Claude extension)

Add to .vscode/mcp.json:

{
  "servers": {
    "onlinecompiler": {
      "url": "https://api.onlinecompiler.io/mcp",
      "headers": {
        "Authorization": "Bearer your-api-key"
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "onlinecompiler": {
      "url": "https://api.onlinecompiler.io/mcp",
      "headers": {
        "Authorization": "Bearer your-api-key"
      }
    }
  }
}

Metadata

Release files for onlinecompiler-mcp 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onlinecompiler-mcp 0.4.0
File Size Uploaded Provenance Actions
onlinecompiler_mcp-0.4.0.tar.gz 132.1 kB Without provenance Details for onlinecompiler_mcp-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for onlinecompiler-mcp 0.4.0
File Interpreter ABI Platform Actions
onlinecompiler_mcp-0.4.0-py3-none-any.whl Python 3 none any Details for onlinecompiler_mcp-0.4.0-py3-none-any.whl

Total release size: 140.7 kB

Release files / onlinecompiler_mcp-0.4.0.tar.gz

Download URL onlinecompiler_mcp-0.4.0.tar.gz
Size 132.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1569a463b62efc2a2c5725f28834866698e7aef8bbfe8659b81f9c78eaa94e64
BLAKE2b-256 checksum
How to use checksums
620c5e1bc8d6b70c5050e8388e80046adc18362cc4132871df83c1db341a9729
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / onlinecompiler_mcp-0.4.0-py3-none-any.whl

Download URL onlinecompiler_mcp-0.4.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14144bdfa09685dddf086e30ccd090b34bdae5323fbea7bdf1b1b1752f8ae868
BLAKE2b-256 checksum
How to use checksums
d969744ea9f9ad144d6aafaedce426c4a75c56b8b82471fb238bc087cf592aaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.12

Security for onlinecompiler-mcp 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page