Skip to main content
Glama

[DEPRECATED]

Maintenance has ended. Please use cmake-skill instead.


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.

python -m mcp_cmake.server -w /path/to/your/cmake/project

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 be true for most tools to work.

Related MCP server: Arduino MCP Server

🛠️ 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:

# Run a health check on the current working directory
client.call_tool("health_check")

# Switch to a new project and check its health
client.call_tool("health_check", {"working_dir": "/path/to/another/project"})

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:

presets = client.call_tool("list_presets")
print(presets.text)
# Output: ['default', 'ninja-multi-config', 'windows-msvc']

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:

client.call_tool("create_project", {"preset": "default"})

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]): If True, 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:

# Build the default target
client.call_tool("build_project", {"preset": "default"})

# Build a specific target with 4 parallel jobs
client.call_tool("build_project", {"preset": "default", "targets": ["my_executable"], "parallel_jobs": 4})

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]): If True, enables verbose test output.

    • parallel_jobs (Optional[int]): The number of parallel tests to run.

  • Returns: A success or failure response.

Example:

# Run all tests
client.call_tool("test_project", {"preset": "default"})

# Run tests matching a specific name
client.call_tool("test_project", {"preset": "default", "test_filter": "MyTest*"})
F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
2Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    An MCP server that enables AI assistants to parse Xcode and Swift build outputs into structured, token-efficient formats like JSON or TOON. It provides tools for executing build commands and extracting detailed diagnostic information such as errors, warnings, and test failures.
    8
    MIT
  • A
    license
    C
    quality
    D
    maintenance
    A comprehensive Model Context Protocol (MCP) server for Arduino CLI interactions, built with FastMCP. This server enables AI agents to seamlessly interact with Arduino CLI for development, debugging, code verification, and more.
    16
    2
    MIT
  • A
    license
    B
    quality
    B
    maintenance
    Local MCP server providing project cognition capabilities for AI coding agents, including context packs, impact analysis, and git diff review through stdio communication.
    10
    3
    MIT
  • A
    license
    -
    quality
    A
    maintenance
    apc-mcp is a Model Context Protocol server that brings audio plugin development workflows into any MCP-compatible client by wrapping CMake, ctest, clang-format, pluginval, and clap-validator into a clean tool interface for building, testing, linting, validating, and scaffolding JUCE, CLAP, VST3, and ARA plugin projects.
    MIT

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…

  • MCP server for Gainium — manage trading bots, deals, and balances via AI assistants

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hiono/mcp-cmake'

If you have feedback or need assistance with the MCP directory API, please join our Discord server