Basic information
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
[mcp_servers.compiler-explorer] url = "https://compiler-explorer.com/mcp"
{
"mcpServers": {
"compiler-explorer": {
"url": "https://compiler-explorer.com/mcp"
}
}
}
{
"servers": {
"compiler-explorer": {
"type": "http",
"url": "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,arm64andriscv. - 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_languagesreturns each language with itsdefaultCompilerandcompilerCount.list_compilersfilters by language, instruction set or free-text match, and itslatestPerMajorflag keeps only the newest stable compiler per major version (lean: truereturns only IDs and names).list_librarieslists libraries for a language. - Compiling:
compiletakes source, a compiler ID, options and libraries, and returns assembly, stdout and stderr. Withexecute: trueit also runs the program. Output is capped by default at 500 assembly lines and 100 lines each of stdout and stderr; raisemaxAsmLines,maxStdoutLinesormaxStderrLinesfor more.lookup_asm_instructionexplains a mnemonic. - Sharing:
generate_short_urlsaves source and compiler settings as a short link; repeat calls with the same payload return the same URL.get_shortlink_infoturns a short link back into source plus compiler config in the shapecompileaccepts.
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
vpermqdo 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(andOPTIONSfor CORS). Use it from an MCP client. - Output is cut off.
compilecaps output lines by default. RaisemaxAsmLines,maxStdoutLinesormaxStderrLines. - An error comes back as plain text. Failed calls set
isError: truewith a readable message such asCompilation error: ...orShort link "abc" not found. - A shared link loses its executor or CMake panes.
get_shortlink_infoflattens 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