- Notifications
You must be signed in to change notification settings - Fork1
Experimental official ce-mcp
License
compiler-explorer/ce-mcp
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A Model Context Protocol (MCP) server that provides efficient access to Compiler Explorer (godbolt.org) compilation and execution services.
- Token-efficient responses - Minimized output while preserving essential information
- Use-case driven tools - Specific functions for common compilation scenarios
- Smart filtering - Context-aware output filtering based on the task
- Comprehensive language support - C++, C, Rust, Go, Python, and more
- Claude Code integration - Automated setup for Claude Code workflows
If you're using Claude Code, simply run:
git clone https://github.com/compiler-explorer/ce-mcpcd ce-mcp./setup-claude-code.shThis will automatically install and configure everything. That's it!
- Python 3.10+ - Required for running the MCP server
- UV - Fast Python package manager (recommended)
curl -LsSf https://astral.sh/uv/install.sh| shOr on macOS with Homebrew:
brew install uv
# Clone the repositorygit clone https://github.com/compiler-explorer/ce-mcpcd ce-mcp# Option A: Quick setup (Linux/macOS)./setup.sh# Option B: Manual setupuv venvsource .venv/bin/activate# On Windows: .venv\Scripts\activateuv pip install -e".[dev]"
# Run unit tests.venv/bin/pytest tests/ -m"not integration"# Run integration tests (requires internet).venv/bin/pytest tests/ -m integration# Run all tests.venv/bin/pytest tests/
# Basic usagece-mcp# With custom configurationce-mcp --config~/.config/ce-mcp/config.yaml# With verbose loggingce-mcp --verbose
The server provides 12 specialized MCP tools for compilation, analysis, and sharing. Seedocs/available_tools.md for detailed documentation of each tool.
Core Tools:
compile_check_tool- Syntax validationcompile_and_run_tool- Compile and executecompile_with_diagnostics_tool- Error analysis
Analysis Tools:
analyze_optimization_tool- Assembly optimization analysiscompare_compilers_tool- Compiler comparisonlookup_instruction_tool- Assembly instruction documentation
Discovery & Sharing:
generate_share_url_tool- Create Compiler Explorer URLsfind_compilers_tool- Find compilers with filteringget_libraries_tool- List available librariesget_library_details_tool- Library informationget_languages_tool- List supported languagesdownload_shortlink_tool- Download shared code
Create a configuration file at~/.config/compiler_explorer_mcp/config.yaml:
compiler_explorer_mcp:api:endpoint:"https://godbolt.org/api"timeout:30defaults:language:"c++"compiler:"g132"output_limits:max_stdout_lines:100max_stderr_lines:50
# Install with development dependenciesuv pip install -e".[dev]"# Run tests.venv/bin/pytest tests/# Run integration tests (requires internet).venv/bin/pytest tests/ -m integration# Format codeblack.isort.# Type checkingmypy ce_mcp/# Code quality checksuv run black ce_mcp/ tests/isort ce_mcp/ tests/
If you prefer using pip instead of UV:
# Create virtual environmentpython3 -m venv .venvsource .venv/bin/activate# On Windows: .venv\Scripts\activate# Install dependenciespip install -e".[dev]"# Run the serverpython -m ce_mcp.cli
"command not found: ce-mcp"
- Make sure your virtual environment is activated
- Try running directly:
python -m ce_mcp.cli
"ModuleNotFoundError: No module named 'packaging'"
- Install missing dependency:
uv pip install packaging - Or reinstall with all dependencies:
uv pip install -e .
"ModuleNotFoundError: No module named 'ce_mcp'"
- Install in development mode:
uv pip install -e . - Check your virtual environment is activated
Integration tests failing
- Tests require internet access to godbolt.org
- Some tests may be skipped if the API is temporarily unavailable
- Run unit tests only:
pytest tests/ -m "not integration"
"uv not found"
- Install UV:
curl -LsSf https://astral.sh/uv/install.sh | sh - Or use pip:
pip install -e ".[dev]"
Create~/.config/ce-mcp/config.yaml for custom settings:
compiler_explorer_mcp:api:timeout:30defaults:language:"c++"compiler:"g132"output_limits:max_stdout_lines:50
BSD-2-Clause
About
Experimental official ce-mcp
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.