Skip to main content
Glama

Stability AI MCP Server

by tadasant
resourceClientFactory.ts1.08 kB
import { ResourceClient } from "./resourceClient.js"; import { FilesystemResourceClient } from "./filesystemResourceClient.js"; import { GcsResourceClient } from "./gcsResourceClient.js"; import { GcsClient } from "../gcs/gcsClient.js"; let instance: ResourceClient | null = null; export type ResourceClientConfig = | { type: "filesystem"; imageStorageDirectory: string; } | { type: "gcs"; gcsConfig?: { privateKey?: string; clientEmail?: string; projectId?: string; bucketName?: string; }; }; export function initializeResourceClient(config: ResourceClientConfig) { if (instance) { throw new Error("ResourceClient has already been initialized"); } if (config.type === "filesystem") { instance = new FilesystemResourceClient(config.imageStorageDirectory); } else { const gcsClient = new GcsClient(config.gcsConfig); instance = new GcsResourceClient(gcsClient); } } export function getResourceClient(): ResourceClient { if (!instance) { throw new Error("ResourceClient has not been initialized"); } return instance; }

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/tadasant/mcp-server-stability-ai'

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