Supports C++ project development through CMake integration, including compilation, linking, and testing of C++ applications and libraries
Provides comprehensive CMake project management capabilities including configuring projects with presets, building with multiple targets, running CTest suites, and analyzing build/test errors with LLM-friendly formatting
Built as a Gradio-based MCP server providing a web UI interface for CMake operations accessible through browser at localhost:7860
MCP-CMake: A Tool for CMake Project Management
日本語のドキュメントはこちら (View in Japanese)
MCP-CMake provides a set of tools to manage CMake-based projects through the Model Context Protocol (MCP). It allows you to configure, build, and test your CMake projects programmatically.
🚀 Getting Started
Server Setup
The MCP-CMake server needs to be started with a path to your CMake project's root directory. This directory must contain a CMakePresets.json
file.
Once the server starts, it performs an initial health check. If successful, the server becomes Healthy
and is ready to accept tool calls.
Server State
The server maintains two internal states:
WORKING_DIRECTORY
: The absolute path to the CMake project being managed.IS_HEALTHY
: A boolean flag indicating if the server is ready. This must betrue
for most tools to work.
🛠️ Available Tools
1. health_check
Verifies the development environment and sets the server to a Healthy
state if successful. This tool can also be used to switch the working directory to a new project.
- Arguments:
working_dir
(Optional[str]): The absolute path to a CMake project directory. If provided, the server will switch to this directory.
- Returns: A dictionary containing the check results.
Example:
2. list_presets
Lists the available configurePresets
from the CMakePresets.json
file in the current working directory.
- Arguments: None
- Returns: A list of preset name strings.
Example:
3. create_project
Configures the CMake project using a specified preset. This tool automatically detects the compiler and enables structured diagnostic logging (JSON for GCC/Clang, SARIF for MSVC).
- Arguments:
preset
(str): The name of the configure preset to use.cmake_defines
(Optional[dict]): A dictionary of CMake defines to pass with the-D
flag (e.g.,{"MY_VAR": "VALUE"}
).
- Returns: A success or failure response.
Example:
4. build_project
Builds the project using a specified build preset. If the build fails, it returns a structured error report parsed from the compiler's output.
- Arguments:
preset
(str): The name of the build preset to use.targets
(Optional[list[str]]): A list of specific targets to build.verbose
(Optional[bool]): IfTrue
, enables verbose build output.parallel_jobs
(Optional[int]): The number of parallel jobs to use for building.
- Returns: A success or failure response with detailed error information.
Example:
5. test_project
Runs tests for the project using a specified test preset.
- Arguments:
preset
(str): The name of the test preset to use.test_filter
(Optional[str]): A regex to filter which tests to run.verbose
(Optional[bool]): IfTrue
, enables verbose test output.parallel_jobs
(Optional[int]): The number of parallel tests to run.
- Returns: A success or failure response.
Example:
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Gradio-based MCP server for comprehensive CMake project management that enables configuring, building, and testing CMake projects with preset support, error analysis, and LLM-friendly output formatting. Provides both web UI and MCP protocol access for streamlined C++ development workflows.
Related MCP Servers
- -securityFlicense-qualityA collection of MCP servers built with FastMCP framework that handle various tasks including customer interviews, E2E testing, and go-live processes, enabling seamless integration with GitHub Copilot through VSCode.Last updated -
- -securityFlicense-qualityAn MCP server that enables interaction with Google Cloud Game Services API, allowing users to manage game server deployments, realms, and configurations through natural language.Last updated -1
- -securityFlicense-qualityAn MCP server that enables Git repository operations and GitHub PR workflows, allowing users to manage repositories, create branches, commit changes, and create pull requests through natural language.Last updated -1
- -securityAlicense-qualityThis project builds a read-only MCP server. For full read, write, update, delete, and action capabilities and a simplified setup, check out our free CData MCP Server for Google Data Catalog (beta): https://www.cdata.com/download/download.aspx?sku=HGZK-V&type=betaLast updated -MIT License