Skip to main content
Glama
Cyreslab-AI

Shodan MCP Server

get_cve_info

Retrieve detailed vulnerability information for a specific CVE ID to support cybersecurity research and threat intelligence analysis.

Instructions

Get detailed information about a specific CVE

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cve_idYesCVE ID to look up (e.g., 'CVE-2021-44228')

Implementation Reference

  • Main handler for the 'get_cve_info' tool in the CallToolRequestSchema switch statement. Validates the 'cve_id' argument and delegates to cvedbClient.getCveInfo().
    case "get_cve_info": {
      const cveId = String(request.params.arguments?.cve_id);
      if (!cveId) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "CVE ID is required"
        );
      }
    
      try {
        const cveInfo = await cvedbClient.getCveInfo(cveId);
        return {
          content: [{
            type: "text",
            text: JSON.stringify(cveInfo, null, 2)
          }]
        };
      } catch (error) {
        if (error instanceof McpError) {
          throw error;
        }
        throw new McpError(
          ErrorCode.InternalError,
          `Error getting CVE info: ${(error as Error).message}`
        );
      }
    }
  • Core implementation of CVE information retrieval in CVEDBClient class. Makes API call to https://cvedb.shodan.io/cve/{cveId} and handles errors like 404.
    async getCveInfo(cveId: string): Promise<any> {
      try {
        const response = await this.axiosInstance.get(`/cve/${cveId}`);
        return response.data;
      } catch (error: unknown) {
        if (axios.isAxiosError(error)) {
          if (error.response?.status === 404) {
            return {
              error: "CVE not found",
              message: `CVE ${cveId} was not found in the database.`,
              status: 404
            };
          }
          throw new McpError(
            ErrorCode.InternalError,
            `CVEDB API error: ${error.response?.data?.error || error.message}`
          );
        }
        throw error;
      }
  • src/index.ts:1155-1168 (registration)
    Tool registration in ListToolsRequestSchema response. Defines name, description, and input schema for 'get_cve_info'.
    {
      name: "get_cve_info",
      description: "Get detailed information about a specific CVE",
      inputSchema: {
        type: "object",
        properties: {
          cve_id: {
            type: "string",
            description: "CVE ID to look up (e.g., 'CVE-2021-44228')"
          }
        },
        required: ["cve_id"]
      }
    },
  • Input schema definition for the 'get_cve_info' tool, specifying required 'cve_id' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        cve_id: {
          type: "string",
          description: "CVE ID to look up (e.g., 'CVE-2021-44228')"
        }
      },
      required: ["cve_id"]

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