Skip to main content
Glama
cpp-analyzer

cpp-analyzer

by kybird
README.md
# C++ MCP Server (fastMCP)

A Model Context Protocol (MCP) server for analyzing C++ codebases using libclang and fastMCP.

## Features

- **Semantic C++ Analysis**: Understands classes, functions, inheritance, and call graphs
- **Dual Mode Support**: STDIO (Claude Desktop) and HTTP (Web UI) modes
- **15+ Analysis Tools**: Search, analyze, and explore C++ codebases efficiently
- **Real-time Indexing**: Background analysis with file watching

## Quick Start

1. **Setup**:
   ```bash
   git clone https://github.com/doogypoo1977/cpp_Analyzer_mcp.git
   cd cpp_Analyzer_mcp
   server_setup.bat  # Windows
   ```

2. **Run Server**:
   ```bash
   # STDIO mode (Claude Desktop)
   run_fastmcp.bat
   
   # HTTP mode (Web UI)
   run_fastmcp_http.bat
   ```

3. **Configure Claude Desktop**:
   ```json
   {
     "mcpServers": {
       "cpp-analyzer": {
         "command": "python",
         "args": ["-m", "mcp_server.main_fastmcp"],
         "cwd": "YOUR_PATH_HERE",
         "env": {"PYTHONPATH": "YOUR_PATH_HERE"}
       }
     }
   }
   ```

## Available Tools

- `get_indexing_status` - Check analysis status
- `search_classes` - Find classes by pattern
- `search_functions` - Find functions by pattern
- `get_callers` - Who calls this function
- `get_callees` - What this function calls
- `get_class_info` - Detailed class analysis
- `analyze_class` - Comprehensive class report
- `find_in_file` - Symbols within specific files
- `get_call_tree` - Multi-level call relationships
- `search_symbols` - Universal symbol search
- `get_project_stats` - Project overview
- And more...

## Requirements

- Python 3.9+
- libclang (included in requirements.txt)
- MSVC compiler (Windows)

## HTTP Mode

When running in HTTP mode:
```bash
run_fastmcp_http.bat
```
Check console output for available endpoints.

## License

All rights reserved. See LICENSE file for details.