Lists CE's public MCP endpoint (`https://godbolt.org/mcp`) in the [official MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.compiler-explorer/compiler-explorer`. ### What's here - `server.json` — the registry record. Validated with `mcp-publisher validate` against the live registry. - `docs/MCP.md` — a "Registry listing" section covering how and when to re-publish. ### Notes for review **Publishing is deliberately not wired to a deploy.** The registry stores metadata only — it records where the endpoint is, not what's running behind it. Nothing in the record changes when the site updates, and the registry rejects a repeat of an existing version, so a publish on every deploy would simply fail. `server.json`'s `version` identifies the *metadata record*; it's unrelated to `gh-NNNNN` build numbers. Re-publish by hand on the rare occasion the file changes (documented in `docs/MCP.md`). No CI workflow, and no infra changes. **The namespace comes from GitHub org ownership**, not DNS — `io.github.compiler-explorer/*` is granted to Owners/admins of the org, so no TXT records or `.well-known` files are involved. It was chosen over `org.godbolt/*` because the GitHub identity has exactly one name, sidestepping the godbolt.org / compiler-explorer.com question. **`name` is the one field that can't be changed later.** The URL, description and icon all live in a versioned record and can be updated by bumping the version and re-publishing — worth a second look at that line specifically. Not yet published — that needs a `mcp-publisher login github` device-code auth from an org admin. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
5.0 KiB
MCP endpoint
Compiler Explorer ships a built-in Model Context Protocol server that lets LLM clients drive CE the same way the web UI does: list languages and compilers, compile (and optionally execute) source, look up assembly instruction docs, and round-trip short URLs.
The endpoint is unauthenticated and lives alongside the public REST API on every CE deployment.
Connection details
- URL:
https://godbolt.org/mcp(or<your-ce-host>/mcpfor self-hosted). - Transport: Streamable HTTP, stateless (one JSON-RPC POST per call, no session id).
- Methods accepted:
POSTfor tool calls;OPTIONSfor CORS preflight.GETandDELETEreturn405 Method Not Allowed. - Auth: none.
Using it from a Claude client
In Claude Desktop or Claude Code, add a custom HTTP MCP server pointing at
https://godbolt.org/mcp. No credentials required.
For Claude Code on the command line:
claude mcp add --transport http compiler-explorer https://godbolt.org/mcp
Registry listing
The server is listed in the official MCP Registry
as io.github.compiler-explorer/compiler-explorer. The registry stores metadata only — it
records where the endpoint lives, not what is running behind it — so publishing is deliberately
not part of a deploy. Nothing here changes when the site updates.
The published record is server.json in the repository root. Re-publish only
when that file changes:
-
Edit
server.jsonand bump itsversion. Published versions are immutable and the registry rejects a repeat of one that already exists. It versions the metadata record, and has nothing to do with CE'sgh-NNNNNbuild numbers. -
Install
mcp-publisherand run:mcp-publisher login github # requires Owner/admin on the compiler-explorer org mcp-publisher validate mcp-publisher publish
The io.github.compiler-explorer/* namespace is granted by GitHub org ownership, so no DNS
records or domain proofs are involved.
Tools
Successful responses are JSON in a single text content block. Error responses set
isError: true and put a plain-text human-readable message in the same block (not
a JSON envelope) — e.g. Short link "abc" not found, Compilation error: ....
list_languages
Returns every supported language, with its default compiler id and the number of compilers that target it. Read-only.
list_compilers
List compilers, optionally filtered by language, instructionSet, or a free-text
match. The latestPerMajor flag reduces the firehose to "newest stable per
(language, arch, semver major), all nightly + prerelease, no experimentals" — the
right default when an LLM is picking a compiler. lean: true drops everything but
id and name. Read-only.
list_libraries
List libraries available for a given language, with the same match/maxResults/lean
controls as list_compilers. Read-only.
compile
Compile a source string with a chosen compiler and options, optionally linking
libraries and optionally executing the result. With execute: true the program
runs in CE's ephemeral sandbox; runtime output appears at the top level and the
compile diagnostics move to buildResult. Output is line-capped (defaults: 500 asm,
100 stdout, 100 stderr) — raise the maxAsmLines / maxStdoutLines / maxStderrLines
caps to retrieve more. Read-only from the connector's point of view; sandbox effects
do not escape the call.
lookup_asm_instruction
Retrieve documentation for an assembly mnemonic in a given instruction set
(amd64, arm64, riscv, …). Read-only.
generate_short_url
Persist a Compiler Explorer short URL that captures source, language, compiler, options,
and libraries, and return its https://godbolt.org/z/... form. Additive only — repeat
calls with the same payload return the same URL (the storage layer dedupes by config
hash). Marked as a write tool with idempotentHint: true.
get_shortlink_info
Resolve an https://godbolt.org/z/<id> URL (or just the id) back into source plus
compiler config. The returned compiler entries use the same shape compile accepts
({compiler, options, libraries:[{id, version}]}), so a shortlink can be re-compiled
without translation. Multi-pane shortlinks (executors, conformance views, CMake trees)
are flattened to the basic compile inputs. Read-only.
Notes for tool authors
- All tools carry MCP
annotations(title,readOnlyHint/destructiveHint,openWorldHint: false); seelib/mcp/tools/*.ts. - The server uses
StreamableHTTPServerTransportin stateless mode (sessionIdGenerator: undefined). Each POST is a complete request/response cycle. - Tool implementations live in
lib/mcp/tools/and are wired up inlib/mcp/index.ts. Tests live intest/mcp/.
Reporting issues
File MCP-specific bugs at https://github.com/compiler-explorer/compiler-explorer/issues.