{"id":50841040,"url":"https://github.com/sundaramramaswamy/mcpp","last_synced_at":"2026-06-14T06:35:18.866Z","repository":{"id":356560269,"uuid":"1233058263","full_name":"sundaramramaswamy/mcpp","owner":"sundaramramaswamy","description":"C++ Semantic MCP Server","archived":false,"fork":false,"pushed_at":"2026-05-08T15:25:42.000Z","size":155,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-08T17:32:26.405Z","etag":null,"topics":["blast-radius","call-graph","clang","cpp","impact-analysis","mcp-server","semantic-search"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sundaramramaswamy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-08T14:47:39.000Z","updated_at":"2026-05-08T15:26:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sundaramramaswamy/mcpp","commit_stats":null,"previous_names":["sundaramramaswamy/mcpp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sundaramramaswamy/mcpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sundaramramaswamy%2Fmcpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sundaramramaswamy%2Fmcpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sundaramramaswamy%2Fmcpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sundaramramaswamy%2Fmcpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sundaramramaswamy","download_url":"https://codeload.github.com/sundaramramaswamy/mcpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sundaramramaswamy%2Fmcpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34312072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blast-radius","call-graph","clang","cpp","impact-analysis","mcp-server","semantic-search"],"created_at":"2026-06-14T06:35:18.208Z","updated_at":"2026-06-14T06:35:18.861Z","avatar_url":"https://github.com/sundaramramaswamy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mcpp: A C++ Semantic MCP Server\n\nAn [MCP](https://modelcontextprotocol.io) server that gives AI agents\n**call graphs, cross-references, and impact analysis** for C++ codebases.\n\nWith mcpp, your agents don’t have to grep through source files.  No more\nguessing call relationships, missing template references, or wondering\n\"what breaks if I change this?\".  mcpp gives precise, Clang-parsed\nsemantic data: every caller, every call chain, every override.\n\n**What your agent can do with mcpp:**\n- *\"Who calls `HashGrid::query`?\"* → precise callers, not grep matches\n- *\"Show the call path from `main` to `Renderer::render`\"* → full chain\n- *\"What's the blast radius if I change `Scene::update`?\"* → transitive impact\n- *\"Is `Aabb::intersects` dead code?\"* → zero callers = dead\n\n## Quick start\n\n```\nmcpp index path/to/compile_commands.json\n```\n\nThis builds `xref.db` and prints a config snippet — paste it into your\nMCP client and you're done.\n\n## Usage\n\n### `index` — Build cross-reference database\n\nParses every translation unit in a `compile_commands.json`, extracts\nsymbols, references, call edges, and inheritance relations into a SQLite\ndatabase.\n\n```\nmcpp index path/to/compile_commands.json          # output: xref.db next to compdb\nmcpp index path/to/build/ -o /tmp/xref.db         # explicit output path\nmcpp index compile_commands.json -j 4             # limit threads (default: all cores)\n```\n\nAfter indexing, `mcpp` prints a `.mcp.json` snippet to stdout for easy copy-paste.\nDrop it into your MCP client's config:\n\n- **Claude/Copilot CLI**: `//.mcp.json` (repo-root), `~/.copilot/mcp-config.json` or `/mcp add`\n- **VS Code Copilot**: `//.github/copilot/mcp.json` in your repo\n- **Claude Desktop**: `claude_desktop_config.json`\n\nThe snippet uses the `mcpServers` format supported by most MCP clients:\n\n```json\n{\n    \"mcpServers\": {\n        \"mcpp\": {\n            \"type\": \"stdio\",\n            \"command\": \"/path/to/mcpp\",\n            \"args\": [\"serve\", \"/path/to/xref.db\"]\n        }\n    }\n}\n```\n\n### MCP tools (11)\n\n| Tool | Description |\n|------|-------------|\n| `search_cpp_symbols` | Search symbols by name substring |\n| `get_cpp_definition` | Find where a symbol is defined |\n| `find_cpp_references` | Find all references to a symbol |\n| `find_callers` | Direct callers of a function (1-hop in) |\n| `find_callees` | Direct callees of a function (1-hop out) |\n| `get_class_members` | List members of a class/struct |\n| `get_symbol_stats` | Per-member fan-in counts, dead code detection |\n| `find_virtual_overrides` | Find classes overriding a virtual method |\n| `find_call_path` | Find call chains between two functions |\n| `find_call_path_via` | Call path A→B constrained through waypoint C |\n| `get_impact_radius` | Transitive blast radius of a change (N hops) |\n\n## Building\n\n### Prerequisites\n\n- .NET 8 SDK\n- Visual Studio 2022 (v143 toolset, for ClangXref.dll)\n- LLVM 21.1.1 static libs (auto-downloaded on first build)\n\n### Build steps\n\n```powershell\n# 1. Build native DLL (VS 2022 Developer Command Prompt)\n#    Auto-downloads ~540 MB of LLVM libs on first run.\nmsbuild src\\ClangXref\\ClangXref.vcxproj /p:Configuration=Release /p:Platform=x64\n\n# 2. Build C# server\ndotnet build -c Release src\\Mcpp\n```\n\nBoth outputs go to `bin/`.\n\n### Generating compile_commands.json\n\nFor CMake projects (most common):\n```\ncmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja\n```\n\nFor MSBuild projects, use [bt](https://github.com/nicknash/bt) to extract\nfrom `.binlog`, or other tools that generate Clang-compatible compdbs.\n\n## Architecture\n\n```\nC# (.NET 8)                           C++ (LLVM 21.1.1)\n┌────────────────┐                    ┌──────────────────────┐\n│ mcpp.exe       │                    │ ClangXref.dll        │\n│ ┌────────────┐ │  P/Invoke (Cdecl)  │ ┌──────────────────┐ │\n│ │ CppIndexer │◄├───────────────────►│ │IndexDataConsumer │ │\n│ └────────────┘ │  7 callbacks       │ │PPCallbacks       │ │\n│ ┌────────────┐ │                    │ └──────────────────┘ │\n│ │ XrefDB     │ │                    └──────────────────────┘\n│ │ (SQLite)   │ │\n│ └────────────┘ │\n└────────────────┘\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsundaramramaswamy%2Fmcpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsundaramramaswamy%2Fmcpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsundaramramaswamy%2Fmcpp/lists"}