Compiler Explorer
Compile code with thousands of compilers, inspect the assembly, and share godbolt.org links
Sollte ich dies verwenden
Qualität und Sicherheit
Befunde (2)
- LOWin lookup_asm_instruction
- LOWin generate_short_url
Basierend auf einer automatisierten Analyse der Tool-Definitionen und der Einhaltung des Protokolls.
Kontextkosten
Dies ist die ungefähre Anzahl der Tokens, die jedes Mal verbraucht werden, wenn die Tools des Servers in den Kontext eines Modells geladen werden. Höhere Werte verringern die Aufmerksamkeit, die für andere Aufgaben verfügbar ist.
Installieren
Installation mit einem Klick
Fügen Sie dies Ihrer Datei `claude_desktop_config.json` hinzu:
{
"mcpServers": {
"compiler-explorer": {
"url": "https://godbolt.org/mcp"
}
}
}Remote-Endpunkte
https://godbolt.org/mcpstreamable-httpWas es kann
Tool-Inventar
Tools (7)
🟢compile(source, language, compiler, options, execute, ...)
Compile source code and return assembly output, stdout, and stderr
Eingabe-Schema
{
"type": "object",
"properties": {
"source": {
"type": "string",
"description": "Source code to compile"
},
"language": {
"type": "string",
"description": "Language ID (e.g. \"c++\", \"c\", \"rust\", \"python\")"
},
"compiler": {
"description": "Compiler ID from list_compilers (e.g. \"g161\"). If omitted, uses the language's `defaultCompiler` from list_languages.",
"type": "string"
},
"options": {
"description": "Compiler flags (e.g. \"-O2 -std=c++20 -Wall\")",
"type": "string"
},
"execute": {
"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`.",
"type": "boolean"
},
"stdin": {
"description": "Standard input for execution (requires execute=true)",
"type": "string"
},
"filters": {
"description": "Output filters",
"type": "object",
"properties": {
"intel": {
"description": "Use Intel assembly syntax (default: true)",
"type": "boolean"
},
"demangle": {
"description": "Demangle symbol names (default: true)",
"type": "boolean"
},
"directives": {
"description": "Filter assembler directives (default: true)",
"type": "boolean"
},
"commentOnly": {
"description": "Filter comment-only lines (default: true)",
"type": "boolean"
},
"labels": {
"description": "Filter unused labels (default: true)",
"type": "boolean"
},
"libraryCode": {
"description": "Filter library code (default: false)",
"type": "boolean"
},
"trim": {
"description": "Trim whitespace (default: false)",
"type": "boolean"
}
}
},
"libraries": {
"description": "Libraries to link.",
"type": "array",
"items": {
"type": "object",
"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."
}
},
"required": [
"id",
"version"
]
}
},
"maxAsmLines": {
"description": "Cap asm output (default 500 lines).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"maxStdoutLines": {
"description": "Cap each stdout stream — compile and execute separately (default 100).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"maxStderrLines": {
"description": "Cap each stderr stream — compile and execute separately (default 100).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"source",
"language"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢list_compilers(language, instructionSet, match, maxResults, lean, ...)
List available compilers, optionally filtered by language
Eingabe-Schema
{
"type": "object",
"properties": {
"language": {
"description": "Language ID to filter by (e.g. \"c++\", \"rust\", \"python\")",
"type": "string"
},
"instructionSet": {
"description": "Target architecture filter. Combine with `latestPerMajor: true` for \"newest X for arch Y\" (e.g. `{language:\"c++\", instructionSet:\"amd64\", latestPerMajor:true}`).",
"type": "string",
"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",
"sparc",
"spirv",
"vax",
"wasm32",
"wasm64",
"wdc65c816",
"xtensa",
"z180",
"z80"
]
},
"match": {
"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`.",
"type": "string"
},
"maxResults": {
"description": "Cap full-detail entries (default 25). Beyond the cap, degrades to lean (id+name only) with a refinement hint.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"lean": {
"description": "Force id+name only, regardless of count. Useful to browse the catalog before drilling in.",
"type": "boolean"
},
"latestPerMajor": {
"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`.",
"type": "boolean"
},
"includeExperimental": {
"description": "With `latestPerMajor: true`, also include experimental compilers (c++ proposal forks, llvm-mos platform variants). Off by default — bloats \"newest X\" answers.",
"type": "boolean"
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢list_languages
List supported languages. Each entry has `defaultCompiler` and `compilerCount`.
Eingabe-Schema
{
"type": "object",
"properties": {}
}🟢list_libraries(language, match, maxResults, lean)
List available libraries for a given programming language
Eingabe-Schema
{
"type": "object",
"properties": {
"language": {
"type": "string",
"description": "Language ID (e.g. \"c++\", \"rust\")"
},
"match": {
"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.",
"type": "string"
},
"maxResults": {
"description": "Cap full-detail entries (default 25). Beyond the cap, degrades to lean (id+name only) with a refinement hint.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"lean": {
"description": "Force id+name only, regardless of count. Useful to browse the catalog before drilling in.",
"type": "boolean"
}
},
"required": [
"language"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢lookup_asm_instruction(instruction_set, opcode)
Look up documentation for an assembly instruction
Eingabe-Schema
{
"type": "object",
"properties": {
"instruction_set": {
"type": "string",
"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"
],
"description": "Instruction set architecture (no default — must match the asm dialect being looked up)."
},
"opcode": {
"type": "string",
"description": "Assembly instruction mnemonic (e.g. \"MOV\", \"ADD\", \"JMP\")"
}
},
"required": [
"instruction_set",
"opcode"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}🟡generate_short_url(source, language, compiler, options, libraries)
Create a Compiler Explorer short URL for sharing code with compiler settings
Eingabe-Schema
{
"type": "object",
"properties": {
"source": {
"type": "string",
"description": "Source code"
},
"language": {
"type": "string",
"description": "Language ID (e.g. \"c++\", \"c\", \"rust\")"
},
"compiler": {
"type": "string",
"description": "Compiler ID from list_compilers (e.g. \"g161\", \"clang_trunk\")"
},
"options": {
"description": "Compiler flags (e.g. \"-O2 -std=c++20\")",
"type": "string"
},
"libraries": {
"description": "Libraries to include.",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Library ID from list_libraries."
},
"version": {
"type": "string",
"description": "Version id (\"188\") OR human form (\"1.88.0\")."
}
},
"required": [
"id",
"version"
]
}
}
},
"required": [
"source",
"language",
"compiler"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢get_shortlink_info(id)
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.
Eingabe-Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Short link ID or full URL (e.g. \"G38YP7eW4\" or \"https://godbolt.org/z/G38YP7eW4\")"
}
},
"required": [
"id"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}Community
Nachweis