Skip to main content
Glama
badchars

osint-mcp-server

by badchars

censys_certificates

Search the Censys certificate database by query (e.g., domain name) to retrieve certificate fingerprints, subjects, issuers, validity periods, and Subject Alternative Names (SANs).

Instructions

Search Censys certificate database. Returns certificate fingerprints, subjects, issuers, validity, and SANs. Requires CENSYS_API_ID + CENSYS_API_SECRET.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesCertificate search query (e.g. 'parsed.names: example.com')
per_pageNoResults per page (max 100, default: 25)

Implementation Reference

  • ToolDef registration for 'censys_certificates' with schema (query, per_page) and execute handler that calls the censysCertificates function with API credentials.
    const censysCertificatesTool: ToolDef = {
      name: "censys_certificates",
      description: "Search Censys certificate database. Returns certificate fingerprints, subjects, issuers, validity, and SANs. Requires CENSYS_API_ID + CENSYS_API_SECRET.",
      schema: {
        query: z.string().describe("Certificate search query (e.g. 'parsed.names: example.com')"),
        per_page: z.number().optional().describe("Results per page (max 100, default: 25)"),
      },
      execute: async (args, ctx) => {
        const id = requireApiKey(ctx.config.censysApiId, "Censys", "CENSYS_API_ID");
        const secret = requireApiKey(ctx.config.censysApiSecret, "Censys", "CENSYS_API_SECRET");
        return json(await censysCertificates(args.query as string, { id, secret }, args.per_page as number | undefined));
      },
    };
  • Main handler for censys_certificates — calls Censys API v2 POST /certificates/search, maps results to CensysCert objects with fingerprint, subject, issuer, validity, and names.
    export async function censysCertificates(query: string, auth: CensysAuth, perPage = 25): Promise<CensysCertsResult> {
      const data = await censysFetch("POST", "/certificates/search", auth, {
        q: query,
        per_page: Math.min(perPage, 100),
      });
    
      const result = data.result ?? {};
      const certificates: CensysCert[] = (result.hits ?? []).map((c: any) => ({
        fingerprint: c.fingerprint_sha256 ?? c.fingerprint ?? "",
        subject: c.parsed?.subject
          ? { commonName: c.parsed.subject.common_name?.[0], organization: c.parsed.subject.organization?.[0] }
          : undefined,
        issuer: c.parsed?.issuer
          ? { commonName: c.parsed.issuer.common_name?.[0], organization: c.parsed.issuer.organization?.[0] }
          : undefined,
        validityStart: c.parsed?.validity?.start,
        validityEnd: c.parsed?.validity?.end,
        names: c.names ?? c.parsed?.names ?? [],
      }));
    
      return { total: result.total ?? 0, certificates, query };
    }
  • Type definitions for certificate search results (CensysCert and CensysCertsResult).
    interface CensysCert {
      fingerprint: string;
      subject?: { commonName?: string; organization?: string };
      issuer?: { commonName?: string; organization?: string };
      validityStart?: string;
      validityEnd?: string;
      names: string[];
    }
    
    interface CensysCertsResult {
      total: number;
      certificates: CensysCert[];
      query: string;
    }
  • Generic HTTP helper for Censys API calls — handles auth headers, rate limiting, and JSON parsing.
    async function censysFetch(method: string, path: string, auth: CensysAuth, body?: any): Promise<any> {
      await limiter.acquire();
      const opts: RequestInit = {
        method,
        headers: {
          Authorization: authHeader(auth),
          Accept: "application/json",
          ...(body ? { "Content-Type": "application/json" } : {}),
        },
        ...(body ? { body: JSON.stringify(body) } : {}),
      };
    
      const res = await fetch(`${CENSYS_BASE}${path}`, opts);
      if (!res.ok) throw new Error(`Censys API error: ${res.status} ${res.statusText}`);
      return res.json();
    }
  • Tool included in the exported list of all tool definitions.
    censysCertificatesTool,
Behavior2/5

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

No annotations provided, and description does not disclose behavioral traits such as read-only nature, rate limits, or pagination behavior beyond per_page parameter.

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?

Two sentences, concise, front-loaded with purpose and return values, no filler.

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

Completeness3/5

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

Adequate for a simple search tool with two parameters, but missing usage alternatives and behavioral context like safety profile.

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 coverage is 100%, so parameters are already well-documented. Description adds auth requirement but no further parameter details beyond schema.

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

Purpose5/5

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

Description clearly states the tool searches the Censys certificate database and lists specific return fields (fingerprints, subjects, issuers), distinguishing it from sibling Censys tools like censys_hosts.

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

Usage Guidelines3/5

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

Mentions required API keys but does not provide guidance on when to use this tool versus alternatives like shodan_search or when not to use it.

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/badchars/osint-mcp-server'

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