cplusplus-mcp

cplusplus-mcp

An MCP server for analyzing C++ codebases using libclang.

15
Stars
2
Forks
0
Releases

Overview

The C++ MCP Server provides semantic analysis of C++ codebases using libclang. It enables Claude and other LLM-driven assistants to understand code structure without grep or text matching by offering project-wide search and precise symbol data. Core capabilities include searching for classes and functions by patterns, retrieving detailed class information (methods, members, inheritance), and obtaining function signatures with parameter types. It also supports symbol queries within specific files, retrieving complete inheritance hierarchies, and discovering derived classes. Advanced call graph features let you find all callers and callees of a function, as well as call paths between functions. The server caches parsed ASTs for faster repeated queries and supports incremental analysis, making it suitable for large codebases. Setup relies on Python 3.9+, libclang, and an optional portable libclang download, with configuration options to exclude directories, ignore file patterns, and control dependency analysis. The server integrates with Claude Code and Codex CLI via standard mcpServers definitions, enabling indexing, querying, and navigation of C++ projects from within conversations or CLI prompts.

Details

Owner
kandrwmrtn
Language
Python
License
MIT License
Updated
2025-12-07

Features

search_classes

Find classes by name pattern

search_functions

Find functions by name pattern

get_class_info

Get detailed class information (methods, members, inheritance)

get_function_signature

Get function signatures and parameters

find_in_file

Search symbols within specific files

get_class_hierarchy

Get complete inheritance hierarchy for a class

get_derived_classes

Find all classes that inherit from a base class

find_callers

Find all functions that call a specific function

Audience

C++ developersIndex and analyze large C++ projects for classes, functions, and relationships using the MCP server.
Claude usersIntegrate the C++ analyzer with Claude to query code structure semantically.
Codex CLI usersUse within Codex CLI to index and query C++ codebases.

Tags

cppclanglibclangsemantic-analysiscode-analysisMCPASTcall-graphinheritanceproject-wide-searchcode-navigation