Feedback

Compiler Explorer MCP Server

@compiler explorer Claim

Basic information

Transport
Streamable HTTP
Authentication
None
Runtime
TypeScript
Version
1.0.0
Category
Author
compiler explorer
Quality
100 (A+)
Views
108

About Compiler Explorer MCP Server

Built-in, no-auth MCP endpoint that lets AI agents compile code, read assembly and share Compiler Explorer links.

Compiler Explorer is a remote MCP server in the Developer Tools category listed in the AddMCP.net directory, published by Compiler Explorer. It exposes 7 tools, including compile, list_compilers, list_languages, list_libraries and more. Supported transport: Streamable HTTP. Runtime: TypeScript. License: BSD-2-Clause. The repository has 19,171 GitHub stars. Source code is hosted on github.com. Related topics: assembly, c, c-plus-plus, compiler, cpp.

Connection details

https://compiler-explorer.com/mcp

Setup

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

Compiler Explorer MCP Server config

Add this server to your MCP-compatible client using the configuration below.

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

Compiler Explorer MCP Server tools

  • compile — Compile source code and return assembly output, stdout, and stderr
    source:string*, language:string*, compiler:string, options:string, execute:boolean, stdin:string, filters:object, libraries:array, maxAsmLines:integer, maxStdoutLines:integer, maxStderrLines:integer
  • list_compilers — List available compilers, optionally filtered by language
    language:string, instructionSet:string, match:string, maxResults:integer, lean:boolean, latestPerMajor:boolean, includeExperimental:boolean
  • list_languages — List supported languages. Each entry has `defaultCompiler` and `compilerCount`.
    (no parameters)
  • list_libraries — List available libraries for a given programming language
    language:string*, match:string, maxResults:integer, lean:boolean
  • lookup_asm_instruction — Look up documentation for an assembly instruction
    instruction_set:string*, opcode:string*
  • generate_short_url — Create a Compiler Explorer short URL for sharing code with compiler settings
    source:string*, language:string*, compiler:string*, options:string, libraries:array
  • get_shortlink_info — 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.
    id:string*

Overview

What is Compiler Explorer?

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?

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

  • 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 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

  • 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.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬