Compiler Explorer is an MCP server published by io.github.compiler-explorer, hosted at godbolt.org. When last checked on 2026-11-21 it was working: it answers and lists its tools. It declares 7 tools, including compile, list_compilers, list_languages, list_libraries, lookup_asm_instruction.
Compile code with thousands of compilers, inspect the assembly, and share godbolt.org links
2 connections through 5 shared values. Tap any node.
Compile source code and return assembly output, stdout, and stderr
| Parameter | 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. |
None yet. Changes appear after a server's second daily check.
Squares are this server's values; dots are other servers sharing them. A shared address or publisher is a lead, not proof of a common operator.
Inferred from the host name and headers: what a server runs on, not who runs it.
| 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). |
{
"name": "compile",
"description": "Compile source code and return assembly output, stdout, and stderr",
"inputSchema": {
"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
}
}
},
"annotations": {
"title": "Compile (and optionally execute) source code",
"readOnlyHint": true,
"openWorldHint": false,
"destructiveHint": false
}
}List available compilers, optionally filtered by language
| Parameter | 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… |
| 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. |
{
"name": "list_compilers",
"description": "List available compilers, optionally filtered by language",
"inputSchema": {
"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",
"hexagon",
"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."
}
}
},
"annotations": {
"title": "List compilers",
"readOnlyHint": true,
"openWorldHint": false,
"destructiveHint": false
}
}List supported languages. Each entry has `defaultCompiler` and `compilerCount`.
No parameters.
{
"name": "list_languages",
"description": "List supported languages. Each entry has `defaultCompiler` and `compilerCount`.",
"inputSchema": {
"type": "object",
"properties": {}
},
"annotations": {
"title": "List languages",
"readOnlyHint": true,
"openWorldHint": false,
"destructiveHint": false
}
}List available libraries for a given programming language
| Parameter | 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. |
{
"name": "list_libraries",
"description": "List available libraries for a given programming language",
"inputSchema": {
"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
}
}
},
"annotations": {
"title": "List libraries",
"readOnlyHint": true,
"openWorldHint": false,
"destructiveHint": false
}
}Look up documentation for an assembly instruction
| Parameter | 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). |
{
"name": "lookup_asm_instruction",
"description": "Look up documentation for an assembly instruction",
"inputSchema": {
"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)."
}
}
},
"annotations": {
"title": "Look up assembly instruction",
"readOnlyHint": true,
"openWorldHint": false,
"destructiveHint": false
}
}Create a Compiler Explorer short URL for sharing code with compiler settings
| Parameter | 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. |
{
"name": "generate_short_url",
"description": "Create a Compiler Explorer short URL for sharing code with compiler settings",
"inputSchema": {
"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."
}
}
},
"annotations": {
"title": "Generate Compiler Explorer short URL",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}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.
| Parameter | Type | Description |
|---|---|---|
| id * | string | Short link ID or full URL (e.g. "G38YP7eW4" or "https://godbolt.org/z/G38YP7eW4") |
{
"name": "get_shortlink_info",
"description": "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.",
"inputSchema": {
"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\")"
}
}
},
"annotations": {
"title": "Get Compiler Explorer short URL info",
"readOnlyHint": true,
"openWorldHint": false,
"destructiveHint": false
}
}Names, descriptions and schemas were written by the server and are shown as data.