Skip to main content
Glama
Cyreslab-AI

Shodan MCP Server

get_ssl_info

Retrieve SSL certificate details for any domain to analyze security configurations and identify potential vulnerabilities in internet-connected devices.

Instructions

Get SSL certificate information for a domain

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain name to look up SSL certificates for (e.g., example.com)

Implementation Reference

  • Core implementation of the get_ssl_info tool. Performs Shodan search with query 'ssl:{domain}', processes matches to extract SSL certificate details including subject, issuer, expiration dates, fingerprint, cipher, and version. Handles sampling and errors.
    async getSslInfo(domain: string): Promise<any> {
      try {
        // Use Shodan search to find SSL certificates for the domain
        const query = `ssl:${domain}`;
        const response = await this.axiosInstance.get("/shodan/host/search", {
          params: { query }
        });
    
        // Extract and format SSL certificate information
        const results = this.sampleResponse(response.data, 5);
    
        // Process the results to extract SSL certificate details
        if (results.matches && results.matches.length > 0) {
          const sslInfo = results.matches.map((match: any) => {
            if (match.ssl && match.ssl.cert) {
              return {
                ip: match.ip_str,
                port: match.port,
                subject: match.ssl.cert.subject,
                issuer: match.ssl.cert.issuer,
                expires: match.ssl.cert.expires,
                issued: match.ssl.cert.issued,
                fingerprint: match.ssl.cert.fingerprint,
                cipher: match.ssl.cipher,
                version: match.ssl.version
              };
            }
            return null;
          }).filter(Boolean);
    
          return {
            total: sslInfo.length,
            certificates: sslInfo
          };
        }
    
        return { total: 0, certificates: [] };
      } catch (error: unknown) {
        if (axios.isAxiosError(error)) {
          if (error.response?.status === 401) {
            return {
              error: "Unauthorized: The Shodan search API requires a paid membership. Your API key does not have access to this endpoint.",
              message: "The SSL certificate lookup functionality requires a Shodan membership subscription with API access. Please upgrade your Shodan plan to use this feature.",
              status: 401
            };
          }
          throw new McpError(
            ErrorCode.InternalError,
            `Shodan API error: ${error.response?.data?.error || error.message}`
          );
        }
        throw error;
      }
    }
  • MCP server CallToolRequestSchema handler for 'get_ssl_info'. Validates domain input, invokes ShodanClient.getSslInfo, handles 401 errors gracefully, and returns JSON-formatted response.
    case "get_ssl_info": {
      const domain = String(request.params.arguments?.domain);
      if (!domain) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Domain name is required"
        );
      }
    
      try {
        const sslInfo = await shodanClient.getSslInfo(domain);
    
        // Check if we got an error response from the SSL info method
        if (sslInfo.error && sslInfo.status === 401) {
          return {
            content: [{
              type: "text",
              text: JSON.stringify(sslInfo, null, 2)
            }]
          };
        }
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify(sslInfo, null, 2)
          }]
        };
      } catch (error) {
        if (error instanceof McpError) {
          throw error;
        }
        throw new McpError(
          ErrorCode.InternalError,
          `Error getting SSL certificate information: ${(error as Error).message}`
        );
      }
    }
  • src/index.ts:968-981 (registration)
    Registration of the 'get_ssl_info' tool in the ListToolsRequestSchema response, including name, description, and input schema definition.
    {
      name: "get_ssl_info",
      description: "Get SSL certificate information for a domain",
      inputSchema: {
        type: "object",
        properties: {
          domain: {
            type: "string",
            description: "Domain name to look up SSL certificates for (e.g., example.com)"
          }
        },
        required: ["domain"]
      }
    },
  • Input schema definition for the get_ssl_info tool, specifying a required 'domain' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        domain: {
          type: "string",
          description: "Domain name to look up SSL certificates for (e.g., example.com)"
        }
      },
      required: ["domain"]
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. It states what the tool does but lacks critical details: whether it performs live lookups or uses cached data, rate limits, authentication requirements, error handling, or what format the SSL information is returned in. For a tool with no annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for a simple lookup tool and front-loads the essential information without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool that likely returns structured SSL data. It doesn't explain what information is returned (e.g., expiration dates, issuer, certificate chain) or how results are formatted. For a security/network tool with potential complexity in output, more context about return values would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'domain' clearly documented in the schema. The description doesn't add any parameter details beyond what's in the schema (e.g., no examples of valid domain formats beyond what's implied, no edge cases). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'SSL certificate information for a domain', making the purpose immediately understandable. It distinguishes from siblings like 'dns_lookup' or 'reverse_dns_lookup' by focusing specifically on SSL certificates. However, it doesn't explicitly contrast with other security-related tools like 'get_cve_info' or 'get_domain_info', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_domain_info' that might include SSL data, and 'dns_lookup' for domain resolution, there's no indication of when this specific SSL-focused tool is preferred. No prerequisites, exclusions, or comparative context are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Cyreslab-AI/shodan-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server