Skip to main content
Glama

cooper-hewitt-mcp

imageUtils.ts570 B
import fetch from 'node-fetch'; export async function fetchImageAsBase64(url: string): Promise<string | null> { try { const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to fetch image: ${response.statusText}`); } const arrayBuffer = await response.arrayBuffer(); const buffer = Buffer.from(arrayBuffer); return `data:${response.headers.get('content-type') || 'image/jpeg'};base64,${buffer.toString('base64')}`; } catch (error) { console.error('Error fetching image:', error); return null; } }

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/behole/cooper-hewitt-mcp'

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