![MCP-Ghidra5 Logo](mcp-ghidra5.png) # MCP-Ghidra5 ![Python](https://img.shields.io/badge/python-v3.8+-blue.svg) ![Platform](https://img.shields.io/badge/platform-linux-lightgrey.svg) ![License](https://img.shields.io/badge/license-proprietary-red.svg) ![Status](https://img.shields.io/badge/status-stable-green.svg) ![Version](https://img.shields.io/badge/version-1.3.0-blue.svg) ![MCP](https://img.shields.io/badge/MCP-Server-purple.svg) ![Ghidra](https://img.shields.io/badge/Ghidra-Compatible-orange.svg) ![GPT](https://img.shields.io/badge/GPT--5-Powered-brightgreen.svg)
## ๐ŸŽฏ **Advanced GPT-5 Powered Ghidra Reverse Engineering MCP Server** **MCP-Ghidra5** is a cutting-edge **Model Context Protocol (MCP) server** that seamlessly integrates **Ghidra's powerful reverse engineering capabilities** with **advanced multi-model AI technology**. Supporting **7 major AI providers** including OpenAI GPT-5, Anthropic Claude, Google Gemini, xAI Grok, and local LLMs via Ollama, this professional-grade tool transforms binary analysis from a manual, time-intensive process into an **automated, intelligent workflow** with **cost optimization** and **automatic fallback systems**. --- ## ๐Ÿš€ **Key Features** ### **๐Ÿค– Multi-Model AI Suite** - **๐Ÿง  7 AI Provider Support** - OpenAI GPT-5, Claude 3.5, Gemini, Grok, DeepSeek, Perplexity, Ollama - **๐Ÿ”„ Intelligent Fallback** - Automatic provider switching for 99.9% uptime reliability - **๐Ÿ’ฐ Cost Optimization** - Smart model selection saving 30-50% on AI costs - **๐Ÿ“Š Usage Analytics** - Comprehensive tracking of API calls, costs, and performance - **๐Ÿ”’ Local LLM Support** - Ollama integration for 100% private offline analysis - **โšก Model Testing** - Built-in tools to test and validate AI provider configurations - **๐ŸŽฏ Provider Management** - Dynamic switching between models mid-session ### **๐Ÿ”ฌ Advanced Analysis Tools** - **๐Ÿ“Š Binary Analysis** - Comprehensive executable analysis with multi-AI interpretation - **๐Ÿ” Function Decompilation** - Intelligent function analysis with contextual explanations - **๐Ÿ›ก๏ธ Malware Detection** - AI-powered behavioral and structural malware analysis - **โšก Exploit Development** - Automated PoC generation with vulnerability insights - **๐Ÿ”ง Firmware Analysis** - IoT and embedded systems reverse engineering - **๐ŸŽฏ Pattern Recognition** - Vulnerability detection across multiple architectures ### **๐Ÿ—๏ธ Professional Integration** - **๐Ÿ”— MCP Client Integration** - Seamless MCP server deployment - **๐Ÿ“‹ Multi-Architecture Support** - x86, x64, ARM, MIPS, RISC-V compatibility - **โš™๏ธ Automated Installation** - One-command setup with dependency management - **๐Ÿ”‘ API Key Management** - Secure OpenAI API key configuration - **๐Ÿ“ Project Management** - Organized analysis workspace with logging --- ## ๐Ÿ“ฆ **Installation** ### **Prerequisites** - **Python 3.8+** with pip/pipx - **Linux Environment** (Kali Linux, Ubuntu, RHEL, etc.) - **OpenAI API Key** for GPT-5/GPT-4o access - **Ghidra** (REQUIRED - core functionality depends on this) ### **Quick Install** ```bash # 1. Install Ghidra (REQUIRED) # Download from: https://github.com/NationalSecurityAgency/ghidra/releases # Extract to /opt/ghidra/ (recommended) sudo mkdir -p /opt/ghidra sudo tar -xzf ghidra_*.zip -C /opt/ && sudo mv /opt/ghidra_* /opt/ghidra # 2. Download MCP-Ghidra5 wget https://github.com/TheStingR/MCP-Ghidra5/archive/main.zip unzip main.zip && cd MCP-Ghidra5-main # 3. Navigate to the MCP-Ghidra5 directory and run installer cd MCP-Ghidra5 ./install_mcp_ghidra5.sh # Follow prompts: Accept terms โ†’ Enter API key โ†’ Done! # 4. Test installation ./test_ghidra_gpt5.py # 5. Add to MCP Client (use generated config) # Configure your MCP-compatible client with the generated settings ``` ### **Manual Setup** ```bash # 1. INSTALL GHIDRA FIRST (MANDATORY) # Download: https://github.com/NationalSecurityAgency/ghidra/releases # Extract to /opt/ghidra/ # 2. Install Python dependencies pip3 install --user mcp aiohttp # 3. Configure environment export OPENAI_API_KEY="your-api-key-here" export GHIDRA_HEADLESS_PATH="/opt/ghidra/support/analyzeHeadless" # 4. Verify Ghidra installation $GHIDRA_HEADLESS_PATH -help || echo "ERROR: Ghidra not found!" # 5. Navigate to MCP-Ghidra5 directory and run server cd MCP-Ghidra5 python3 ghidra_gpt5_mcp.py ``` --- ## ๐Ÿ› ๏ธ **Usage Examples** ### **Binary Analysis** ```python call_mcp_tool("ghidra_binary_analysis", { "binary_path": "/path/to/executable", "analysis_depth": "deep" }) ``` ### **Function Analysis** ```python call_mcp_tool("ghidra_function_analysis", { "binary_path": "/path/to/binary", "function_name": "main", "include_decompilation": true }) ``` ### **Exploit Development** ```python call_mcp_tool("ghidra_exploit_development", { "binary_path": "/path/to/vulnerable_app", "vulnerability_type": "buffer_overflow" }) ``` ### **Multi-Model AI Queries** ```python call_mcp_tool("gpt5_reverse_engineering_query", { "query": "How to bypass ASLR in modern Linux systems?", "preferred_model": "claude-3-5-sonnet" }) ``` ### **AI Model Management** ```python # Check available AI providers call_mcp_tool("ai_model_status", {"action": "status"}) # Test specific model call_mcp_tool("ai_model_status", { "action": "test_model", "model_name": "grok-beta" }) ``` ### **Tier 1 Binary Analysis Tools** ๐Ÿ†• **v1.2.0** ```python # Strings extraction with AI analysis call_mcp_tool("binary_strings_analysis", { "binary_path": "/path/to/binary", "min_length": 6, "encoding": "all", "output_format": "json", "ai_analysis": True }) # File information and metadata call_mcp_tool("binary_file_info", { "binary_path": "/path/to/binary", "detailed": True }) # Objdump disassembly analysis call_mcp_tool("binary_objdump_analysis", { "binary_path": "/path/to/binary", "analysis_type": "all", "ai_analysis": True }) # ELF binary analysis with readelf call_mcp_tool("binary_readelf_analysis", { "binary_path": "/path/to/elf_binary", "analysis_type": "all" }) # Hex dump with pattern recognition call_mcp_tool("binary_hexdump_analysis", { "binary_path": "/path/to/binary", "offset": 0, "length": 1024, "format": "canonical" }) ``` ### **Phase 2 Binary Diffing Tools** ๐Ÿ†• **v1.3.0** ```python # Comprehensive binary file comparison call_mcp_tool("binary_diff_file", { "file1_path": "/path/to/original.bin", "file2_path": "/path/to/modified.bin", "ai_analysis": True }) # String-based binary comparison call_mcp_tool("binary_diff_strings", { "file1_path": "/path/to/binary1", "file2_path": "/path/to/binary2", "min_length": 4 }) # Function-level comparison call_mcp_tool("binary_diff_functions", { "file1_path": "/path/to/v1.exe", "file2_path": "/path/to/v2.exe" }) # Metadata comparison call_mcp_tool("binary_diff_metadata", { "file1_path": "/path/to/elf1", "file2_path": "/path/to/elf2" }) ``` --- ## ๐ŸŽฏ **17 Advanced Analysis Tools** ๐Ÿ†• ### **๐Ÿ—๏ธ Core Ghidra Integration** | Tool | Description | Use Case | |------|-------------|----------| | **๐Ÿ”ฌ Binary Analysis** | Comprehensive Ghidra + Multi-AI analysis | Full executable examination | | **๐ŸŽฏ Function Analysis** | Specific function decompilation | Targeted code analysis | | **๐Ÿ’ฅ Exploit Development** | PoC generation with AI selection | Vulnerability research | | **๐Ÿฆ  Malware Analysis** | Behavioral and structural analysis | Threat intelligence | | **๐Ÿ“ก Firmware Analysis** | IoT and embedded systems | Hardware security | | **๐Ÿ” Pattern Search** | Vulnerability detection | Code auditing | ### **โšก Tier 1 Binary Tools** ๐Ÿ†• **v1.2.0** | Tool | Description | Features | |------|-------------|----------| | **๐Ÿ“ Strings Analysis** | Multi-encoding string extraction | AI pattern recognition, crypto detection | | **๐Ÿ“‹ File Information** | Comprehensive file metadata | Type detection, security assessment | | **๐Ÿ”ง Objdump Analysis** | Disassembly and symbol analysis | Cross-architecture, AI interpretation | | **โš™๏ธ Readelf Analysis** | ELF binary structure analysis | Security features, dependency analysis | | **๐Ÿ” Hexdump Analysis** | Raw binary inspection | Pattern recognition, magic signatures | ### **๐Ÿ”„ Phase 2 Binary Diffing Tools** ๐Ÿ†• **v1.3.0** | Tool | Description | Features | |------|-------------|----------| | **๐Ÿ“Š Binary File Diff** | Comprehensive binary comparison | AI-powered security analysis, metadata comparison | | **๐Ÿ“ Strings Diff** | String-based binary comparison | Multi-encoding support, pattern analysis | | **๐Ÿ”ง Functions Diff** | Function-level comparison analysis | Decompilation diff with AI insights | | **๐Ÿ“‹ Metadata Diff** | Binary metadata comparison | ELF headers, sections, symbols analysis | ### **๐Ÿค– AI & Management** | Tool | Description | Use Case | |------|-------------|----------| | **๐Ÿค– Multi-Model Queries** | Expert assistance with 7 AI providers | Knowledge base | | **๐Ÿ”ง AI Model Status** | Provider management and testing | System monitoring | --- ## ๐Ÿ”„ **Binary Diffing Capabilities** ๐Ÿ†• **v1.3.0** **Phase 2** introduces advanced binary comparison and diffing tools with AI-powered security analysis: ### **๐ŸŽฏ Core Diffing Features** - **๐Ÿ“Š File-Level Comparison** - Complete binary diff with security impact analysis - **๐Ÿ“ String Diffing** - Multi-encoding string comparison with pattern detection - **๐Ÿ”ง Function Analysis** - Decompilation-based function comparison - **๐Ÿ“‹ Metadata Diffing** - ELF headers, sections, and symbol analysis ### **๐Ÿค– AI-Enhanced Analysis** - **๐Ÿ›ก๏ธ Security Impact Assessment** - Automated vulnerability risk analysis - **๐Ÿ” Pattern Recognition** - Intelligent change detection and categorization - **โšก Async Processing** - High-performance concurrent analysis - **๐Ÿ’พ Smart Caching** - Intelligent caching with automatic cleanup ### **๐Ÿ—๏ธ Technical Specifications** - **โšก Performance**: 5-30 seconds for typical binary pairs - **๐Ÿ’ฐ Cost Efficient**: $0.02-0.10 per comparison with AI analysis - **๐Ÿ”’ Secure Processing**: Local analysis with optional AI enhancement - **๐Ÿ“Š Structured Output**: JSON format for programmatic consumption --- ## ๐Ÿ† **Performance Specifications** - **โšก Quick Analysis**: 30-60 seconds - **๐Ÿ” Deep Analysis**: 120-240 seconds - **๐Ÿ’ฐ Cost Efficient**: $0.05-0.80 per analysis - **๐ŸŽฏ Multi-Platform**: Linux distributions supported - **๐Ÿ”’ Secure**: No data retention, API key protection --- ## ๐Ÿ“š **Documentation** - **๐Ÿ“– [Deployment Guide](GHIDRA_GPT5_DEPLOYMENT_GUIDE.md)** - Complete setup instructions - **๐Ÿ”ง [Project Summary](GHIDRA_GPT5_PROJECT_SUMMARY.md)** - Technical specifications - **โœ… [Installation Verification](verify_setup.sh)** - Test your setup - **๐Ÿข [Copyright Information](COPYRIGHT.txt)** - Legal terms and licensing --- ## ๐ŸŽฏ **Target Audience** - **๐Ÿ” Cybersecurity Professionals** - Advanced threat analysis - **๐ŸŽฎ CTF Competitors** - Rapid binary reverse engineering - **๐Ÿ›ก๏ธ Penetration Testers** - Exploit development and analysis - **๐Ÿฆ  Malware Analysts** - Threat intelligence and research - **๐Ÿญ Security Researchers** - Vulnerability discovery - **๐ŸŽ“ Educators & Students** - Learning reverse engineering --- ## ๐Ÿ”ง **System Requirements** | Component | Requirement | |-----------|-------------| | **OS** | Linux (Kali, Ubuntu, RHEL, CentOS, etc.) | | **Python** | 3.8+ with pip | | **Memory** | 4GB+ RAM recommended | | **Storage** | 2GB+ free space | | **Network** | Internet access for API calls | || **Ghidra** | REQUIRED - Download from NSA GitHub | --- ## ๐Ÿ›ก๏ธ **Security & Legal** ### **โš–๏ธ Legal Notice** - **๐Ÿข Property**: TechSquad Inc. proprietary software - **โŒ Not For Resale**: Commercial distribution prohibited - **โœ… Legal Use Only**: Authorized for legitimate security research - **๐Ÿ”’ Disclaimer**: Neither TechSquad Inc. nor TheStingR is responsible for improper use ### **๐Ÿ” Security Features** - **๐Ÿ”‘ API Key Protection** - Secure credential management - **๐Ÿ—‘๏ธ No Data Retention** - Analysis results not stored remotely - **๐Ÿ”’ Local Processing** - Ghidra analysis performed locally - **๐Ÿ“ Audit Logging** - Complete operation logging --- ## ๐Ÿ™ **Acknowledgments** ### **Issue Reporting & Testing** - **[PurpleTeam-TechSquad](https://github.com/PurpleTeam-TechSquad)** - Critical bug discovery and comprehensive testing - Identified Python version detection failure on Python 3.13+ systems - Discovered Ghidra path hardcoding issues on Debian/Ubuntu/Kali systems - Reported API key validation limitations for project-based keys - Provided detailed testing environment and reproduction steps - Testing Environment: Kali GNU/Linux Rolling 2025.3 - Test Duration: 45 minutes comprehensive installation and functionality testing ### **Special Thanks** We sincerely thank PurpleTeam-TechSquad for their thorough external testing that identified critical compatibility issues, enabling us to make MCP-Ghidra5 truly production-ready across multiple Linux distributions. --- ## ๐Ÿค **Contributing** This is **TechSquad Inc. proprietary software**. For feature requests, bug reports, or collaboration inquiries: 1. **๐Ÿ“ง Contact**: Via GitHub issues 2. **๐Ÿ› Bug Reports**: Include system details and logs 3. **๐Ÿ’ก Feature Requests**: Describe use case and requirements 4. **๐Ÿ“‹ Pull Requests**: Contact maintainers first --- ## ๐Ÿท๏ธ **Version History** ### **v1.3.0** (September 2025) - **PHASE 2 BINARY DIFFING** ๐Ÿ†• - ๐Ÿ”„ **4 New Binary Diffing Tools** - file, strings, functions, metadata comparison - ๐Ÿค– **AI-Powered Security Analysis** - Intelligent vulnerability impact assessment - โšก **Async Engine Architecture** - High-performance concurrent processing - ๐Ÿ’พ **Smart Caching System** - Optimized performance with automatic cleanup - ๐Ÿ›ก๏ธ **Enhanced Security** - Advanced validation for binary comparison operations - ๐Ÿ“Š **Structured JSON Output** - Programmatic access to comparison results - ๐Ÿงช **Comprehensive Testing** - Full test suite with 100% pass rate - ๐Ÿ”ง **Repository Optimization** - Clean structure with docs/ and tests/ organization ### **v1.2.0** (September 2025) - **TIER 1 TOOLS UPDATE** ๐Ÿ†• - โšก **5 New Tier 1 Binary Tools** - strings, file, objdump, readelf, hexdump analysis - ๐Ÿ“Š **JSON Output Support** - Structured data output for programmatic consumption - ๐Ÿš€ **Intelligent Caching** - 1-hour TTL cache system with automatic cleanup - ๐Ÿ”’ **Enhanced Security** - Advanced input validation for all new tools - ๐Ÿค– **AI-Powered Analysis** - Each tool includes optional AI security assessment - ๐Ÿ“ **Pattern Recognition** - Automated detection of crypto, URLs, suspicious content - ๐ŸŽฏ **Cross-Platform Tested** - Validated on Ubuntu 22.04/24.04, Kali Linux, Debian 12 - ๐Ÿ“ฆ **Docker Ready** - Complete containerized testing infrastructure ### **v1.1.0** (January 2025) - **MAJOR UPDATE** ๐Ÿš€ - ๐Ÿค– **Multi-Model AI Integration** - 7 AI providers with intelligent fallback - ๐Ÿ’ฐ **Cost Optimization** - Smart model selection saving 30-50% on costs - ๐Ÿ”’ **Local LLM Support** - Ollama integration for private offline analysis - ๐Ÿ“Š **Usage Analytics** - Comprehensive tracking and monitoring - ๐Ÿ”ง **AI Model Management** - Built-in testing and configuration tools - โšก **Performance Improvements** - Full async processing and caching - ๐Ÿ›ก๏ธ **Enhanced Security** - Advanced input validation and path controls - ๐Ÿ“ˆ **99.9% Uptime** - Automatic fallback ensures continuous availability ### **v1.0.1** (September 2024) - ๐Ÿ”ง **Critical Bug Fixes** (Thanks to PurpleTeam-TechSquad!) - โœ… Fixed Python version detection for Python 3.13+ systems - โœ… Added Ghidra path auto-detection for Debian/Ubuntu/Kali - โœ… Enhanced API key validation for project-based keys - โœ… Improved Python package management for externally-managed environments - โœ… Added comprehensive AI provider compatibility testing - โœ… Enhanced cross-platform Linux distribution support ### **v1.0.0** (September 2024) - โœ… Initial public release - โœ… 7 advanced analysis tools - โœ… GPT-5 integration - โœ… Comprehensive installer - โœ… Terminal Terminal support - โœ… Multi-architecture compatibility --- ## ๐Ÿ“ž **Support** - **๐Ÿ“š Documentation**: See included guides and README files - **๐Ÿ› Issues**: GitHub Issues tab - **๐Ÿ’ฌ Community**: Cybersecurity forums and Discord - **โšก Emergency**: Critical security research support available --- ## โญ **Star This Repository** If **MCP-Ghidra5** helps your security research, please **โญ star this repository** to support continued development! ---
**๐Ÿข Copyright ยฉ 2024 TechSquad Inc. - All Rights Reserved** **๐Ÿ‘จโ€๐Ÿ’ป Coded by: [TheStingR](https://github.com/TheStingR)** **๐Ÿ”’ Proprietary Software - NOT FOR RESALE** *Licensed for legal cybersecurity research and education*
---
[![GitHub stars](https://img.shields.io/github/stars/TheStingR/MCP-Ghidra5.svg)](https://github.com/TheStingR/MCP-Ghidra5/stargazers) [![GitHub forks](https://img.shields.io/github/forks/TheStingR/MCP-Ghidra5.svg)](https://github.com/TheStingR/MCP-Ghidra5/network) [![GitHub issues](https://img.shields.io/github/issues/TheStingR/MCP-Ghidra5.svg)](https://github.com/TheStingR/MCP-Ghidra5/issues)