Skip to main content
Glama
index.jsโ€ข1.17 kB
import { fromArrayBuffer, fromString } from "@smithy/util-buffer-from"; import { toUint8Array } from "@smithy/util-utf8"; import { Buffer } from "buffer"; import { createHash, createHmac } from "crypto"; export class Hash { algorithmIdentifier; secret; hash; constructor(algorithmIdentifier, secret) { this.algorithmIdentifier = algorithmIdentifier; this.secret = secret; this.reset(); } update(toHash, encoding) { this.hash.update(toUint8Array(castSourceData(toHash, encoding))); } digest() { return Promise.resolve(this.hash.digest()); } reset() { this.hash = this.secret ? createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : createHash(this.algorithmIdentifier); } } function castSourceData(toCast, encoding) { if (Buffer.isBuffer(toCast)) { return toCast; } if (typeof toCast === "string") { return fromString(toCast, encoding); } if (ArrayBuffer.isView(toCast)) { return fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength); } return fromArrayBuffer(toCast); }

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/consigcody94/office-whisperer'

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