cplusplus_mcp
An MCP (Model Context Protocol) server for analyzing C++ codebases using libclang.
claude mcp add --transport stdio kandrwmrtn-cplusplus_mcp python -m mcp_server.cpp_mcp_server \ --env PYTHONPATH="YOUR_INSTALLATION_PATH_HERE"
How to use
This MCP server provides a C++ semantic analyzer powered by libclang. It exposes capabilities to search for classes and functions by name patterns, retrieve detailed class information (methods, members, and inheritance), inspect function signatures, and analyze call graphs (callers, callees, and specific call paths). It also supports file-scoped symbol searches, and can reveal complete inheritance hierarchies and derived classes. With this, Claude can navigate large C++ codebases more like an IDE, giving you precise context about code structure and relationships without scanning files manually.
To use it with Claude or Codex CLI, first ensure the server is running via the configuration in Claude/Codex, then index your project directory. After indexing, you can issue prompts like: find all classes containing 'Actor', show me the Component class details, or what is the signature of BeginPlay. The server caches results for faster subsequent queries, but initial indexing may take several minutes for very large projects. You can adjust indexing behavior using the provided cpp-analyzer-config.json to exclude certain directories, patterns, and to tune performance. When working with Codex CLI, create a .mcp.json that points to this Python module and set PYTHONPATH accordingly, then reload the Codex CLI so it discovers the server.
How to install
Prerequisites
- Python 3.9 or higher
- pip (Python package manager)
- Git (for cloning)
- LLVM's libclang (the setup scripts can download a portable build)
Installation steps
- Clone the repository:
git clone <repository-url>
cd CPlusPlus-MCP-Server
- Run the setup script for your platform (this creates a virtual environment, installs dependencies, and fetches libclang if possible):
- Windows
server_setup.bat
- Linux/macOS
./server_setup.sh
- Test the installation (recommended):
# Activate the virtual environment first
# Windows
mcp_env\Scripts\activate
# Linux/macOS
source mcp_env/bin/activate
python -m mcp_server.test_installation
- If you need to verify libclang is available, ensure the installation test passes and consult Troubleshooting if you encounter the libclang not found issue.
Additional notes
Tips and common issues:
- libclang availability is common trouble; use the provided setup script to auto-download or manually place libclang as described in Troubleshooting.
- If Claude or Codex does not recognize the server, ensure absolute paths are used in configuration (CLAUDE.json or .mcp.json) and restart the client.
- The server supports configuration via cpp-analyzer-config.json to exclude directories, specify dependency handling, and limit file sizes when scanning large projects.
- In the Claude configuration example, replace YOUR_INSTALLATION_PATH_HERE with the actual installation path of the repository on your machine.
- Initial indexing may take minutes for large codebases; you can prompt Claude to proceed with indexing explicitly and monitor progress.
Related MCP Servers
mcp -qdrant
An official Qdrant Model Context Protocol (MCP) server implementation
mcp-pinecone
Model Context Protocol server to allow for reading and writing from Pinecone. Rudimentary RAG
mcp-rquest
A MCP server providing realistic browser-like HTTP request capabilities with accurate TLS/JA3/JA4 fingerprints for bypassing anti-bot measures. It also supports converting PDF and HTML documents to Markdown for easier processing by LLMs.
pfsense
pfSense MCP Server enables security administrators to manage their pfSense firewalls using natural language through AI assistants like Claude Desktop. Simply ask "Show me blocked IPs" or "Run a PCI compliance check" instead of navigating complex interfaces. Supports REST/XML-RPC/SSH connections, and includes built-in complian
mcp-kubernetes
A Model Context Protocol (MCP) server that enables AI assistants to interact with Kubernetes clusters. It serves as a bridge between AI tools (like Claude, Cursor, and GitHub Copilot) and Kubernetes, translating natural language requests into Kubernetes operations and returning the results in a format the AI tools can understand.
davinci -professional
An enterprise-grade MCP server that exposes the full functionality of DaVinci Resolve and DaVinci Resolve Studio (through version 20) to either Claude Desktop or Cursor MCP clients. Fully configured and tested as a Claude Desktop Extension making installation as easy as clicking a button. Supports both Windows and Macintosh.