by Hexix23
Provides a powerful interface to the Shodan API, enabling advanced search, host intelligence, vulnerability discovery, and network mapping for security research.
Shodan Mcp offers a unified command‑line and AI‑assistant interface to the Shodan search engine, allowing security researchers and penetration testers to query internet‑connected devices, retrieve detailed host data, explore DNS information, and assess vulnerabilities without writing custom API calls.
git clone https://github.com/Hexix23/shodan-mcp.git
cd shodan-mcp
pip install -r requirements.txt # or use uv for faster installs
echo "SHODAN_API_KEY=your_api_key_here" > shodan-mcp-server/.env
uv --directory shodan-mcp-server run shodan_mcp.py
search country:DE product:jenkins
, host 8.8.8.8
, cve_info CVE-2023-1234
.Q: Do any commands consume Shodan credits?
A: Yes. Commands like search
and host
that retrieve full records count against your credit balance. count
and get_filters
are credit‑free.
Q: How is the API key secured?
A: The key is stored in a .env
file loaded by python-dotenv
; the file is git‑ignored by default.
Q: Can I run Shodan Mcp on Windows? A: It should work with Python 3.8+ and the required packages, though the README notes limited testing on Windows.
Q: Is there a Docker image available? A: Docker support is planned for a future release; currently you need to run the server locally.
Q: How do I integrate with my favorite IDE?
A: Follow the configuration snippets in the README for Claude, Cursor, or VSCode, adjusting the uv
path and project directory accordingly.
SHODAN-MCP is a powerful interface to the Shodan API, designed to simplify interaction with the world's first search engine for Internet-connected devices. It provides a comprehensive set of tools for security researchers, penetration testers, and cybersecurity professionals to explore, analyze, and monitor the global internet landscape.
"The more systems you can access, the more power you have."
# Clone the repository
git clone https://github.com/yourusername/shodan-mcp.git
cd shodan-mcp
# Install dependencies
pip install -r requirements.txt
# Set up your Shodan API key
echo "SHODAN_API_KEY=your_api_key_here" > shodan-mcp-server/.env
SHODAN-MCP can be integrated with various AI and development environments:
Claude can interact with SHODAN-MCP using the MCP protocol:
In Claude Desktop, go to Settings → Developer → Edit Config
Edit the claude_desktop_config.json
file and add the following configuration:
"mcpServers": {
"shodan": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/shodan-mcp/shodan-mcp-server",
"run",
"shodan_mcp.py"
]
}
}
Replace /path/to/uv
with your actual path to the uv executable (e.g., ~/.local/bin/uv
on macOS/Linux)
Replace /path/to/shodan-mcp
with the actual path to your shodan-mcp project directory
Save the configuration and restart Claude
Now you can ask Claude to use Shodan tools directly in your conversations
Cursor seamlessly integrates with SHODAN-MCP through the MCP configuration file:
The MCP configuration file is located at ~/.cursor/mcp.json
(macOS/Linux)
Add the following configuration to your mcp.json
:
{
"mcpServers": {
"shodan": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/shodan-mcp/shodan-mcp-server",
"run",
"shodan_mcp.py"
],
"env": {}
}
}
}
Replace /path/to/uv
with your actual path to the uv executable (e.g., ~/.local/bin/uv
on macOS/Linux)
Replace /path/to/shodan-mcp
with the actual path to your shodan-mcp project directory
Save the configuration and restart Cursor
The Shodan MCP tools will now be available in your Cursor environment
For VSCode users, add the following to your settings.json file:
Open VS Code settings (⌘+Shift+P, then type "Preferences: Open Settings (JSON)")
Add the following configuration:
"mcp": {
"inputs": [],
"servers": {
"shodan": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/shodan-mcp/shodan-mcp-server",
"run",
"shodan_mcp.py"
],
"env": {}
}
}
}
Replace /path/to/uv
with your actual path to the uv executable (e.g., ~/.local/bin/uv
on macOS/Linux or the full path on Windows)
Replace /path/to/shodan-mcp
with the actual path to your shodan-mcp project directory
Save the settings and restart VS Code
Access through the built-in AI features or command palette
**uv is recommended for managing Python environments and dependencies due to its speed and reliability:
# Install uv if you don't have it
curl -sSf https://github.com/astral-sh/uv/releases/download/0.1.21/uv-installer.sh | sh
# Install project dependencies with uv
uv pip install -r requirements.txt
# Run the MCP server with uv
uv --directory /path/to/shodan-mcp/shodan-mcp-server run shodan_mcp.py
Category | Command | Description |
---|---|---|
Core | test |
Test if the MCP server is working correctly |
Core | check_key |
Verify Shodan API key validity and view account information |
Search | search |
Search the Shodan database with powerful filtering capabilities |
Search | count |
Count results for a query without consuming API credits |
Search | get_filters |
Get all available Shodan search filters |
Search | get_facets |
Get available facets for statistical analysis |
Host | host |
Get detailed information about a specific IP address |
DNS | domain_info |
Get DNS information and subdomains for a domain |
DNS | dns_lookup |
Resolve hostnames to IP addresses |
DNS | reverse_dns |
Find hostnames associated with IP addresses |
Vulnerabilities | cve_info |
Get detailed information about a specific CVE |
Vulnerabilities | find_cpes |
Find CPE identifiers for a specific product |
Vulnerabilities | find_cves |
Find vulnerabilities by product or CPE identifier |
SHODAN-MCP is designed to be used through AI assistants and IDEs that support the MCP protocol. You can interact with Shodan using natural language:
"Find all exposed Jenkins servers in Germany"
"Check if 8.8.8.8 has any known vulnerabilities"
"Show me the distribution of Nginx servers by country"
"List the top 5 countries with vulnerable MongoDB instances"
"Get DNS information for example.com"
Once configured in your IDE or AI assistant, SHODAN-MCP offers the following commands:
Platform | Supported | Notes |
---|---|---|
macOS | ✅ | Tested on Intel & Apple Silicon (M1/M2/M3) |
Linux | ✅ | Tested on Ubuntu 22.04 |
Windows | ⚠️ | Not fully tested, but should work in theory |
Docker | ⚠️ | Support planned but not yet implemented |
Cloud | ⚠️ | Support planned but not yet tested |
Note: This project has been primarily developed and tested on macOS and Linux environments. Contributions to expand and test compatibility on other platforms are welcome!
SHODAN-MCP is built using:
The system uses an asynchronous architecture to provide high-performance, non-blocking API interactions, enabling efficient processing of multiple requests simultaneously.
SHODAN-MCP uses the Shodan API key stored in a .env
file in the project root. This approach keeps your API key secure and separate from the code.
.env
file in the project root with the following content:
SHODAN_API_KEY=your_api_key_here
The .env
file is included in .gitignore
to prevent your API key from being uploaded to public repositories. The project automatically loads the API key from this file using the python-dotenv library.
Security note: Never share your Shodan API key or include it in files that might be uploaded to public repositories.
This tool is designed for legitimate security research and defensive purposes. Users are responsible for ensuring they comply with:
Always obtain proper authorization before scanning or analyzing systems you don't own.
The following features are planned for future releases:
This project was created by a security enthusiast, not a professional developer. There are many areas that could benefit from improvement, and contributions of all kinds are welcome!
If you'd like to contribute, please feel free to submit pull requests or open issues with suggestions. No contribution is too small, and all help is greatly appreciated!
Issue | Solution |
---|---|
API Key errors | Verify your key is valid and correctly configured |
Rate limiting | Implement exponential backoff or upgrade your Shodan plan |
Module not found | Ensure all dependencies are installed correctly |
Integration issues | Check your MCP paths and configurations |
Timeout errors | Increase timeout settings for large queries |
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by chaitin
A self‑hosted web application firewall and reverse proxy that protects web applications from attacks and exploits by filtering, monitoring, and blocking malicious HTTP/S traffic.
by PortSwigger
Enables Burp Suite to communicate with AI clients via the Model Context Protocol, providing an MCP server and bundled stdio proxy.
by cycodehq
Boost security in the development lifecycle via SAST, SCA, secrets, and IaC scanning.
by ChristophEnglisch
Provides AI‑powered administration of Keycloak users and realms through the Model Context Protocol, enabling automated creation, deletion, and listing of users and realms from MCP clients such as Claude Desktop.
by Spathodea-Network
Provides a Model Context Protocol server that enables querying and retrieving threat intelligence data from OpenCTI through a standardized interface.
by firstorderai
Provides seamless access to two‑factor authentication codes and passwords for AI agents, enabling automated login while maintaining security.
by vespo92
Manage OPNsense firewalls through conversational AI, providing network configuration, device discovery, DNS filtering, HAProxy setup, and backup/restore via simple commands.
by mytechnotalent
Provides an AI-driven interface to Malware Bazaar, delivering real-time threat intelligence and sample metadata for authorized cybersecurity research workflows.
by co-browser
Verify that any MCP server is running the intended and untampered code via hardware attestation.