Godbolt Compiler Explorer MCP

Godbolt Compiler Explorer MCP

Enables compiling source code and exploring assembly outputs via the Godbolt Compiler Explorer API. Supports multiple languages, compilers, and optimization levels.

Category
Visit Server

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured