Skip to main content
Glama
torshepherd

Compiler Explorer MCP

by torshepherd

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Server capabilities have not been inspected yet.

Tools

Functions exposed to the LLM to take actions

NameDescription
list_languagesA

Get a list of supported programming languages.

Returns:
    List of dictionaries containing language information, each with keys:
    - id: Unique identifier for the language
    - name: Display name of the language
    - extensions: List of file extensions associated with the language

Raises:
    HTTPException: If the API request fails
list_compilers_for_languageA

Get available compilers for a specific programming language.

Args:
    language: Programming language to get compilers for (e.g., 'cpp', 'rust')

Returns:
    List of unversioned compiler names available for the language

Raises:
    HTTPException: If the API request fails

Example:
    >>> await list_compilers_for_language("cpp")
    ["gcc", "clang", "msvc"]
list_compiler_versionsA

Get available compiler versions matching a compiler name regex.

NOTE: This may return a lot of results! Choose a specific regex to narrow down the results and not overflow the MCP client.

Args:
    compiler_regex: Regular expression to match compiler names (case-insensitive)

Returns:
    List of dictionaries containing matching compiler information, each with keys:
    - id: Unique identifier for the compiler
    - name: Display name of the compiler
    - semver: Version string of the compiler

Raises:
    HTTPException: If the API request fails

Example:
    >>> await list_compiler_versions("gcc")
    [{"id": "gcc-12.2", "name": "GCC 12.2"}, {"id": "gcc-11.3", "name": "GCC 11.3"}]

    >>> await list_compiler_versions("clang.*trunk")
    [..., {"id": "irclangtrunk", "name": "clang (trunk)", "lang": "llvm", "compilerType": "", "semver": "(trunk)", "instructionSet": "amd64"}, ...]
compile_codeA

Compile source code using specified compiler and options.

Args:
    source: Source code to compile
    language: Programming language of the source code
    compiler: Compiler name or ID to use
    ctx: MCP context for logging and error reporting
    options: Compiler flags and options
    filters: Configuration for filtering compiler output
    libraries: List of library dependencies

Returns:
    Dictionary containing compilation results with keys:
    - code: Exit code of the compilation
    - stdout: Standard output from the compiler
    - stderr: Standard error from the compiler
    - asm: Generated assembly (if applicable)

Raises:
    HTTPException: If compilation fails, compiler not found, or API request fails

Example:
    >>> result = await compile_code(
    ...     source="int main() { return 0; }",
    ...     language="cpp",
    ...     compiler="gcc",
    ...     ctx=ctx
    ... )
get_opcode_documentationB

Get documentation for a specific opcode in a given instruction set. If a user asks about an opcode, but you don't have the instruction set, you can query list_compiler_versions for a specific compiler and it will tell you the instruction set. You are not an expert on opcodes, so if a user asks about an opcode, you should always use this tool!

Args:
    instruction_set: Instruction set to search for opcode documentation
    opcode: Opcode to search for documentation

Example:
    >>> await get_opcode_documentation("amd64", "lea")

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.9/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a distinct, non-overlapping purpose: compile_code handles compilation, get_opcode_documentation provides opcode docs, list_compilers_for_language lists compilers by language, list_compiler_versions lists compiler versions, and list_languages lists supported languages. There is no ambiguity in tool selection.

Naming Consistency4/5

Tools follow a consistent verb_noun pattern (compile_code, get_opcode_documentation, list_compilers_for_language, list_compiler_versions, list_languages), all using snake_case. The minor deviation is that get_opcode_documentation uses 'get' while others use 'list' or 'compile', but this is appropriate for its action and doesn't break consistency.

Tool Count5/5

With 5 tools, this is well-scoped for a compiler exploration server. Each tool serves a clear purpose in the workflow (listing languages/compilers, compiling code, getting documentation), and none feel redundant or missing given the domain.

Completeness4/5

The toolset covers core compiler exploration tasks: listing languages and compilers, compiling code, and accessing opcode documentation. A minor gap is the lack of tools for managing compilation sessions or saving/loading code snippets, but the provided tools enable basic compilation and exploration workflows without dead ends.

Maintenance

ActivityInactive
ResponsivenessNo issues