Compile code with thousands of compilers, inspect the assembly, and share godbolt.org links
Maintain this server? Claim it
Call this server's tools from your browser. Nothing to install.
Requests go through mcptry because browsers can't call most MCP servers directly. Header values are sent to the server for that request only and are never stored or logged.
Tool list from our last check. Connect live to refresh it.
Compile source code and return assembly output, stdout, and stderr
Source code to compile
Language ID (e.g. "c++", "c", "rust", "python")
Standard input for execution (requires execute=true)
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`.
Output filters
Compiler flags (e.g. "-O2 -std=c++20 -Wall")
Compiler ID from list_compilers (e.g. "g161"). If omitted, uses the language's `defaultCompiler` from list_languages.
Libraries to link.
Cap asm output (default 500 lines).
Cap each stderr stream — compile and execute separately (default 100).
Cap each stdout stream — compile and execute separately (default 100).
Compile source code and return assembly output, stdout, and stderr
| Argument | Type | Description |
|---|---|---|
| stdin | string | Standard input for execution (requires execute=true) |
| source* | string | Source code to compile |
| 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 filters |
| options | 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. |
| language* | string | Language ID (e.g. "c++", "c", "rust", "python") |
| 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). |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"source",
"language"
],
"properties": {
"stdin": {
"type": "string",
"description": "Standard input for execution (requires execute=true)"
},
"source": {
"type": "string",
"description": "Source code to compile"
},
"execute": {
"type": "boolean",
"description": "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": {
"type": "object",
"properties": {
"trim": {
"type": "boolean",
"description": "Trim whitespace (default: false)"
},
"intel": {
"type": "boolean",
"description": "Use Intel assembly syntax (default: true)"
},
"labels": {
"type": "boolean",
"description": "Filter unused labels (default: true)"
},
"demangle": {
"type": "boolean",
"description": "Demangle symbol names (default: true)"
},
"directives": {
"type": "boolean",
"description": "Filter assembler directives (default: true)"
},
"commentOnly": {
"type": "boolean",
"description": "Filter comment-only lines (default: true)"
},
"libraryCode": {
"type": "boolean",
"description": "Filter library code (default: false)"
}
},
"description": "Output filters"
},
"options": {
"type": "string",
"description": "Compiler flags (e.g. \"-O2 -std=c++20 -Wall\")"
},
"compiler": {
"type": "string",
"description": "Compiler ID from list_compilers (e.g. \"g161\"). If omitted, uses the language's `defaultCompiler` from list_languages."
},
"language": {
"type": "string",
"description": "Language ID (e.g. \"c++\", \"c\", \"rust\", \"python\")"
},
"libraries": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"version"
],
"properties": {
"id": {
"type": "string",
"description": "Library ID from list_libraries (e.g. \"boost\")."
},
"version": {
"type": "string",
"description": "Version id (\"188\") OR human form (\"1.88.0\") — both accepted."
}
}
},
"description": "Libraries to link."
},
"maxAsmLines": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Cap asm output (default 500 lines).",
"exclusiveMinimum": 0
},
"maxStderrLines": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Cap each stderr stream — compile and execute separately (default 100).",
"exclusiveMinimum": 0
},
"maxStdoutLines": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Cap each stdout stream — compile and execute separately (default 100).",
"exclusiveMinimum": 0
}
}
}Create a Compiler Explorer short URL for sharing code with compiler settings
| Argument | Type | Description |
|---|---|---|
| source* | string | Source code |
| options | string | Compiler flags (e.g. "-O2 -std=c++20") |
| compiler* | string | Compiler ID from list_compilers (e.g. "g161", "clang_trunk") |
| language* | string | Language ID (e.g. "c++", "c", "rust") |
| libraries | array | Libraries to include. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"source",
"language",
"compiler"
],
"properties": {
"source": {
"type": "string",
"description": "Source code"
},
"options": {
"type": "string",
"description": "Compiler flags (e.g. \"-O2 -std=c++20\")"
},
"compiler": {
"type": "string",
"description": "Compiler ID from list_compilers (e.g. \"g161\", \"clang_trunk\")"
},
"language": {
"type": "string",
"description": "Language ID (e.g. \"c++\", \"c\", \"rust\")"
},
"libraries": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"version"
],
"properties": {
"id": {
"type": "string",
"description": "Library ID from list_libraries."
},
"version": {
"type": "string",
"description": "Version id (\"188\") OR human form (\"1.88.0\")."
}
}
},
"description": "Libraries to include."
}
}
}Retrieve 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.
| Argument | Type | Description |
|---|---|---|
| id* | string | Short link ID or full URL (e.g. "G38YP7eW4" or "https://godbolt.org/z/G38YP7eW4") |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"description": "Short link ID or full URL (e.g. \"G38YP7eW4\" or \"https://godbolt.org/z/G38YP7eW4\")"
}
}
}List available compilers, optionally filtered by language
| Argument | Type | Description |
|---|---|---|
| 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`. |
List supported languages. Each entry has `defaultCompiler` and `compilerCount`.
No arguments.
{
"type": "object",
"properties": {}
}List available libraries for a given programming language
| Argument | Type | Description |
|---|---|---|
| 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. |
| language* | string | Language ID (e.g. "c++", "rust") |
| maxResults | integer | Cap full-detail entries (default 25). Beyond the cap, degrades to lean (id+name only) with a refinement hint. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"language"
],
"properties": {
"lean": {
"type": "boolean",
"description": "Force id+name only, regardless of count. Useful to browse the catalog before drilling in."
},
"match": {
"type": "string",
"description": "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."
},
"language": {
"type": "string",
"description": "Language ID (e.g. \"c++\", \"rust\")"
},
"maxResults": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Cap full-detail entries (default 25). Beyond the cap, degrades to lean (id+name only) with a refinement hint.",
"exclusiveMinimum": 0
}
}
}Look up documentation for an assembly instruction
| Argument | Type | Description |
|---|---|---|
| opcode* | string | Assembly instruction mnemonic (e.g. "MOV", "ADD", "JMP") |
| instruction_set* | string | Instruction set architecture (no default — must match the asm dialect being looked up). |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"instruction_set",
"opcode"
],
"properties": {
"opcode": {
"type": "string",
"description": "Assembly instruction mnemonic (e.g. \"MOV\", \"ADD\", \"JMP\")"
},
"instruction_set": {
"enum": [
"6502",
"aarch64",
"amd64",
"amd_cdna1",
"amd_cdna2",
"amd_cdna3",
"amd_cdna4",
"amd_cdna5",
"amd_rdna1",
"amd_rdna2",
"amd_rdna3",
"amd_rdna3_5",
"amd_rdna4",
"arm32",
"avr",
"evm",
"java",
"llvm",
"perl",
"powerpc",
"ptx",
"python",
"riscv64",
"sass",
"wdc65c816"
],
"type": "string",
"description": "Instruction set architecture (no default — must match the asm dialect being looked up)."
}
}
}| includeExperimental |
| boolean |
| With `latestPerMajor: true`, also include experimental compilers (c++ proposal forks, llvm-mos platform variants). Off by default — bloats "newest X" answers. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"lean": {
"type": "boolean",
"description": "Force id+name only, regardless of count. Useful to browse the catalog before drilling in."
},
"match": {
"type": "string",
"description": "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": {
"type": "string",
"description": "Language ID to filter by (e.g. \"c++\", \"rust\", \"python\")"
},
"maxResults": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Cap full-detail entries (default 25). Beyond the cap, degrades to lean (id+name only) with a refinement hint.",
"exclusiveMinimum": 0
},
"instructionSet": {
"enum": [
"6502",
"aarch64",
"amd64",
"x86",
"arm32",
"avr",
"beam",
"c6x",
"dex",
"ebpf",
"evm",
"eravm",
"ez80",
"hook",
"hppa",
"core",
"java",
"kvx",
"llvm",
"loongarch",
"m68k",
"mips",
"mos6502",
"mpy",
"mrisc32",
"msp430",
"perl",
"powerpc",
"ptx",
"python",
"amd_cdna1",
"amd_cdna2",
"amd_cdna3",
"amd_cdna4",
"amd_cdna5",
"amd_rdna1",
"amd_rdna2",
"amd_rdna3",
"amd_rdna3_5",
"amd_rdna4",
"riscv32",
"riscv64",
"s390x",
"sass",
"sh",
"sm83",
"sparc",
"spirv",
"vax",
"wasm32",
"wasm64",
"wdc65c816",
"xtensa",
"z180",
"z80"
],
"type": "string",
"description": "Target architecture filter. Combine with `latestPerMajor: true` for \"newest X for arch Y\" (e.g. `{language:\"c++\", instructionSet:\"amd64\", latestPerMajor:true}`)."
},
"latestPerMajor": {
"type": "boolean",
"description": "\"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": {
"type": "boolean",
"description": "With `latestPerMajor: true`, also include experimental compilers (c++ proposal forks, llvm-mos platform variants). Off by default — bloats \"newest X\" answers."
}
}
}