
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.
概览
远程 MCP 服务器,让助手在全新的离线沙箱中编译并运行 46 种语言的代码,并可用测试用例评测代码。
- 可以做什么
- 列出可用编译器及其标识符和版本
- 用指定编译器运行代码,可传入标准输入、时间限制以及辅助或数据文件,返回输出、错误、退出码、耗时、内存和生成的文件
- 用最多 10 组输入/期望输出测试用例检查代码,可选择输出比对方式,返回判定结果和分数
- 用你保存的题目评测代码,包括隐藏测试,返回判定、分数和签名回执
- 适用场景
- 适合让助手真正执行代码片段、确认代码能否编译运行,或在没有本地工具链和评测系统的情况下用测试用例给解答打分。
- 运行要求
- 仅需远程端点,无需安装。必须认证:通过客户端 OAuth 登录,或在 Authorization 请求头中以 Bearer 令牌发送 API 密钥。运行次数计入你的 OnlineCompiler.io 套餐。
安装
在 SourceWeft 中
- 打开 控制台中的 OnlineCompiler.io,将其添加到工作区。
- 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
- 为需要使用其工具的对话启用该服务。
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.
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 executecompiler(required): Compiler identifier fromlist_compilers(e.g.python-3.14,gcc-15)input(optional): Standard input for the programtime_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 checkcompiler(required): Compiler identifier fromlist_compilerstests(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 topchecker(optional):trim(default),exact,tokens,floatorrows(unordered lines, numbers within tolerance)files(optional): Files shared by every test (input data or helper source files), same shape as inrun_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 problemscompiler(required): Compiler identifier fromlist_compilerscode(required): Source code to judgemode(optional):all(default) runs every test;samplesruns 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
Then run /mcp inside Claude Code, pick onlinecompiler and sign in. To use an API key instead:
Gemini CLI
Install the extension from this repository:
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:
Claude Code plugin
This repository is also a Claude Code plugin marketplace:
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
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:
VS Code (Copilot / Claude extension)
Add to .vscode/mcp.json:
Cursor
Add to .cursor/mcp.json:
来源:README.md,提交 29c6b35
工具
0版本历史
8- v1.2.1最新Nov 7, 2026
- v1.2.0Oct 25, 2026
- v1.1.2Oct 23, 2026
- v1.1.1Oct 19, 2026
- v1.1.0Oct 19, 2026
- v1.0.3Oct 18, 2026
- v1.0.1Oct 17, 2026
- v1.0.0Oct 17, 2026
评分
已满足适用检查项的 85%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分