MCP.so
Sign In

Compiler Explorer MCP Server

@Compiler Explorer

Basic information

Transport

streamable-http

Authentication

Check provider docs

Category

Developer Tools

Author

Compiler Explorer

About Compiler Explorer MCP Server

Compiler Explorer (godbolt.org) ships a built-in MCP server that lets AI clients list languages, compilers and libraries, compile or run source and read the assembly output, look up assembly instruction docs and create or resolve short URLs. It is free to use with no authentication.

#compiler#assembly#godbolt#c++#developer-tools

Connection details

https://compiler-explorer.com/mcp

Setup

claude mcp add compiler-explorer --transport http https://compiler-explorer.com/mcp

Compiler Explorer MCP Server tools

7

Compile source code and return assembly output, stdout, and stderr

List available compilers, optionally filtered by language

List supported languages. Each entry has `defaultCompiler` and `compilerCount`.

List available libraries for a given programming language

Look up documentation for an assembly instruction

Create a Compiler Explorer short URL for sharing code with compiler settings

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.

Overview

What is Compiler Explorer MCP Server?

Compiler Explorer MCP Server is the built-in, unauthenticated MCP endpoint of Compiler Explorer (godbolt.org). It lets AI assistants list compilers, compile or run code, read the generated assembly and share results as Compiler Explorer short links.

Compiler Explorer is a web tool for seeing what compilers turn your code into, across many languages, compilers and versions. Its MCP server lets LLM clients drive it the way the web UI does. Compiler Explorer's docs give the URL as https://godbolt.org/mcp. The listing URL here, https://compiler-explorer.com/mcp, is the same public deployment on Compiler Explorer's other domain and returns the same tools. The server is also in the official MCP Registry as io.github.compiler-explorer/compiler-explorer.

How to use Compiler Explorer MCP Server?

There is nothing to install and no API key. The endpoint is stateless Streamable HTTP: each tool call is one JSON-RPC POST with no session ID. Opening the URL in a browser (a GET) returns 405 Method Not Allowed, which is expected.

Claude Code

claude mcp add --transport http compiler-explorer https://compiler-explorer.com/mcp

The docs show the same command with https://godbolt.org/mcp; either URL works.

Claude Desktop and claude.ai

Go to Settings → Connectors → Add custom connector and paste https://compiler-explorer.com/mcp. No sign-in is needed.

Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "compiler-explorer": {
      "url": "https://compiler-explorer.com/mcp"
    }
  }
}

VS Code

Add to .vscode/mcp.json:

{
  "servers": {
    "compiler-explorer": {
      "type": "http",
      "url": "https://compiler-explorer.com/mcp"
    }
  }
}

Self-hosted Compiler Explorer instances expose the same endpoint at <your-ce-host>/mcp.

Key features of Compiler Explorer MCP Server

  • Official and built into every Compiler Explorer deployment, next to the public REST API.
  • No authentication and no local install.
  • Stateless Streamable HTTP, so it works with any client that supports remote MCP servers.
  • Compile against Compiler Explorer's catalogue of languages, compilers and libraries, and optionally execute the program in its ephemeral sandbox.
  • Assembly instruction documentation for instruction sets such as amd64, arm64 and riscv.
  • Round-trips https://godbolt.org/z/... short links, so an agent can open a link someone shared, recompile it or create a new one.
  • Every tool carries MCP annotations (read-only or idempotent hints).

Compiler Explorer MCP Server tools

The probe returned seven tools, in three groups:

  • Discovery: list_languages returns each language with its defaultCompiler and compilerCount. list_compilers filters by language, instruction set or free-text match, and its latestPerMajor flag keeps only the newest stable compiler per major version (lean: true returns only IDs and names). list_libraries lists libraries for a language.
  • Compiling: compile takes source, a compiler ID, options and libraries, and returns assembly, stdout and stderr. With execute: true it also runs the program. Output is capped by default at 500 assembly lines and 100 lines each of stdout and stderr; raise maxAsmLines, maxStdoutLines or maxStderrLines for more. lookup_asm_instruction explains a mnemonic.
  • Sharing: generate_short_url saves source and compiler settings as a short link; repeat calls with the same payload return the same URL. get_shortlink_info turns a short link back into source plus compiler config in the shape compile accepts.

Use cases of Compiler Explorer MCP Server

  • Optimization checks: "Compile this loop with GCC and Clang at -O2 and tell me whether it vectorizes."
  • Learning assembly: "What does vpermq do on amd64?"
  • Version comparisons: "Does this C++23 snippet compile on the latest Clang and GCC?"
  • Running small programs: "Compile and execute this Rust function and show me the output."
  • Bug reports: "Make a godbolt short link that reproduces this miscompilation."
  • Reviewing shared links: "Open https://godbolt.org/z/... and explain the difference between the two compilers."

Troubleshooting Compiler Explorer MCP Server

  • The URL shows "Method Not Allowed" in a browser. The endpoint only accepts POST (and OPTIONS for CORS). Use it from an MCP client.
  • Output is cut off. compile caps output lines by default. Raise maxAsmLines, maxStdoutLines or maxStderrLines.
  • An error comes back as plain text. Failed calls set isError: true with a readable message such as Compilation error: ... or Short link "abc" not found.
  • A shared link loses its executor or CMake panes. get_shortlink_info flattens multi-pane links to the basic compile inputs.

Frequently asked questions

1

Is the Compiler Explorer MCP Server official?

Yes. It is part of the open-source Compiler Explorer project, documented in its `docs/MCP.md`, and listed in the official MCP Registry.

2

Do I need an API key or account?

No. The endpoint is unauthenticated and sits alongside Compiler Explorer's public REST API.

3

Should I use godbolt.org/mcp or compiler-explorer.com/mcp?

Both reach the same public Compiler Explorer service. The docs use `https://godbolt.org/mcp`, and short links come back in the `godbolt.org/z/...` form.

4

Can it run my code, not just compile it?

Yes. Pass `execute: true` to `compile` and the program runs in Compiler Explorer's ephemeral sandbox. Effects do not escape the call.

5

Does it work with Claude Code, Cursor and VS Code?

Yes. It is a standard stateless Streamable HTTP server, so any client that supports remote MCP servers can use it with the configs above.

6

Can I point it at my own Compiler Explorer instance?

Yes. Self-hosted deployments serve the same endpoint at `<your-ce-host>/mcp`.

7

What is the Compiler Explorer remote MCP server?

The Compiler Explorer remote MCP server is a hosted Model Context Protocol endpoint at https://compiler-explorer.com/mcp, so AI assistants can connect to it without installing or running anything locally.

8

How do I connect to the Compiler Explorer MCP server?

Add the endpoint https://compiler-explorer.com/mcp to any MCP-compatible client such as Claude Code, Cursor, or VS Code. The setup snippets on this page configure each client in one step.

9

Does the Compiler Explorer MCP server require authentication?

Authentication requirements for Compiler Explorer have not been confirmed in this listing. Check the provider’s documentation before connecting.

10

Which transport does the Compiler Explorer MCP server use?

Compiler Explorer exposes a streamable-http endpoint, the transport used by remote MCP servers and supported by all major MCP clients.

Comments