/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CreemCore } from "../core.js"; import { SDKOptions } from "../lib/config.js"; import type { ConsoleLogger } from "./console-logger.js"; import { createRegisterPrompt } from "./prompts.js"; import { createRegisterResource, createRegisterResourceTemplate, } from "./resources.js"; import { MCPScope } from "./scopes.js"; import { createRegisterTool } from "./tools.js"; import { tool$checkoutsCreate } from "./tools/checkoutsCreate.js"; import { tool$checkoutsRetrieve } from "./tools/checkoutsRetrieve.js"; import { tool$customersGenerateBillingLinks } from "./tools/customersGenerateBillingLinks.js"; import { tool$customersList } from "./tools/customersList.js"; import { tool$customersRetrieve } from "./tools/customersRetrieve.js"; import { tool$discountsCreate } from "./tools/discountsCreate.js"; import { tool$discountsDelete } from "./tools/discountsDelete.js"; import { tool$discountsGet } from "./tools/discountsGet.js"; import { tool$licensesActivate } from "./tools/licensesActivate.js"; import { tool$licensesDeactivate } from "./tools/licensesDeactivate.js"; import { tool$licensesValidate } from "./tools/licensesValidate.js"; import { tool$productsCreate } from "./tools/productsCreate.js"; import { tool$productsGet } from "./tools/productsGet.js"; import { tool$productsSearch } from "./tools/productsSearch.js"; import { tool$statsGetMetricsSummary } from "./tools/statsGetMetricsSummary.js"; import { tool$subscriptionsCancel } from "./tools/subscriptionsCancel.js"; import { tool$subscriptionsGet } from "./tools/subscriptionsGet.js"; import { tool$subscriptionsPause } from "./tools/subscriptionsPause.js"; import { tool$subscriptionsResume } from "./tools/subscriptionsResume.js"; import { tool$subscriptionsSearchSubscriptions } from "./tools/subscriptionsSearchSubscriptions.js"; import { tool$subscriptionsUpdate } from "./tools/subscriptionsUpdate.js"; import { tool$subscriptionsUpgrade } from "./tools/subscriptionsUpgrade.js"; import { tool$transactionsGetById } from "./tools/transactionsGetById.js"; import { tool$transactionsSearch } from "./tools/transactionsSearch.js"; export function createMCPServer(deps: { logger: ConsoleLogger; allowedTools?: string[] | undefined; scopes?: MCPScope[] | undefined; serverURL?: string | undefined; apiKey?: SDKOptions["apiKey"] | undefined; serverIdx?: SDKOptions["serverIdx"] | undefined; }) { const server = new McpServer({ name: "Creem", version: "1.4.4", }); const client = new CreemCore({ apiKey: deps.apiKey, serverURL: deps.serverURL, serverIdx: deps.serverIdx, }); const scopes = new Set(deps.scopes); const allowedTools = deps.allowedTools && new Set(deps.allowedTools); const tool = createRegisterTool( deps.logger, server, client, scopes, allowedTools, ); const resource = createRegisterResource(deps.logger, server, client, scopes); const resourceTemplate = createRegisterResourceTemplate( deps.logger, server, client, scopes, ); const prompt = createRegisterPrompt(deps.logger, server, client, scopes); const register = { tool, resource, resourceTemplate, prompt }; void register; // suppress unused warnings tool(tool$productsGet); tool(tool$productsCreate); tool(tool$productsSearch); tool(tool$customersList); tool(tool$customersRetrieve); tool(tool$customersGenerateBillingLinks); tool(tool$subscriptionsGet); tool(tool$subscriptionsCancel); tool(tool$subscriptionsUpdate); tool(tool$subscriptionsUpgrade); tool(tool$subscriptionsPause); tool(tool$subscriptionsResume); tool(tool$subscriptionsSearchSubscriptions); tool(tool$checkoutsRetrieve); tool(tool$checkoutsCreate); tool(tool$licensesActivate); tool(tool$licensesDeactivate); tool(tool$licensesValidate); tool(tool$discountsGet); tool(tool$discountsCreate); tool(tool$discountsDelete); tool(tool$transactionsGetById); tool(tool$transactionsSearch); tool(tool$statsGetMetricsSummary); return server; }