Skip to main content
Glama
cmake-mcp
by ibuildrun

cmake-mcp

MCP server for CMake build automation and project management. Gives AI assistants the ability to configure, build, clean, and inspect CMake projects with structured error parsing.

Features

  • cmake_configure — run CMake configure with custom generator and options

  • cmake_build — build with structured error parsing (MSVC + GCC/Clang)

  • cmake_clean — clean build artifacts

  • cmake_list_targets — list available build targets

  • cmake_cache_get — read CMake cache variables

  • cmake_run_executable — run a built executable and capture output

Automatically falls back to vcvarsall environment on Windows when cmake is not in PATH.

Related MCP server: clangd-mcp-server

Requirements

  • CMake 3.12+ installed and in PATH

  • Python 3.10+

Installation

pip install cmake-mcp

Or from source:

git clone https://github.com/ibuildrun/cmake-mcp.git
cd cmake-mcp
pip install -e .

MCP Configuration

Add to your .kiro/settings/mcp.json:

{
  "mcpServers": {
    "cmake": {
      "command": "cmake-mcp",
      "disabled": false
    }
  }
}

Or with uvx:

{
  "mcpServers": {
    "cmake": {
      "command": "uvx",
      "args": ["cmake-mcp"],
      "disabled": false
    }
  }
}

Usage Examples

> cmake_configure "." "build" "Visual Studio 17 2022"
> cmake_build "build" "Debug" "teeworlds"
> cmake_cache_get "build" "CMAKE_BUILD_TYPE"
> cmake_list_targets "build"

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to manage Xcode projects by listing targets, reading configurations, and triggering builds via the Model Context Protocol. It facilitates natural language interaction with macOS developer tools to streamline iOS app development processes.
      6
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Provides C++ code intelligence tools for AI agents via the Model Context Protocol, enabling symbol navigation, type information, and diagnostics.
      9
      50
      Mozilla Public 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI coding agents to test C++ code by running static analysis, sanitizers (ASan, TSan, LSan, UBSan), and performance profiling through eight MCP tools.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to query the build model of CMake projects across multiple projects and build directories, inspecting targets, sources, compile flags, includes, defines, dependencies, artifacts, install rules, cache variables, toolchains, and exact compiler invocations. It is read-only, relying on CMake File API replies and compile_commands.json without ever running CMake.
      12
      MIT