- Home
- MCP servers
- CPPCon
CPPCon
- other
0
GitHub Stars
other
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You run a dedicated MCP server that exposes a C++ assembly generation tool via the Compiler Explorer API. This server adheres to the Model Context Protocol, enabling clients to request assembly output for given C++ code and compiler options, with optional streaming of results through Server-Sent Events for real-time feedback.
How to use
You interact with the server through standard MCP client patterns. First, discover what the server can do by querying its capabilities. Then invoke the get_assembly tool to compile C++ code and retrieve the assembly. If you want live progress and results, connect to the streaming endpoint to receive updates as the compilation proceeds. You can also send general messages to the server using the dedicated messaging endpoint.
How to install
Prerequisites you need to meet before running the server.
- Python 3.11 or higher
Create and activate a virtual environment (recommended) and install the required packages.
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
pip install "mcp-server[fastmcp]" uvicorn requests pydantic
Additional sections
Configuration and usage details you will rely on as you operate the server.
Starting the MCP server uses a straightforward run command.
python server.py
By default, the MCP server serves on http://127.0.0.1:8000. You can use this base URL to connect your MCP client and explore endpoints such as capabilities, tool invocation, streaming results, and messaging.
Key endpoints you will work with include: capabilities to discover tools, /tool/get_assembly to run the assembly tool, /sse to stream results, and /message to exchange client messages.
Server connection and tooling
To help your MCP client connect, you can reference a sample http configuration pointed at the running server. Use the base URL http://localhost:8000 as the MCP address.
{
"type": "http",
"name": "cppcon_mcp",
"url": "http://localhost:8000",
"args": []
}
Security and best practices
Run the server in a controlled environment and restrict access to trusted clients. Use standard network security practices for any exposed endpoints and keep dependencies up to date.
Troubleshooting
If the server fails to start or you cannot reach endpoints, verify your Python version, virtual environment activation, and network binding. Check that you used the correct run command and that port 8000 is not occupied by another process.
Notes
The server exposes a dedicated tool named get_assembly that compiles C++ code using MSVC via the Compiler Explorer API and returns the assembly output. It also supports streaming via SSE at /sse and client messaging via /message.
Available tools
get_assembly
Exposes a tool that compiles C++ code using MSVC through the Compiler Explorer API and returns the generated assembly.