mcpField
G
Godbolt Compiler Explorer

Godbolt Compiler Explorer

Local
github.com/benestarDeveloper Tools6Updated 66w ago

About Godbolt Compiler Explorer

Godbolt Compiler Explorer MCP is a FastMCP server for accessing the Compiler Explorer REST API. It provides code compilation, CMake compilation, formatting, and read-only language and compiler resources for MCP-compatible agents.

Key features

  1. 01Compile source code
  2. 02Compile CMake projects
  3. 03Format code
  4. 04Browse languages, compilers, and libraries
  5. 05Read assembly and version resources

Use cases

  1. 01Compile code and inspect generated assembly
  2. 02Build a CMake project through an MCP agent
  3. 03Format source code in an agent workflow

MCP support

Exposes Compiler Explorer compilation and formatting actions, plus read-only language, compiler, library, formatter, assembly documentation, and version resources to MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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

  1. Clone this repository:
git clone <repository-url>
cd godbolt-mcp
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt

Usage

Standalone Usage

Run the MCP server directly:

python godbolt_mcp.py
Adding 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 languages
  • resource://compilers/{language_id} - Get available compilers for a specific language
  • resource://libraries/{language_id} - Get available libraries for a specific language
  • resource://formats - List available code formatters
  • resource://asm/{instruction_set}/{opcode} - Get assembly instruction documentation
  • resource://version - Get Compiler Explorer version information
Tools (Actions)
  • compile_code(compiler_id, source, user_arguments=None, files=None, libraries=None) - Compile source code
  • compile_cmake(compiler_id, source, user_arguments=None, files=None, libraries=None) - Compile CMake project
  • format_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" program
  • hello.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 framework
  • httpx>=0.25.0 - HTTP client for API requests

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.