# onlinecompiler-io/onlinecompiler-mcp [Health: Active]

**Category:** 👨‍💻 Code Execution  
**Repository:** https://github.com/onlinecompiler-io/onlinecompiler-mcp  
**GitHub Stars:** 1  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/onlinecompiler-io-onlinecompiler-mcp

## Description
Run and judge code in 46 languages, each run in a fresh sandbox with no network: run code with input, check it against test cases and judge stored problems.

## Tools
Capabilities this server exposes over MCP:

- **list_compilers** — List all available compilers with their identifiers.
- **run_code** — Execute code with a specified compiler.
- **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.
- **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`).

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "onlinecompiler-mcp": {
    "url": "https://api.onlinecompiler.io/mcp"
  }
}
```

## Documentation

## What onlinecompiler-io/onlinecompiler-mcp does

onlinecompiler-io/onlinecompiler-mcp exposes OnlineCompiler.io's code execution and judging features through MCP. It supports 46 languages, including Python, C, C++, Java, Go, Rust, JavaScript, TypeScript, SQL, R, Swift, Kotlin, and others. The `list_compilers` tool returns the available compiler identifiers and versions, so clients can select a valid compiler before running code.

The server is suitable for agents that need to execute generated programs, inspect runtime results, validate solutions against explicit examples, or evaluate submissions against stored programming problems.

## How it works

The hosted MCP endpoint is `https://api.onlinecompiler.io/mcp`. Clients can authenticate through OnlineCompiler.io OAuth where supported, or send an API key using an `Authorization: Bearer` header. Runs count against the associated plan, and invalid or disabled credentials produce an HTTP 401 response.

Each run starts in a new gVisor sandbox. The environment has 512 MB of memory, a 30-second maximum runtime, and no network access. Programs can receive standard input and up to 20 supplied files, with a combined decoded size limit of 1,000,000 bytes. Files written to `$OUTPUT_DIR` can be returned for supported formats, including PNG, SVG, CSV, JSON, and text.

The repository also supports self-hosted operation. Streamable HTTP uses port 8080 by default and accepts each caller's bearer token. The `--transport stdio` mode is intended for local MCP clients and reads the API key from `ONLINECOMPILER_API_KEY`.

## Setup and configuration

For a hosted connection, add `https://api.onlinecompiler.io/mcp` as a remote MCP server in the client. OAuth sign-in is available in supported clients, while API-key configurations use the `Authorization` header. Claude Code and Codex provide command-line setup commands; Gemini CLI can install the repository extension; Cline, VS Code, and Cursor accept the endpoint in their MCP configuration files.

A local stdio setup runs `onlinecompiler-mcp --transport stdio` with `ONLINECOMPILER_API_KEY` set. A self-hosted Streamable HTTP process can configure its host and port with `MCP_HOST` and `MCP_PORT`.

## Tools and capabilities

- `list_compilers` lists available compiler identifiers and versions.
- `run_code` executes source code with standard input, an optional time limit, and optional helper or data files. It returns output, errors, status, exit code, timing, memory usage, truncation indicators, and generated files.
- `run_tests` compares a program with up to 10 test cases per call. It returns an overall verdict, a score from 0 to 100, and an individual result for each test. Output checking supports trimmed, exact, token, floating-point, unordered-row, CSV-table, and ordered-table modes.
- `judge_problem` evaluates code against a stored problem by ID or slug. It can run all tests or sample tests and returns verdict, score, per-test results, a summary, submission ID, signed receipt, and problem metadata.

Python 3.14 includes libraries such as NumPy, pandas, SciPy, scikit-learn, matplotlib, SymPy, OpenPyXL, Pillow, DuckDB, Polars, and NLTK.

## Limitations and notes

`run_tests` accepts no more than 10 tests in one call, and each test counts as a run. Its per-test time limit is capped at 30 seconds, with a default of 2 seconds; Java, Groovy, and F# receive additional startup allowance. All tests run unless compilation fails or the request reaches its time limit.

Hidden tests used by `judge_problem` reveal only their verdict, not their inputs or expected outputs. A nonexistent stored problem or failed execution is reported as an error rather than being replaced with generated test data. Network access is unavailable inside every execution sandbox.

_Full upstream README: https://allmcps.com/mcp/onlinecompiler-io-onlinecompiler-mcp/readme_

