UNPKG

@makingchatbots/genesys-cloud-mcp-server

Version:

A Model Context Protocol (MCP) server exposing Genesys Cloud tools for LLMs, including sentiment analysis, conversation search, topic detection and more.

38 lines (37 loc) 1.43 kB
import { z } from "zod"; const genesysAuthConfigSchema = z.object({ GENESYSCLOUD_REGION: z.string({ required_error: "Missing environment variable: GENESYSCLOUD_REGION", }), GENESYSCLOUD_OAUTHCLIENT_ID: z.string({ required_error: "Missing environment variable: GENESYSCLOUD_OAUTHCLIENT_ID", }), GENESYSCLOUD_OAUTHCLIENT_SECRET: z.string({ required_error: "Missing environment variable: GENESYSCLOUD_OAUTHCLIENT_SECRET", }), }); export function createConfigRetriever(env) { return { getGenesysCloudConfig: () => { const genesysAuthConfig = genesysAuthConfigSchema.safeParse(env); if (!genesysAuthConfig.success) { const failureReason = [ "Failed to parse environment variables", ...genesysAuthConfig.error.issues.map((i) => i.message), ].join("\n"); return { success: false, reason: failureReason, }; } return { success: true, value: { region: genesysAuthConfig.data.GENESYSCLOUD_REGION, oAuthClientId: genesysAuthConfig.data.GENESYSCLOUD_OAUTHCLIENT_ID, oAuthClientSecret: genesysAuthConfig.data.GENESYSCLOUD_OAUTHCLIENT_SECRET, }, }; }, }; }