Skip to main content
Glama
awaitableWritableStream.ts762 B
import { Writable } from 'stream'; import { Deferred } from './deferred.js'; export class AwaitableWritableStream { private readonly _deferred = new Deferred<void>(); private readonly _writableStream: Writable; private readonly _chunks: Array<any> = []; constructor() { this._writableStream = new Writable({ write: (chunk, _encoding, callback): void => { this._chunks.push(chunk); callback(); }, final: (callback): void => { callback(); this._deferred.resolve(); }, }); } get stream(): Writable { return this._writableStream; } getChunks = async <T>(map: (chunk: any) => T): Promise<Array<T>> => { await this._deferred.promise; return this._chunks.map(map); }; }

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/datalabs89/tableau-mcp'

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