Home

Awesome

Shodan MCP Server

A Model Context Protocol (MCP) server for querying the Shodan API and Shodan CVEDB. This server provides comprehensive access to Shodan's network intelligence and security services, including IP reconnaissance, DNS operations, vulnerability tracking, and device discovery. All tools provide structured, formatted output for easy analysis and integration.

<a href="https://glama.ai/mcp/servers/79uakvikcj"><img width="380" height="200" src="https://glama.ai/mcp/servers/79uakvikcj/badge" /></a>

Quick Start (Recommended)

  1. Install the server globally via npm:
npm install -g @burtthecoder/mcp-shodan
  1. Add to your Claude Desktop configuration file:
{
  "mcpServers": {
    "shodan": {
      "command": "mcp-shodan",
      "env": {
        "SHODAN_API_KEY": "your-shodan-api-key"
      }
    }
  }
}

Configuration file location:

  1. Restart Claude Desktop

Alternative Setup (From Source)

If you prefer to run from source or need to modify the code:

  1. Clone and build:
git clone https://github.com/BurtTheCoder/mcp-shodan.git
cd mcp-shodan
npm install
npm run build
  1. Add to your Claude Desktop configuration:
{
  "mcpServers": {
    "shodan": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-shodan/build/index.js"],
      "env": {
        "SHODAN_API_KEY": "your-shodan-api-key"
      }
    }
  }
}

Features

Tools

1. IP Lookup Tool

2. Shodan Search Tool

3. CVE Lookup Tool

4. DNS Lookup Tool

5. Reverse DNS Lookup Tool

6. CPE Lookup Tool

7. CVEs by Product Tool

Requirements

Troubleshooting

API Key Issues

If you see API key related errors (e.g., "Request failed with status code 401"):

  1. Verify your API key:

    • Must be a valid Shodan API key from your account settings
    • Ensure the key has sufficient credits/permissions for the operation
    • Check for extra spaces or quotes around the key in the configuration
    • Verify the key is correctly set in the SHODAN_API_KEY environment variable
  2. Common Error Codes:

    • 401 Unauthorized: Invalid API key or missing authentication
    • 402 Payment Required: Out of query credits
    • 429 Too Many Requests: Rate limit exceeded
  3. Configuration Steps: a. Get your API key from Shodan Account b. Add it to your configuration file:

    {
      "mcpServers": {
        "shodan": {
          "command": "mcp-shodan",
          "env": {
            "SHODAN_API_KEY": "your-actual-api-key-here"
          }
        }
      }
    }
    

    c. Save the config file d. Restart Claude Desktop

  4. Testing Your Key:

    • Try a simple query first (e.g., dns_lookup for "google.com")
    • Check your Shodan account dashboard for credit status
    • Verify the key works directly with curl:
      curl "https://api.shodan.io/dns/resolve?hostnames=google.com&key=your-api-key"
      

Module Loading Issues

If you see module loading errors:

  1. For global installation: Use the simple configuration shown in Quick Start
  2. For source installation: Ensure you're using Node.js v18 or later

Development

To run in development mode with hot reloading:

npm run dev

Error Handling

The server includes comprehensive error handling for:

Version History

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.