Back to Home
felipeerias icon

clangd-mcp-server

Verified Safe

by felipeerias

Overview

Model Context Protocol server that bridges Claude Code with clangd LSP for enhanced C++ code intelligence and navigation in large codebases.

Installation

Run Command
clangd-mcp-server

Environment Variables

  • PROJECT_ROOT
  • COMPILE_COMMANDS_DIR
  • CLANGD_PATH
  • CLANGD_ARGS
  • LOG_LEVEL
  • CLANGD_LOG_LEVEL

Security Notes

The server operates via standard I/O (stdio) for communication with the MCP client, limiting direct external network exposure. It spawns a local 'clangd' subprocess. Argument parsing for 'CLANGD_ARGS' (from environment variables) uses a custom 'parseShellArgs' function which, if not perfectly robust, could potentially lead to unexpected clangd behavior if malicious input is provided, though it passes arguments as an array to 'spawn' which mitigates shell injection. No 'eval' or obvious hardcoded secrets are found. File content is read from the local file system (via `fs/promises.readFile`) and passed to `clangd`.

Similar Servers

Stats

Interest Score33
Security Score8
Cost ClassMedium
Avg Tokens1000
Stars2
Forks0
Last Update2025-12-03

Tags

MCPclangdC++code-intelligenceLSP