SpiderFoot MCP Server
Enables interaction with SpiderFoot's OSINT scanning capabilities through Claude and other MCP-compatible tools. Supports comprehensive scan management, real-time monitoring, result retrieval, and export functionality for reconnaissance and investigation workflows.
README
SpiderFoot MCP Server
A Model Context Protocol (MCP) server that provides SpiderFoot scanning capabilities through a standardized interface.
Overview
This MCP server allows you to interact with SpiderFoot's OSINT scanning capabilities through Claude and other MCP-compatible tools. It provides comprehensive scan management, result retrieval, and export functionality.
Features
- Scan Management: Start, stop, delete, and monitor SpiderFoot scans
- Real-time Status: Get scan status, progress, and completion notifications
- Result Access: Retrieve scan results, summaries, and logs
- Export Capabilities: Export scan data in JSON, CSV, and Excel formats
- Search Functionality: Search across scan results
- Server Health: Ping server and check connectivity/version
- Module Management: Access available SpiderFoot modules
Prerequisites
- Python 3.8+
- Access to a SpiderFoot server (local or remote)
- Required Python packages (see Installation)
Installation
- Install required dependencies:
pip install requests python-dotenv mcp
- Set up environment variables in
.env:
SPIDERFOOT_URL=https://your-spiderfoot-server.com
SPIDERFOOT_USERNAME=your-username
SPIDERFOOT_PASSWORD=your-password
Configuration
The server expects these environment variables:
SPIDERFOOT_URL: Base URL of your SpiderFoot instance (default:http://localhost:5001)SPIDERFOOT_USERNAME: Username for HTTP digest authentication (default:admin)SPIDERFOOT_PASSWORD: Password for authentication (required)
Available MCP Tools
Core Scan Operations
start_scan(target, scan_name, modules?, use_case?)- Start a new scanget_scan_status(scan_id)- Get current scan statuslist_scans()- List all scans on the serverstop_scan(scan_id)- Stop a running scandelete_scan(scan_id)- Delete a scan and its data
Results and Analysis
get_scan_results(scan_id, event_type?)- Get scan resultsget_scan_summary(scan_id, by?)- Get scan summary by module/typeget_scan_log(scan_id, limit?, from_rowid?)- Get scan log entriesexport_scan_results(scan_id, export_format?)- Export results (JSON/CSV/Excel)search_scan_results(query, scan_id?)- Search across results
Utility Functions
ping()- Test server connectivity and get versionget_available_modules()- List available SpiderFoot moduleswait_for_scan_completion(scan_id, poll_interval?, timeout?)- Wait for scan completionget_active_scans_summary()- Get summary of tracked scans
Usage Examples
Starting a Scan
# Passive scan with default modules
start_scan("example.com", "example-scan", use_case="passive")
# Custom scan with specific modules
start_scan("example.com", "custom-scan", modules=["sfp_dnsresolve", "sfp_dnscommonsrv"])
Monitoring Progress
# Check status
status = get_scan_status("scan-id")
# Wait for completion
wait_for_scan_completion("scan-id", poll_interval=5, timeout=300)
Retrieving Results
# Get all results
results = get_scan_results("scan-id")
# Get summary by module
summary = get_scan_summary("scan-id", by="module")
# Export to JSON
export_data = export_scan_results("scan-id", "json")
Running the Server
Development/Testing
python test_client.py # Test client functionality
python server.py # Run MCP server
Production
The server automatically validates environment variables and tests connectivity on startup.
API Implementation Details
Authentication
Uses HTTP Digest Authentication as required by SpiderFoot API v4.0.
Response Handling
The implementation properly handles SpiderFoot's unique response formats:
- List responses:
['SUCCESS', 'data']or['ERROR', 'message'] - Scan data: Arrays with positional fields
[id, name, target, created, started, completed, status, ...] - JSON responses: Standard dictionaries for modules and complex data
Key Fixes Applied
- JSON Accept Header: Required for JSON responses instead of HTML
- Module Specification: Even with use cases, specific modules must be provided
- Parameter Names: Correct parameter names for each endpoint (
idsvsid,byparameter for summaries) - Response Format Handling: Proper parsing of list-based responses
Supported SpiderFoot Versions
- Primary: SpiderFoot v4.0.0
- Compatibility: Should work with SpiderFoot v4.x series
Use Cases
Passive Reconnaissance
start_scan("target-domain.com", "recon-scan", use_case="passive")
Investigation
start_scan("suspicious-domain.com", "investigation", use_case="investigate")
Footprinting
start_scan("company-domain.com", "footprint", use_case="footprint")
Error Handling
The server provides comprehensive error handling with detailed messages:
- Connection failures
- Authentication errors
- Invalid scan parameters
- API endpoint errors
- Response parsing issues
Security Considerations
- Credentials are loaded from environment variables
- HTTP Digest Authentication for API security
- No secrets logged or exposed in responses
- Secure handling of scan data
Troubleshooting
Common Issues
- 404 Errors: Usually indicate incorrect endpoint or missing parameters
- Authentication Failures: Check username/password and server accessibility
- Module Errors: Ensure modules are specified even with use cases
- Connection Issues: Verify server URL and network connectivity
Testing Connectivity
ping_result = ping()
# Check ping_result['success'] and ping_result['server_version']
Debug Logging
Enable debug logging in the client for detailed API call information.
Development Notes
- The implementation follows SpiderFoot's official
sfclipatterns - All endpoints tested against live SpiderFoot v4.0.0 instance
- MCP tools provide structured responses with success/error handling
- Maintains compatibility with both single and batch operations
Contributing
When extending functionality:
- Follow existing error handling patterns
- Handle both list and dict response formats
- Test against actual SpiderFoot instance
- Update documentation for new tools
License
This project follows the same licensing as SpiderFoot for compatibility.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.