OnlineCompiler.io

io.onlinecompiler由 onlinecompiler.io 發布官方發布者v1.2.1更新於 Nov 7, 2026

Run Python, Java, C, C++, C#, Go, Rust and 39 more languages, each run in a fresh, offline sandbox.

已驗證Streamable HTTP可網頁執行開發者工具AI 與機器學習

概覽

AI 產生的概覽

遠端 MCP 伺服器,讓助理在全新的離線沙箱中編譯並執行 46 種語言的程式碼,並可用測試案例評測程式碼。

可以做什麼
  • 列出可用編譯器及其識別碼與版本
  • 以指定編譯器執行程式碼,可提供標準輸入、時間上限以及輔助或資料檔案,回傳輸出、錯誤、結束碼、耗時、記憶體與產生的檔案
  • 用最多 10 組輸入/預期輸出測試案例檢查程式碼,可選擇輸出比對方式,回傳判定結果與分數
  • 用你儲存的題目評測程式碼,包含隱藏測試,回傳判定、分數與簽章回執
適用情境
適合讓助理實際執行程式碼片段、確認程式碼能否編譯執行,或在沒有本機工具鏈與評測系統的情況下用測試案例為解答評分。
執行需求
僅需遠端端點,無須安裝。必須驗證:透過用戶端 OAuth 登入,或在 Authorization 標頭中以 Bearer 權杖傳送 API 金鑰。執行次數計入你的 OnlineCompiler.io 方案。
安裝前請注意
程式碼會傳送到第三方服務並在該處執行,請勿貼上密鑰或專有程式碼。每次執行最長 30 秒、無網路存取且記憶體有限。執行會消耗方案額度,run_tests 中每個測試計為一次執行。金鑰錯誤或被停用會回傳 401。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 OnlineCompiler.io,將其新增到工作區。
  2. 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.onlinecompiler%2Fcompiler/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。

{
  "mcpServers": {
    "onlinecompiler-io": {
      "type": "http",
      "url": "https://api.onlinecompiler.io/mcp"
    }
  }
}

README

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): 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 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): 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

bash
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:

bash
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:

bash
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:

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

bash
codex mcp add onlinecompiler --url https://api.onlinecompiler.io/mcpcodex 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:

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:

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

Cursor

Add to .cursor/mcp.json:

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

來源:README.md,提交 29c6b35

工具

0
該伺服器需要登入,因此 SourceWeft 無法在沒有帳號的情況下讀取其工具,也未收錄。已連接帳號所能看到的內容可能因帳號及其權限而異。

版本歷史

8
  1. v1.2.1最新Nov 7, 2026
  2. v1.2.0Oct 25, 2026
  3. v1.1.2Oct 23, 2026
  4. v1.1.1Oct 19, 2026
  5. v1.1.0Oct 19, 2026
  6. v1.0.3Oct 18, 2026
  7. v1.0.1Oct 17, 2026
  8. v1.0.0Oct 17, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分