Skip to main content
Glama
CloudWaddie

OSINT MCP Server

url_metadata

Extract metadata from URLs to analyze web content for security research and intelligence gathering.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to scrape metadata from

Implementation Reference

  • The scrapeMetadata method in SocialScraperClient implements the scraping logic used by the url_metadata tool.
      async scrapeMetadata(url: string): Promise<any> {
        try {
          const response = await fetch(url);
          const html = await response.text();
    
          const metadata: any = {
            title: "",
            description: "",
            ogTitle: "",
            ogDescription: "",
            ogImage: "",
            twitterCard: "",
            generator: "",
          };
    
          // Simple regex-based extraction to avoid heavy dependencies like cheerio
          const titleMatch = html.match(/<title>(.*?)<\/title>/i);
          if (titleMatch) metadata.title = titleMatch[1];
    
          const metaMatches = html.matchAll(/<meta\s+(?:name|property)="([^"]+)"\s+content="([^"]+)"/gi);
          for (const match of metaMatches) {
            const prop = match[1].toLowerCase();
            const content = match[2];
    
            if (prop === "description") metadata.description = content;
            if (prop === "og:title") metadata.ogTitle = content;
            if (prop === "og:description") metadata.ogDescription = content;
            if (prop === "og:image") metadata.ogImage = content;
            if (prop === "twitter:card") metadata.twitterCard = content;
            if (prop === "generator") metadata.generator = content;
          }
    
          return metadata;
        } catch (error) {
          throw new McpError(ErrorCode.InternalError, `Social Scraper error: ${(error as Error).message}`);
        }
      }
    }
  • src/index.ts:501-509 (registration)
    Registration of the url_metadata tool within the server instance.
    server.tool(
      "url_metadata",
      { url: z.string().url().describe("URL to scrape metadata from") },
      async ({ url }) => {
        const result = await socialClient.scrapeMetadata(url);
        return {
          content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
        };
      }

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

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