Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
- name: Smoke test MCP server
env:
PREVENT_LOGIN: "TRUE"
CLAUDE_PLUGIN_OPTION_genesys_region: "DUMMY_VALUE"
CLAUDE_PLUGIN_OPTION_genesys_client_id: "DUMMY_VALUE"
CLAUDE_PLUGIN_OPTION_genesys_client_secret: "DUMMY_VALUE"
DEPLOY_SCRIPT_PATH: "DUMMY_VALUE",
GENESYS_REGION: "DUMMY_VALUE"
GENESYS_CLIENT_ID: "DUMMY_VALUE"
GENESYS_CLIENT_SECRET: "DUMMY_VALUE"
run: pnpm dlx @modelcontextprotocol/inspector --cli node servers/genesys-cloud-architect-mcp.js --method tools/list | grep -q '"tools"'
8 changes: 7 additions & 1 deletion .mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
"mcpServers": {
"genesys-cloud-architect-mcp": {
"command": "node",
"args": ["${CLAUDE_PLUGIN_ROOT}/servers/genesys-cloud-architect-mcp.js"]
"args": ["${CLAUDE_PLUGIN_ROOT}/servers/genesys-cloud-architect-mcp.js"],
"env": {
"GENESYS_REGION": "${user_config.genesys_region}",
"GENESYS_CLIENT_ID": "${user_config.genesys_client_id}",
"GENESYS_CLIENT_SECRET": "${user_config.genesys_client_secret}",
"DEPLOY_SCRIPT_PATH": "${CLAUDE_PLUGIN_ROOT}/bin/deploy-runner.js"
}
}
}
}
Expand Down
84 changes: 42 additions & 42 deletions servers/genesys-cloud-architect-mcp.js

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions src/mcp-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { flowDependencies } from "./tools/flow-dependencies.ts";

const envResults = z
.object({
CLAUDE_PLUGIN_OPTION_genesys_region: z.string().min(1),
CLAUDE_PLUGIN_OPTION_genesys_client_id: z.string().min(1),
CLAUDE_PLUGIN_OPTION_genesys_client_secret: z.string().min(1),
GENESYS_REGION: z.string().min(1),
GENESYS_CLIENT_ID: z.string().min(1),
GENESYS_CLIENT_SECRET: z.string().min(1),
DEPLOY_SCRIPT_PATH: z.string().min(1),
// Used for MCP Server smoke test in CI workflow
PREVENT_LOGIN: z
.enum(["TRUE", "FALSE"])
Expand All @@ -20,7 +21,7 @@ const envResults = z

if (!envResults.success) {
const missing = envResults.error.issues.map((i) => i.path[0]).join("\n ");
console.error(`Missing required environment variables:\n${missing}`);
console.error(`Missing required environment variables:\n ${missing}`);
process.exit(1);
}

Expand All @@ -41,9 +42,10 @@ server.registerTool(
);

const deployFlowTool = deployFlow({
clientId: envVars.CLAUDE_PLUGIN_OPTION_genesys_client_id,
clientSecret: envVars.CLAUDE_PLUGIN_OPTION_genesys_client_secret,
region: envVars.CLAUDE_PLUGIN_OPTION_genesys_region,
region: envVars.GENESYS_REGION,
clientId: envVars.GENESYS_CLIENT_ID,
clientSecret: envVars.GENESYS_CLIENT_SECRET,
deployScriptPath: envVars.DEPLOY_SCRIPT_PATH,
});
server.registerTool(
"deploy_flow",
Expand All @@ -58,10 +60,10 @@ void (async () => {
);
} else {
const client = platformClient.ApiClient.instance;
client.setEnvironment(envVars.CLAUDE_PLUGIN_OPTION_genesys_region);
client.setEnvironment(envVars.GENESYS_REGION);
await client.loginClientCredentialsGrant(
envVars.CLAUDE_PLUGIN_OPTION_genesys_client_id,
envVars.CLAUDE_PLUGIN_OPTION_genesys_client_secret,
envVars.GENESYS_CLIENT_ID,
envVars.GENESYS_CLIENT_SECRET,
);
}

Expand Down
8 changes: 6 additions & 2 deletions src/mcp-server/tools/deploy-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ interface DeployRunnerLine {
}

const DEPLOY_TIMEOUT_MS = 120_000;
const DEPLOY_RUNNER_PATH = path.resolve("bin", "deploy-runner.js");

export interface DeployFlowConfig {
readonly deployScriptPath: string;
readonly region: string;
readonly clientId: string;
readonly clientSecret: string;
Expand Down Expand Up @@ -55,7 +55,11 @@ export const deployFlow: ToolFactory<DeployFlowConfig> = (toolConfig) => ({
};
}

const nodeArgs = [DEPLOY_RUNNER_PATH, "--flow-file", absolutePath];
const nodeArgs = [
toolConfig.deployScriptPath,
"--flow-file",
absolutePath,
];

return new Promise((resolve) => {
const logs: string[] = [];
Expand Down