Godbolt Compiler Explorer MCP
Provides access to the Godbolt Compiler Explorer REST API, enabling compilation and assembly inspection for multiple languages and compilers.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Godbolt Compiler Explorer MCPCompile hello.cpp with gcc and show assembly."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Godbolt Compiler Explorer MCP
A Model Context Protocol (MCP) server that provides access to the Godbolt Compiler Explorer REST API endpoints. Built with the FastMCP Python library.
Installation
Clone this repository:
git clone <repository-url>
cd godbolt-mcpCreate and activate a virtual environment:
python -m venv venv
source venv/bin/activateInstall dependencies:
pip install -r requirements.txtRelated MCP server: Judge0 CE MCP Server
Usage
Standalone Usage
Run the MCP server directly:
python godbolt_mcp.pyAdding to MCP-Compatible Agents
Add the server to your MCP configuration (using virtual environment Python):
{
"mcpServers": {
"godbolt-compiler-explorer": {
"command": "/absolute/path/to/godbolt-mcp/venv/bin/python",
"args": ["/absolute/path/to/godbolt-mcp/godbolt_mcp.py"]
}
}
}Note: Replace /absolute/path/to/godbolt-mcp with the actual absolute path to your installation directory.
Available Tools
Resources (Read-only access)
resource://languages- List all supported programming languagesresource://compilers/{language_id}- Get available compilers for a specific languageresource://libraries/{language_id}- Get available libraries for a specific languageresource://formats- List available code formattersresource://asm/{instruction_set}/{opcode}- Get assembly instruction documentationresource://version- Get Compiler Explorer version information
Tools (Actions)
compile_code(compiler_id, source, user_arguments=None, files=None, libraries=None)- Compile source codecompile_cmake(compiler_id, source, user_arguments=None, files=None, libraries=None)- Compile CMake projectformat_code(formatter, source)- Format source code
Examples
The examples/ folder contains sample source files you can use to test the MCP server:
hello.cpp- Simple C++ "Hello World" programhello.rs- Simple Rust "Hello World" program
Try these prompts with MCP-compatible agents to generate assembly code for the example files:
For C++ example:
Compile the hello.cpp file from the examples folder with GCC and show me the exact generated assembly code with optimization level -O2.For Rust example:
Compile the hello.rs file from the examples folder with the latest Rust compiler and show me the exact generated assembly code with release optimizations.Dependencies
fastmcp>=0.2.0- MCP server frameworkhttpx>=0.25.0- HTTP client for API requests
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that connects LLMs to the Compiler Explorer API, enabling them to compile code, explore compiler features, and analyze optimizations across different compilers and languages.Last updated515MIT
- AlicenseCqualityDmaintenanceEnables code execution and compilation through the Judge0 CE API, supporting multiple programming languages with submission management, status checking, and language configuration retrieval.Last updated9MIT
- Flicense-qualityDmaintenanceAn MCP server that enables users to compile C++ code and retrieve assembly output through the Compiler Explorer (godbolt.org) API. It supports standard tool calls and Server-Sent Events for streaming compilation status and results.Last updated
- Alicense-qualityFmaintenanceEnables AI assistants to interact with VS Code for language intelligence, debugging, and code execution.Last updated16MIT
Related MCP Connectors
Get up-to-date, version-specific documentation and code examples from official sources directly in…
Execute code in 8 languages (Python, JS, TS, Go, Java, C++, C, Bash) in gVisor sandboxes.
Run SOQL queries against your Salesforce org to explore and retrieve data. Quickly iterate on filt…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Benestar/godbolt-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server