Compiler Explorer

Compile and run code on godbolt.org's compilers, read the assembly, and make or open share links

Official · Compiler Explorer TypeScript Remote (hosted) · Streamable HTTP Developer tools

59 popularity score ★ 19k

Connect your client

Remote (hosted)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude Codeterminal
claude mcp add --transport http compiler-explorer https://godbolt.org/mcp
Claude (desktop and web)Settings → Connectors → Add custom connector
https://godbolt.org/mcp

What it does

Compiler Explorer (godbolt.org) has an MCP endpoint built into the site itself, so an assistant can do what a person does in the web UI: pick a language and compiler, compile a snippet with chosen flags and libraries, read the generated assembly, and optionally run the program. It can also explain an assembly mnemonic for a given instruction set, turn a session into a godbolt.org/z/ short link, and load an existing short link back into source and compiler settings so it can be compiled again.

There is nothing to install: the public endpoint at https://godbolt.org/mcp speaks stateless Streamable HTTP and asks for no sign-in. Anyone running their own Compiler Explorer instance gets the same endpoint at <host>/mcp, using the compilers configured on that instance.

Seven tools are registered in lib/mcp/index.ts. list_compilers returns full details for 25 compilers by default (DEFAULT_MAX_RESULTS in lib/mcp/tools/compilers.ts); past that cap it falls back to id and name only unless maxResults is raised, and its latestPerMajor option narrows the list to the newest stable release per major version.

What it needs

For the public endpoint: an MCP client that supports remote Streamable HTTP servers and network access to godbolt.org. No account or key. To self-host: a Compiler Explorer checkout run with make on Linux, Node.js at the version pinned in .node-version or newer, and the compilers you want configured; the endpoint is then at <your-host>/mcp.

Limits

Output from compile is capped by line count by default: 500 lines of assembly, 100 of stdout and 100 of stderr; raise maxAsmLines, maxStdoutLines or maxStderrLines for more. Only POST is accepted; GET and DELETE return 405, and there are no sessions. Shortlinks with several panes (executors, conformance views, CMake projects) are flattened to basic compile inputs by get_shortlink_info. The public site's compilers and execution sandbox are what the hosted endpoint offers; code runs on Compiler Explorer's servers, not yours.

Who it suits

Suits developers who want an assistant to check what a compiler generates, compare flags or compiler versions, test a small program across toolchains, or share a reproducible godbolt.org link, without installing compilers locally. Because the hosted endpoint needs no sign-in, it fits quick setup in any client that takes a remote URL. It works on snippets, not on a local project: it cannot read your files or build with your own toolchain, so for whole-repo builds use local tools instead. Teams that cannot send source to a public service can run their own Compiler Explorer and point clients at its /mcp.

Tools 7

list_languages
Lists supported languages with each one's default compiler and compiler count
list_compilers
Lists compilers, filtered by language, instruction set or text, optionally newest per major version
list_libraries
Lists the libraries available for a language
compile
Compiles source with a chosen compiler, flags and libraries, and can run the result in a sandbox
lookup_asm_instruction
Returns documentation for an assembly mnemonic in a given instruction set
generate_short_url
Saves source and compiler settings as a godbolt.org/z/ short link
get_shortlink_info
Turns a short link or id back into source and compiler settings ready to compile

Similar servers