Skip to main content
Glama
OnlineCompiler MCP Server

OnlineCompiler MCP Server

Official

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.

Related MCP server: Netmind Code Interpreter

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.

To run the server yourself instead (version 0.6.0 and later): onlinecompiler-mcp serves Streamable HTTP on port 8080 (MCP_HOST, MCP_PORT) and takes each caller's key as a Bearer token, while onlinecompiler-mcp --transport stdio speaks stdio for local clients and reads your key from ONLINECOMPILER_API_KEY.

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): Files the program can use, up to 20 and 1,000,000 decoded bytes in total: helper source files (compiled with the program) and input data. Each {"name": "util.py" or "pkg/util.py", "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, duckdb, polars, wordcloud, pgmpy and nltk. 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, rows (unordered lines, numbers within tolerance), table (CSV tables with a header row compared by column name, rows in any order; print df.to_csv(index=False)) or table_ordered (the same, rows in order)

  • files (optional): Files shared by every test (input data or helper source files), 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"

Gemini CLI

Install the extension from this repository:

gemini extensions install https://github.com/onlinecompiler-io/onlinecompiler-mcp

It adds the hosted server at https://api.onlinecompiler.io/mcp and a short context file telling Gemini when to use the tools. Gemini CLI signs you in with OAuth. To use an API key instead, add the server by hand in ~/.gemini/settings.json:

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

Claude Code plugin

This repository is also a Claude Code plugin marketplace:

/plugin marketplace add onlinecompiler-io/onlinecompiler-mcp
/plugin install onlinecompiler@onlinecompiler

Then run /mcp, pick onlinecompiler and sign in. The plugin does the same as the claude mcp add command above.

Cline

See llms-install.md: add the URL as a remote server with your API key in an Authorization header.

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"
      }
    }
  }
}

Available Tools

4 tools
judge_problemJudge ProblemAInspect

Judge code against one of your stored problems.

Runs the problem's tests and returns a verdict, a score, a summary, a submission id, a signed receipt, and the problem id and version. Hidden tests return only their verdict, never their input or expected output. It never invents results: if the problem is missing or the run fails, you get an error.

Inputs: code (required), problem (required), compiler (required), mode. Returns: object

list_compilersList CompilersAInspect

List all available compilers/languages supported by OnlineCompiler.io.

Returns a list of compiler objects with id and name. Use the id value as the compiler argument when calling run_code.

Inputs: no named parameters. Returns: result

run_codeRun CodeAInspect

Run one program in a sandbox and return its output.

Returns output, error, status, exit_code, time (wall-clock seconds), memory and truncated. Limited to 30 seconds (or time_limit) and 512 MB RAM. To check a solution against expected outputs, use run_tests instead.

python-3.14 includes numpy, pandas, scipy, scikit-learn, matplotlib, seaborn, statsmodels, sympy, openpyxl, pillow, duckdb, polars, wordcloud, pgmpy and nltk (with WordNet, VADER and the English POS tagger data) (no network, so nothing else can be installed). Files a program writes to the directory in $OUTPUT_DIR come back in files (png, svg, csv, json and txt; up to 8 files and 2 MB): PNG charts are returned as images, and SVG, CSV, JSON and text files with their text. plt.show() saves each open figure as figure-N.png, so tutorial code returns its chart. Pass files to give the program input data or helper source files.

Inputs: code (required), compiler (required), files, input, +1 more.

run_testsRun TestsAInspect

Check a program against test cases and judge it like an online judge.

Takes at most 10 tests, each counting as one run. Every test runs unless the code fails to compile or the request runs out of time. Returns an overall verdict, a score from 0 to 100 and a verdict per test. time_limit is seconds per test; compiling before the run does not count against it, and Java, Groovy and F#, which compile as they start, get a start-up allowance on top of it. python-3.14 includes numpy, pandas, scipy, scikit-learn, matplotlib, seaborn, statsmodels, sympy, openpyxl, pillow, duckdb, polars, wordcloud, pgmpy and nltk, and duckdb-1.5 works like sqlite-3, so data questions can be judged with checker "rows" and shared files. Files a program writes to $OUTPUT_DIR come back on visible tests only, as metadata.

Inputs: code (required), tests (required), compiler (required), files, +2 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 4 tools

    Disambiguation4/5

    The tools mostly have distinct roles: list_compilers discovers languages, run_code executes one program, run_tests checks arbitrary test cases, and judge_problem evaluates against a stored problem. The only mild overlap is between run_tests and judge_problem, but the descriptions clarify the distinction between ad-hoc tests and stored problem tests.

    Naming Consistency5/5

    All tool names follow a clear verb_noun snake_case convention: run_tests, judge_problem, list_compilers, run_code. The pattern is predictable and easy to scan.

    Tool Count5/5

    Four tools is a well-scoped surface for an online compiler service: language discovery, direct execution, custom test judging, and stored-problem judging. Each tool has a clear purpose and none feels redundant.

    Completeness3/5

    Core execution and judging workflows are covered, but judge_problem depends on stored problems while no tool lists, creates, updates, or retrieves those problems. That is a notable gap for agents trying to manage the problem lifecycle through this server alone.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers