Описание
C++ Semantic MCP Server
README
An MCP server that gives AI agents call graphs, cross-references, and impact analysis for C++ codebases.
With mcpp, your agents don’t have to grep through source files. No more guessing call relationships, missing template references, or wondering "what breaks if I change this?". mcpp gives precise, Clang-parsed semantic data: every caller, every call chain, every override.
What your agent can do with mcpp:
- "Who calls
HashGrid::query?" → precise callers, not grep matches - "Show the call path from
maintoRenderer::render" → full chain - "What's the blast radius if I change
Scene::update?" → transitive impact - "Is
Aabb::intersectsdead code?" → zero callers = dead
Quick start
mcpp index path/to/compile_commands.json
This builds xref.db and prints a config snippet — paste it into your
MCP client and you're done.
Usage
index — Build cross-reference database
Parses every translation unit in a compile_commands.json, extracts
symbols, references, call edges, and inheritance relations into a SQLite
database.
mcpp index path/to/compile_commands.json # output: xref.db next to compdb
mcpp index path/to/build/ -o /tmp/xref.db # explicit output path
mcpp index compile_commands.json -j 4 # limit threads (default: all cores)
After indexing, mcpp prints a .mcp.json snippet to stdout for easy copy-paste.
Drop it into your MCP client's config:
- Claude/Copilot CLI:
//.mcp.json(repo-root),~/.copilot/mcp-config.jsonor/mcp add - VS Code Copilot:
//.github/copilot/mcp.jsonin your repo - Claude Desktop:
claude_desktop_config.json
The snippet uses the mcpServers format supported by most MCP clients:
{
"mcpServers": {
"mcpp": {
"type": "stdio",
"command": "/path/to/mcpp",
"args": ["serve", "/path/to/xref.db"]
}
}
}
MCP tools (11)
| Tool | Description |
|---|---|
search_cpp_symbols |
Search symbols by name substring |
get_cpp_definition |
Find where a symbol is defined |
find_cpp_references |
Find all references to a symbol |
find_callers |
Direct callers of a function (1-hop in) |
find_callees |
Direct callees of a function (1-hop out) |
get_class_members |
List members of a class/struct |
get_symbol_stats |
Per-member fan-in counts, dead code detection |
find_virtual_overrides |
Find classes overriding a virtual method |
find_call_path |
Find call chains between two functions |
find_call_path_via |
Call path A→B constrained through waypoint C |
get_impact_radius |
Transitive blast radius of a change (N hops) |
Building
Prerequisites
- .NET 8 SDK
- Visual Studio 2022 (v143 toolset, for ClangXref.dll)
- LLVM 21.1.1 static libs (auto-downloaded on first build)
Build steps
# 1. Build native DLL (VS 2022 Developer Command Prompt)
# Auto-downloads ~540 MB of LLVM libs on first run.
msbuild src\ClangXref\ClangXref.vcxproj /p:Configuration=Release /p:Platform=x64
# 2. Build C# server
dotnet build -c Release src\Mcpp
Both outputs go to bin/.
Generating compile_commands.json
For CMake projects (most common):
cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja
For MSBuild projects, use bt to extract
from .binlog, or other tools that generate Clang-compatible compdbs.
Architecture
C# (.NET 8) C++ (LLVM 21.1.1)
┌────────────────┐ ┌──────────────────────┐
│ mcpp.exe │ │ ClangXref.dll │
│ ┌────────────┐ │ P/Invoke (Cdecl) │ ┌──────────────────┐ │
│ │ CppIndexer │◄├───────────────────►│ │IndexDataConsumer │ │
│ └────────────┘ │ 7 callbacks │ │PPCallbacks │ │
│ ┌────────────┐ │ │ └──────────────────┘ │
│ │ XrefDB │ │ └──────────────────────┘
│ │ (SQLite) │ │
│ └────────────┘ │
└────────────────┘
Установка Mcpp
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/sundaramramaswamy/mcppFAQ
Mcpp MCP бесплатный?
Да, Mcpp MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Mcpp?
Нет, Mcpp работает без API-ключей и переменных окружения.
Mcpp — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Mcpp в Claude Desktop, Claude Code или Cursor?
Открой Mcpp на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Mcpp with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
