onlinecompiler-mcp 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ .env
2
+ *.pyc
3
+ __pycache__/
4
+ .vscode
5
+ .sass-cache
6
+ .venv
7
+ node_modules/
8
+
9
+ # Backend (Django)
10
+ backend/staticfiles/
11
+ backend/db.sqlite3
12
+ backend/media/
13
+ backend/mediafiles/
14
+ backend/.tailwind/
15
+
16
+ db.sqlite3
17
+ website/static/widget.js
18
+
19
+ .superpowers/
20
+
21
+ # Local MCP client config; holds an API key
22
+ .mcp.json
23
+ .playwright-mcp
24
+ design-previews
@@ -0,0 +1,159 @@
1
+ Metadata-Version: 2.5
2
+ Name: onlinecompiler-mcp
3
+ Version: 0.4.0
4
+ Summary: MCP server for OnlineCompiler.io: execute code in 46 languages in sandboxed containers
5
+ Project-URL: Homepage, https://onlinecompiler.io
6
+ Project-URL: Documentation, https://onlinecompiler.io/docs
7
+ Author: OnlineCompiler.io
8
+ License-Expression: MIT
9
+ Keywords: code-execution,compiler,mcp,onlinecompiler,sandbox
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: fastmcp>=4.1.0
19
+ Requires-Dist: httpx>=0.28.1
20
+ Description-Content-Type: text/markdown
21
+
22
+ # OnlineCompiler MCP Server
23
+
24
+ An [MCP](https://modelcontextprotocol.io) server that lets AI assistants execute code in 46 programming languages via [OnlineCompiler.io](https://onlinecompiler.io).
25
+
26
+ Each run starts a fresh gVisor sandbox (512 MB RAM, 30 s timeout, no network access).
27
+
28
+ ## Supported Languages
29
+
30
+ 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.
31
+
32
+ ## Setup
33
+
34
+ Point your MCP client at the URL. No install needed.
35
+
36
+ ```
37
+ https://api.onlinecompiler.io/mcp
38
+ ```
39
+
40
+ There are two ways in:
41
+
42
+ - **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](https://api.onlinecompiler.io/compilers/api-keys/). Disable that key to disconnect the app.
43
+ - **API key.** Send your key as `Authorization: Bearer <key>` (the bare key works too). Get a free key on the [API Keys page](https://api.onlinecompiler.io/compilers/api-keys/).
44
+
45
+ Runs count against your plan either way. A wrong or disabled key gets `401`.
46
+
47
+ ## Tools
48
+
49
+ ### `list_compilers`
50
+ List all available compilers with their identifiers.
51
+
52
+ ### `run_code`
53
+ Execute code with a specified compiler.
54
+
55
+ **Parameters:**
56
+ - `code` (required): Source code to execute
57
+ - `compiler` (required): Compiler identifier from `list_compilers` (e.g. `python-3.14`, `gcc-15`)
58
+ - `input` (optional): Standard input for the program
59
+ - `time_limit` (optional): Seconds the run may take, above 0 and at most 30 (default 30)
60
+ - `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
61
+
62
+ `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.
63
+
64
+ **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).
65
+
66
+ ### `run_tests`
67
+ 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.
68
+
69
+ **Parameters:**
70
+ - `code` (required): Source code to check
71
+ - `compiler` (required): Compiler identifier from `list_compilers`
72
+ - `tests` (required): Up to 10 objects, each `{"input": "...", "expected_output": "..."}`
73
+ - `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
74
+ - `checker` (optional): `trim` (default), `exact`, `tokens`, `float` or `rows` (unordered lines, numbers within tolerance)
75
+ - `files` (optional): Input files shared by every test, same shape as in `run_code`
76
+
77
+ **Returns:** an overall `verdict`, a `score` from 0 to 100 and a verdict per test.
78
+
79
+ ### `judge_problem`
80
+ 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`).
81
+
82
+ **Parameters:**
83
+ - `problem` (required): The id or slug of one of your stored problems
84
+ - `compiler` (required): Compiler identifier from `list_compilers`
85
+ - `code` (required): Source code to judge
86
+ - `mode` (optional): `all` (default) runs every test; `samples` runs only the sample tests
87
+
88
+ **Returns:** a `verdict`, a `score`, a per-test verdict, a `summary`, a `submission` id, a signed `receipt`, and the `problem` id and `version`.
89
+
90
+ ## Client Configuration
91
+
92
+ ### claude.ai, Claude Desktop and mobile
93
+
94
+ 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.
95
+
96
+ ### ChatGPT
97
+
98
+ Turn on developer mode in ChatGPT's settings, add a custom connector with `https://api.onlinecompiler.io/mcp` and sign in when asked.
99
+
100
+ ### Claude Code
101
+
102
+ ```bash
103
+ claude mcp add --transport http onlinecompiler https://api.onlinecompiler.io/mcp
104
+ ```
105
+
106
+ Then run `/mcp` inside Claude Code, pick onlinecompiler and sign in. To use an API key instead:
107
+
108
+ ```bash
109
+ claude mcp add onlinecompiler https://api.onlinecompiler.io/mcp --transport http --header "Authorization: Bearer YOUR_API_KEY"
110
+ ```
111
+
112
+ ### Codex
113
+
114
+ ```bash
115
+ codex mcp add onlinecompiler --url https://api.onlinecompiler.io/mcp
116
+ codex mcp login onlinecompiler
117
+ ```
118
+
119
+ 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`:
120
+
121
+ ```toml
122
+ [mcp_servers.onlinecompiler]
123
+ url = "https://api.onlinecompiler.io/mcp"
124
+ bearer_token_env_var = "ONLINECOMPILER_API_KEY"
125
+ ```
126
+
127
+ ### VS Code (Copilot / Claude extension)
128
+
129
+ Add to `.vscode/mcp.json`:
130
+
131
+ ```json
132
+ {
133
+ "servers": {
134
+ "onlinecompiler": {
135
+ "url": "https://api.onlinecompiler.io/mcp",
136
+ "headers": {
137
+ "Authorization": "Bearer your-api-key"
138
+ }
139
+ }
140
+ }
141
+ }
142
+ ```
143
+
144
+ ### Cursor
145
+
146
+ Add to `.cursor/mcp.json`:
147
+
148
+ ```json
149
+ {
150
+ "mcpServers": {
151
+ "onlinecompiler": {
152
+ "url": "https://api.onlinecompiler.io/mcp",
153
+ "headers": {
154
+ "Authorization": "Bearer your-api-key"
155
+ }
156
+ }
157
+ }
158
+ }
159
+ ```
@@ -0,0 +1,138 @@
1
+ # OnlineCompiler MCP Server
2
+
3
+ An [MCP](https://modelcontextprotocol.io) server that lets AI assistants execute code in 46 programming languages via [OnlineCompiler.io](https://onlinecompiler.io).
4
+
5
+ Each run starts a fresh gVisor sandbox (512 MB RAM, 30 s timeout, no network access).
6
+
7
+ ## Supported Languages
8
+
9
+ 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.
10
+
11
+ ## Setup
12
+
13
+ Point your MCP client at the URL. No install needed.
14
+
15
+ ```
16
+ https://api.onlinecompiler.io/mcp
17
+ ```
18
+
19
+ There are two ways in:
20
+
21
+ - **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](https://api.onlinecompiler.io/compilers/api-keys/). Disable that key to disconnect the app.
22
+ - **API key.** Send your key as `Authorization: Bearer <key>` (the bare key works too). Get a free key on the [API Keys page](https://api.onlinecompiler.io/compilers/api-keys/).
23
+
24
+ Runs count against your plan either way. A wrong or disabled key gets `401`.
25
+
26
+ ## Tools
27
+
28
+ ### `list_compilers`
29
+ List all available compilers with their identifiers.
30
+
31
+ ### `run_code`
32
+ Execute code with a specified compiler.
33
+
34
+ **Parameters:**
35
+ - `code` (required): Source code to execute
36
+ - `compiler` (required): Compiler identifier from `list_compilers` (e.g. `python-3.14`, `gcc-15`)
37
+ - `input` (optional): Standard input for the program
38
+ - `time_limit` (optional): Seconds the run may take, above 0 and at most 30 (default 30)
39
+ - `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
40
+
41
+ `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.
42
+
43
+ **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).
44
+
45
+ ### `run_tests`
46
+ 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.
47
+
48
+ **Parameters:**
49
+ - `code` (required): Source code to check
50
+ - `compiler` (required): Compiler identifier from `list_compilers`
51
+ - `tests` (required): Up to 10 objects, each `{"input": "...", "expected_output": "..."}`
52
+ - `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
53
+ - `checker` (optional): `trim` (default), `exact`, `tokens`, `float` or `rows` (unordered lines, numbers within tolerance)
54
+ - `files` (optional): Input files shared by every test, same shape as in `run_code`
55
+
56
+ **Returns:** an overall `verdict`, a `score` from 0 to 100 and a verdict per test.
57
+
58
+ ### `judge_problem`
59
+ 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`).
60
+
61
+ **Parameters:**
62
+ - `problem` (required): The id or slug of one of your stored problems
63
+ - `compiler` (required): Compiler identifier from `list_compilers`
64
+ - `code` (required): Source code to judge
65
+ - `mode` (optional): `all` (default) runs every test; `samples` runs only the sample tests
66
+
67
+ **Returns:** a `verdict`, a `score`, a per-test verdict, a `summary`, a `submission` id, a signed `receipt`, and the `problem` id and `version`.
68
+
69
+ ## Client Configuration
70
+
71
+ ### claude.ai, Claude Desktop and mobile
72
+
73
+ 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.
74
+
75
+ ### ChatGPT
76
+
77
+ Turn on developer mode in ChatGPT's settings, add a custom connector with `https://api.onlinecompiler.io/mcp` and sign in when asked.
78
+
79
+ ### Claude Code
80
+
81
+ ```bash
82
+ claude mcp add --transport http onlinecompiler https://api.onlinecompiler.io/mcp
83
+ ```
84
+
85
+ Then run `/mcp` inside Claude Code, pick onlinecompiler and sign in. To use an API key instead:
86
+
87
+ ```bash
88
+ claude mcp add onlinecompiler https://api.onlinecompiler.io/mcp --transport http --header "Authorization: Bearer YOUR_API_KEY"
89
+ ```
90
+
91
+ ### Codex
92
+
93
+ ```bash
94
+ codex mcp add onlinecompiler --url https://api.onlinecompiler.io/mcp
95
+ codex mcp login onlinecompiler
96
+ ```
97
+
98
+ 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`:
99
+
100
+ ```toml
101
+ [mcp_servers.onlinecompiler]
102
+ url = "https://api.onlinecompiler.io/mcp"
103
+ bearer_token_env_var = "ONLINECOMPILER_API_KEY"
104
+ ```
105
+
106
+ ### VS Code (Copilot / Claude extension)
107
+
108
+ Add to `.vscode/mcp.json`:
109
+
110
+ ```json
111
+ {
112
+ "servers": {
113
+ "onlinecompiler": {
114
+ "url": "https://api.onlinecompiler.io/mcp",
115
+ "headers": {
116
+ "Authorization": "Bearer your-api-key"
117
+ }
118
+ }
119
+ }
120
+ }
121
+ ```
122
+
123
+ ### Cursor
124
+
125
+ Add to `.cursor/mcp.json`:
126
+
127
+ ```json
128
+ {
129
+ "mcpServers": {
130
+ "onlinecompiler": {
131
+ "url": "https://api.onlinecompiler.io/mcp",
132
+ "headers": {
133
+ "Authorization": "Bearer your-api-key"
134
+ }
135
+ }
136
+ }
137
+ }
138
+ ```
@@ -0,0 +1,38 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "onlinecompiler-mcp"
7
+ version = "0.4.0"
8
+ description = "MCP server for OnlineCompiler.io: execute code in 46 languages in sandboxed containers"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ authors = [
13
+ { name = "OnlineCompiler.io" }
14
+ ]
15
+ keywords = ["mcp", "compiler", "code-execution", "onlinecompiler", "sandbox"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "License :: OSI Approved :: MIT License",
24
+ ]
25
+ dependencies = [
26
+ "fastmcp>=4.1.0",
27
+ "httpx>=0.28.1",
28
+ ]
29
+
30
+ [project.urls]
31
+ Homepage = "https://onlinecompiler.io"
32
+ Documentation = "https://onlinecompiler.io/docs"
33
+
34
+ [project.scripts]
35
+ onlinecompiler-mcp = "onlinecompiler_mcp.server:main"
36
+
37
+ [tool.hatch.build.targets.wheel]
38
+ packages = ["src/onlinecompiler_mcp"]
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.onlinecompiler/compiler",
4
+ "title": "OnlineCompiler.io",
5
+ "description": "Run Python, Java, C, C++, C#, Go, Rust and 39 more languages, each run in a fresh, offline sandbox.",
6
+ "version": "1.2.0",
7
+ "websiteUrl": "https://onlinecompiler.io/mcp-code-execution",
8
+ "icons": [
9
+ {
10
+ "src": "https://onlinecompiler.io/logo.png",
11
+ "mimeType": "image/png",
12
+ "sizes": ["128x128"]
13
+ }
14
+ ],
15
+ "remotes": [
16
+ {
17
+ "type": "streamable-http",
18
+ "url": "https://api.onlinecompiler.io/mcp",
19
+ "headers": [
20
+ {
21
+ "name": "Authorization",
22
+ "description": "Optional: your OnlineCompiler.io API key as a Bearer token. Leave it out to sign in with OAuth instead. Get a free key at https://api.onlinecompiler.io/compilers/api-keys/",
23
+ "isRequired": false,
24
+ "isSecret": true,
25
+ "value": "Bearer {api_key}",
26
+ "variables": {
27
+ "api_key": {
28
+ "description": "Your OnlineCompiler.io API key (free, 100,000 runs a month)",
29
+ "isRequired": false,
30
+ "isSecret": true
31
+ }
32
+ }
33
+ }
34
+ ]
35
+ }
36
+ ]
37
+ }
@@ -0,0 +1 @@
1
+ """OnlineCompiler.io MCP Server — execute code in 12+ languages."""