- Home
- MCP servers
- MCP-CMake
MCP-CMake
- python
1
GitHub Stars
python
Language
6 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.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"hiono-mcp-cmake": {
"command": "python",
"args": [
"-m",
"mcp_cmake.server",
"-w",
"/path/to/your/cmake/project"
]
}
}
}You manage CMake-based projects programmatically with MCP-CMake, a focused server that configures, builds, and tests your CMake projects through the Model Context Protocol. It lets you automate project setup, run builds with various presets, and execute tests in a structured, repeatable way, improving consistency across environments.
How to use
You interact with the MCP client to call each available tool. Start by health-checking the server and ensuring it is in a healthy state. Then you can list presets from your CMake project, configure the project with a preset, build targets, and run tests. You can switch working directories at any time to work with different projects.
Key workflows for practical use include:
- Start the server in the root of your CMake project that contains CMakePresets.json with:
python -m mcp_cmake.server -w /path/to/your/cmake/project - Check health to confirm readiness and optionally switch projects:
health_checkorhealth_checkwithworking_dirset to a new path - See available presets in the current project:
list_presets - Configure the project using a preset and optional defines:
create_projectwith a preset name andcmake_defines - Build using a build preset and optionally specify targets, verbosity, and parallelism:
build_projectwithpreset,targets,verbose, andparallel_jobs - Run tests with a test preset and optional filters/verbosity/parallelism:
test_projectwithpreset,test_filter,verbose, andparallel_jobs
How to install
Prerequisites you need before starting are installed Python and access to run Python modules.
# Start by ensuring Python is installed
python --version
# Run the MCP-CMake server for your project root (must contain CMakePresets.json)
python -m mcp_cmake.server -w /path/to/your/cmake/project
Available tools
health_check
Verifies the development environment and sets the server to a Healthy state. It can switch the working directory to a new project if a path is provided.
list_presets
Lists available configurePresets from the CMakePresets.json in the current working directory.
create_project
Configures the CMake project using a specified preset and optional defines. It detects the compiler and enables structured diagnostic logging.
build_project
Builds the project using a build preset. Returns a structured error report if the build fails, including compiler output details.
test_project
Runs tests for the project using a specified test preset with optional filtering, verbosity, and parallel execution.