Skip to content

al4n4n/firmware-analyzer-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔍 Firmware Analyzer MCP Server Collection

A comprehensive collection of Model Context Protocol (MCP) servers for firmware analysis and password extraction, implemented across four different transport protocols.

📁 Project Structure

rock-firmware/
├── stdio/              # Standard stdio-based MCP server
├── network/            # TCP network-based MCP server  
├── streaming-http/     # HTTP/HTTPS streaming MCP server
├── sse/                # Server-Sent Events (SSE) MCP server
├── requirements.txt    # Python dependencies
├── install.sh         # Installation script
├── firmware_analysis_report.html  # HTML analysis report
├── firmware_analysis_report.md    # Markdown analysis report
└── README.md          # This file

🚀 Quick Start

1. Installation

# Install all dependencies
./install.sh

# Or install manually
sudo apt-get install binwalk squashfs-tools python3-magic libmagic1 python3-aiohttp python3-aiohttp-cors
pip install -r requirements.txt

2. Choose Your Transport

🌐 HTTP Server (Recommended for Web)

cd streaming-http
python3 firmware_analyzer_mcp_http.py --port 8080
# Open browser: http://localhost:8080

🌐 Network Server (Recommended for CLI)

cd network
python3 firmware_analyzer_mcp_network.py --port 8080
python3 network_mcp_client.py --firmware /path/to/firmware.bin

📡 stdio Server (Standard MCP)

cd stdio
python3 firmware_analyzer_mcp.py
# Use with MCP clients

⚡ SSE Server (Real-time Communication)

cd sse
python3 firmware_analyzer_mcp_sse.py --port 8083
# Open browser: http://localhost:8083
# Perfect for VS Code GitHub Copilot integration

🔧 Available Tools

All four implementations provide the same 6 analysis tools:

  1. update_firmware - Upload and validate .bin firmware files
  2. identify_file_format - Detect ZIP, binary, SquashFS formats
  3. extract_with_binwalk - Recursively extract files from binaries
  4. extract_squashfs - Open SquashFS filesystems
  5. find_password_files - Locate /etc/passwd and /etc/shadow
  6. crack_md5_password - Attempt password cracking

🆚 Transport Comparison

Feature stdio Network HTTP SSE
Protocol stdio TCP HTTP/HTTPS SSE + HTTP
Web Interface ✅ Built-in ✅ Built-in
REST API ✅ Yes ✅ Yes
Browser Support ✅ Yes ✅ Yes
Multi-Client ✅ Yes ✅ Yes ✅ Yes
Real-time Updates ✅ Yes
SSL/TLS ✅ Manual ✅ Native ✅ Native
MCP Compliance ✅ Full ✅ Full ⚠️ Custom ⚠️ Custom
VS Code Integration ✅ Direct ❌ Bridge ❌ Bridge ✅ Via Bridge
Performance ✅ Fastest ✅ Fast ⚠️ HTTP overhead ✅ Fast
Ease of Use ⚠️ Moderate ⚠️ Moderate ✅ Very Easy ✅ Very Easy
Integration ⚠️ MCP only ⚠️ TCP only ✅ Universal ✅ Universal

📖 Documentation

  • stdio/ - Standard MCP server with stdio transport
  • network/ - TCP network server with multi-client support
  • streaming-http/ - HTTP server with web interface and REST API
  • sse/ - SSE server with real-time communication and VS Code integration

🎯 Use Cases

Choose stdio if:

  • You need full MCP protocol compliance
  • You're integrating with existing MCP clients
  • You want maximum performance
  • You're building command-line tools

Choose Network if:

  • You need multi-client support
  • You want remote access capabilities
  • You need SSL/TLS encryption
  • You're building distributed systems

Choose HTTP if:

  • You want a web interface
  • You need REST API integration
  • You're building web applications
  • You want the easiest setup and usage
  • You need browser-based access

Choose SSE if:

  • You need real-time communication
  • You want VS Code GitHub Copilot integration
  • You need automatic reconnection
  • You're building modern web applications
  • You want the best of both worlds (HTTP + real-time)

🔍 Analysis Reports

The project includes analysis reports from previous firmware analysis:

  • firmware_analysis_report.html - Interactive HTML report with findings
  • firmware_analysis_report.md - Markdown summary of analysis results

🛠️ Development

Testing

# Test stdio server
cd stdio && python3 direct_firmware_analyzer.py

# Test network server
cd network && python3 test_network_connection.py

# Test HTTP server
cd streaming-http && python3 http_mcp_client.py --test-tools

# Test SSE server
cd sse && python3 firmware_analyzer_mcp_sse.py --port 8083
curl -N http://localhost:8083/sse

Adding New Tools

All four implementations share the same core analysis functions. To add a new tool:

  1. Add the function to the core analysis logic
  2. Update all three server implementations
  3. Update client examples
  4. Update documentation

🔒 Security

  • Password hashes are masked in output for security
  • Temporary files are cleaned up automatically
  • Input validation prevents directory traversal
  • SSL/TLS support for secure communications
  • CORS policies for web security

📄 License

This project is provided for educational and security research purposes. Use responsibly and in accordance with applicable laws and regulations.

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes across all three implementations
  4. Add tests if applicable
  5. Submit a pull request

🎉 Choose the transport that best fits your needs and start analyzing firmware today!

About

Powered by Cursor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published