C++ language plugin for CodeGraphContext.
Provides tree-sitter-based C++ parsing and node-type query tools as a codegraphcontext.language entry-point plugin.
pip install codegraphcontext-cppOr in editable mode alongside a local CGC checkout:
pip install -e /path/to/codegraphcontext-cppAfter installation, cgc info languages should list cpp. The plugin claims extensions .cpp, .hpp, .hh, and .h.
When this package is installed, the following MCP tools are auto-registered by the CGC server at startup via the AnalysisDescriptor mechanism. They appear alongside the core CGC tools in any MCP-connected IDE.
All tools take no required parameters. Each returns a list of node records under the key results, with at minimum name, path, and line_number fields plus the type-specific fields listed below.
| Tool | Node type queried | Extra return fields |
|---|---|---|
find_cpp_functions |
Function |
docstring |
find_cpp_classes |
Class |
docstring |
find_cpp_imports |
File -[:IMPORTS]-> Module |
file_name, module_name, full_import_name, alias |
find_cpp_structs |
Struct |
fields |
find_cpp_enums |
Enum |
values |
find_cpp_unions |
Union |
members |
find_cpp_macros |
Macro |
value |
find_cpp_variables |
Variable |
value, context |
Indexing a C++ repository populates the following node/relationship types beyond the common File, Function, Class, Module schema:
| Node | Key properties | Description |
|---|---|---|
Struct |
name, path, line_number, fields |
struct declarations |
Enum |
name, path, line_number, values |
enum / enum class declarations |
Union |
name, path, line_number, members |
union declarations |
Macro |
name, path, line_number, value |
#define macro definitions |
Variable |
name, path, line_number, value, context |
Global/namespace-scope variable declarations |
The C++ plugin is in the c_family compatibility family, meaning call-resolution links are built across C and C++ files within the same project.
git clone <this-repo>
pip install -e ".[dev]"
python -m pytest tests/