Skip to main content

mcp-server-cpp-format

Model Context Protocol (MCP) server that formats C/C++ source files in-place using clang-format.

Designed to back the cpp-format Claude Code plugin, but usable as a standalone MCP server in any MCP-compatible client.

Install

The server is published on PyPI and intended to be invoked via uvx:

uvx mcp-server-cpp-format

Or install into a regular environment:

pip install mcp-server-cpp-format
mcp-server-cpp-format

Requires Python 3.10+ and clang-format available on PATH (or via CLANG_FORMAT_BIN).

Tools

applyClangFormat

Formats C/C++ source files in-place.

Arguments

Name Type Required Description
files string[] yes Absolute file paths or absolute glob patterns (/path/**/*.cpp). Directory paths without a glob are rejected.
style string no Explicit style (LLVM, Google, file, file:<path>, ...). Overrides environment defaults.

Allowed extensions (others are silently skipped):

.c .cc .cpp .cxx .c++ .h .hh .hpp .hxx .h++ .ipp .tpp .inl

Style resolution priority

  1. style argument when explicitly provided
  2. CLANG_FORMAT_CONFIG env (path to a .clang-format) → --style=file:<path>
  3. CLANG_FORMAT_STYLE env (e.g. LLVM, Google) → --style=<style>
  4. Default → --style=file (clang-format auto-discovers .clang-format upward; falls back to LLVM)

Environment variables

Variable Effect
CLANG_FORMAT_BIN Absolute path to a clang-format binary. Default: clang-format from PATH.
CLANG_FORMAT_CONFIG Absolute path to a .clang-format file to enforce.
CLANG_FORMAT_STYLE Fallback style name when no .clang-format is provided/found.
CPP_FORMAT_LOG_LEVEL Logging verbosity for the server (default INFO).

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_cpp_format-0.3.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_cpp_format-0.3.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_cpp_format-0.3.0.tar.gz.

File metadata

  • Download URL: mcp_server_cpp_format-0.3.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mcp_server_cpp_format-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7d8797fb82673913f0e9786ad34f7e45bbc562e48b632c2d35884fc830e72b29
MD5 2b0d341a51e82fe9ae4d69f4427f5171
BLAKE2b-256 44b163b80841e24c1e429126a62066a977474a480990e648acd098848732dc5d

See more details on using hashes here.

File details

Details for the file mcp_server_cpp_format-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_server_cpp_format-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mcp_server_cpp_format-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e133120ad310867385e836b22b945733653982bb428b69018b031d7e5f93ab91
MD5 b4d2f858ca08e871ae973a4881321ef2
BLAKE2b-256 a503c6620f4125a0fdf77b18178fce3801b042b1acb0bfd0115f85a70920bc34

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page