Compiler Explorer
Measured conclusion: Deep-tested. L2 outcome: tools_ok.
Compile code with thousands of compilers, inspect the assembly, and share godbolt.org links
| Author | io.github.compiler-explorer |
|---|---|
| Access | remote |
| Publisher key required | No |
| Measured state | Deep-tested |
| L1 liveness | alive |
| L1 latency | 2944 ms |
| Last measured | 2026-10-26 |
Add to your agent
Copy this into your MCP client config:
{
"mcpServers": {
"Compiler Explorer": {
"url": "https://godbolt.org/mcp",
"transport": "streamable-http"
}
}
}
Measured tools (7)
compileread-onlyCompile source code and return assembly output, stdout, and stderr
Parameters:
source(required) — string — Source code to compilelanguage(required) — string — Language ID (e.g. "c++", "c", "rust", "python")stdin— string — Standard input for execution (requires execute=true)execute— boolean — Run the program instead of returning assembly. `asm` becomes empty; runtime output goes to top-level `stdout`/`stderr`; compile diagnostics move to `buildResult.stdout`/`stderr`.filters— object — Output filtersoptions— string — Compiler flags (e.g. "-O2 -std=c++20 -Wall")compiler— string — Compiler ID from list_compilers (e.g. "g161"). If omitted, uses the language's `defaultCompiler` from list_languages.libraries— array — Libraries to link.maxAsmLines— integer — Cap asm output (default 500 lines).maxStderrLines— integer — Cap each stderr stream — compile and execute separately (default 100).maxStdoutLines— integer — Cap each stdout stream — compile and execute separately (default 100).
Hints: read-only yes · destructive not declared · idempotent not declared · open-world no
list_compilersread-onlyList available compilers, optionally filtered by language
Parameters:
lean— boolean — Force id+name only, regardless of count. Useful to browse the catalog before drilling in.match— string — Case-insensitive AND-of-tokens filter on id and name. Punctuation splits tokens; numeric tokens match whole-word ("gcc 14.1" matches "14.1.0" not "14.10"); alphanumeric tokens substring-match ("g14" matches "g142"). Literal text only — for "newest version" use `latestPerMajor`; for "newest X on arch Y" prefer `instructionSet` + `latestPerMajor`.language— string — Language ID to filter by (e.g. "c++", "rust", "python")maxResults— integer — Cap full-detail entries (default 25). Beyond the cap, degrades to lean (id+name only) with a refinement hint.instructionSet— string — Target architecture filter. Combine with `latestPerMajor: true` for "newest X for arch Y" (e.g. `{language:"c++", instructionSet:"amd64", latestPerMajor:true}`).latestPerMajor— boolean — "Newest X" filter. By release track (stable/nightly/prerelease/experimental): newest stable per (language, instructionSet, semver major); all nightly + prerelease; experimental skipped unless `includeExperimental: true`.includeExperimental— boolean — With `latestPerMajor: true`, also include experimental compilers (c++ proposal forks, llvm-mos platform variants). Off by default — bloats "newest X" answers.
Hints: read-only yes · destructive not declared · idempotent not declared · open-world no
list_languagesread-onlyList supported languages. Each entry has `defaultCompiler` and `compilerCount`.
Hints: read-only yes · destructive not declared · idempotent not declared · open-world no
list_librariesread-onlyList available libraries for a given programming language
Parameters:
language(required) — string — Language ID (e.g. "c++", "rust")lean— boolean — Force id+name only, regardless of count. Useful to browse the catalog before drilling in.match— string — Case-insensitive AND-of-tokens filter on id, name, and version strings (so "boost 1.88" finds Boost when one of its versions matches 1.88.x). Numeric tokens match version-prefix; alphanumeric substring.maxResults— integer — Cap full-detail entries (default 25). Beyond the cap, degrades to lean (id+name only) with a refinement hint.
Hints: read-only yes · destructive not declared · idempotent not declared · open-world no
lookup_asm_instructionread-onlyLook up documentation for an assembly instruction
Parameters:
instruction_set(required) — string — Instruction set architecture (no default — must match the asm dialect being looked up).opcode(required) — string — Assembly instruction mnemonic (e.g. "MOV", "ADD", "JMP")
Hints: read-only yes · destructive not declared · idempotent not declared · open-world no
generate_short_urlCreate a Compiler Explorer short URL for sharing code with compiler settings
Parameters:
source(required) — string — Source codelanguage(required) — string — Language ID (e.g. "c++", "c", "rust")compiler(required) — string — Compiler ID from list_compilers (e.g. "g161", "clang_trunk")options— string — Compiler flags (e.g. "-O2 -std=c++20")libraries— array — Libraries to include.
Hints: read-only no · destructive no · idempotent yes · open-world no
get_shortlink_inforead-onlyRetrieve source and compiler config from a CE short URL. Compiler entries are returned in the `compile` tool's shape ({compiler, options, libraries:[{id, version}]}). Multi-pane shortlinks (executors, conformance views, CMake trees, per-compiler filters/tools) are flattened — only the basic compile inputs survive.
Parameters:
id(required) — string — Short link ID or full URL (e.g. "G38YP7eW4" or "https://godbolt.org/z/G38YP7eW4")
Hints: read-only yes · destructive not declared · idempotent not declared · open-world no
Measured by MCPYP probing. Untested fields are omitted, never estimated. Listing is always free; MCPYP never proxies calls or stores user tokens.