The Shodan MCP Server is a Model Context Protocol server developed by Cyreslab.ai that provides access to Shodan API functionality. This server enables AI assistants like Claude to query information about internet-connected devices and services, enhancing cybersecurity research and threat intelligence capabilities.
GitHub Repository: https://github.com/Cyreslab-AI
Contact: [email protected]
shell
git clone https://github.com/Cyreslab-AI/shodan-mcp-server.git
cd shodan-mcp-server
shell
npm install
shell
npm run build
.env
file in the root directorySHODAN_API_KEY=your_api_key_here
To use this server with Claude or other MCP-compatible assistants, add it to your MCP configuration:
{
"mcpServers": {
"mcp-shodan-server": {
"command": "node",
"args": ["/path/to/shodan-mcp-server/build/index.js"],
"env": {
"SHODAN_API_KEY": "YOUR_SHODAN_API_KEY_HERE"
}
}
}
}
Use the get_host_info
tool to retrieve detailed information about a specific IP address:
<use_mcp_tool>
<server_name>mcp-shodan-server</server_name>
<tool_name>get_host_info</tool_name>
<arguments>
{
"ip": "8.8.8.8"
}
</arguments>
</use_mcp_tool>
With field selection and response sampling:
<use_mcp_tool>
<server_name>mcp-shodan-server</server_name>
<tool_name>get_host_info</tool_name>
<arguments>
{
"ip": "8.8.8.8",
"max_items": 3,
"fields": ["ip_str", "ports", "hostnames", "location.country_name"]
}
</arguments>
</use_mcp_tool>
Use the search_shodan
tool to search Shodan's database for devices and services:
<use_mcp_tool>
<server_name>mcp-shodan-server</server_name>
<tool_name>search_shodan</tool_name>
<arguments>
{
"query": "apache country:US",
"page": 1,
"facets": ["country", "org"]
}
</arguments>
</use_mcp_tool>
With result summarization:
<use_mcp_tool>
<server_name>mcp-shodan-server</server_name>
<tool_name>search_shodan</tool_name>
<arguments>
{
"query": "apache country:US",
"summarize": true
}
</arguments>
</use_mcp_tool>
Use the get_vulnerabilities
tool to retrieve information about a specific CVE:
<use_mcp_tool>
<server_name>mcp-shodan-server</server_name>
<tool_name>get_vulnerabilities</tool_name>
<arguments>
{
"cve": "CVE-2021-44228"
}
</arguments>
</use_mcp_tool>
Use the scan_network_range
tool to analyze devices within a CIDR range:
<use_mcp_tool>
<server_name>mcp-shodan-server</server_name>
<tool_name>scan_network_range</tool_name>
<arguments>
{
"cidr": "192.168.1.0/24",
"max_items": 10,
"fields": ["ip_str", "ports", "hostnames", "os"]
}
</arguments>
</use_mcp_tool>
Use the get_dns_info
tool to retrieve DNS records for a domain:
<use_mcp_tool>
<server_name>mcp-shodan-server</server_name>
<tool_name>get_dns_info</tool_name>
<arguments>
{
"domain": "example.com"
}
</arguments>
</use_mcp_tool>
Use the get_ssl_info
tool to analyze SSL certificates for a domain:
<use_mcp_tool>
<server_name>mcp-shodan-server</server_name>
<tool_name>get_ssl_info</tool_name>
<arguments>
{
"domain": "example.com"
}
</arguments>
</use_mcp_tool>
Use the search_iot_devices
tool to find specific types of IoT devices:
<use_mcp_tool>
<server_name>mcp-shodan-server</server_name>
<tool_name>search_iot_devices</tool_name>
<arguments>
{
"device_type": "webcam",
"country": "US",
"max_items": 5
}
</arguments>
</use_mcp_tool>
apache country:US
: Find Apache servers in the United Statesport:22 country:DE
: Find SSH servers in Germanywebcam has_screenshot:true
: Find webcams with screenshotsorg:"Microsoft" product:"Windows"
: Find Microsoft Windows devicesssl:Google
: Find SSL certificates issued to GoogleFor search results with many matches, you can paginate through the results by specifying the page
parameter:
{
"query": "apache country:US",
"page": 2
}
Facets allow you to get summary information about the search results. For example, you can get a breakdown of the countries or organizations in the search results:
{
"query": "apache",
"facets": ["country", "org"]
}
Common facets include:
country
: Country codeorg
: Organizationdomain
: Domain nameport
: Port numberasn
: Autonomous System Numberos
: Operating SystemTo reduce token usage, all responses are automatically sampled to include a limited number of items in arrays. You can control this with the max_items
parameter:
{
"query": "apache country:US",
"max_items": 10
}
You can specify which fields to include in the results using the fields
parameter:
{
"query": "apache country:US",
"fields": ["ip_str", "port", "org", "location.country_name"]
}
This supports nested fields using dot notation (e.g., location.country_name
).
For search results, you can request a summary instead of the full data:
{
"query": "apache country:US",
"summarize": true
}
This will return:
Future versions of this server will include:
Have feature suggestions or found a bug? Please open an issue on our GitHub repository or contact us directly at [email protected].
A Model Context Protocol server that provides access to Shodan API functionality.