From 2cf0d3f8e1ea61cff56f64408c3b21328f7d1c2a Mon Sep 17 00:00:00 2001 From: Lucas Woodward <31957045+SketchingDev@users.noreply.github.com> Date: Thu, 29 May 2025 22:42:39 +0100 Subject: [PATCH 1/4] Fix typings and add start command to tests --- .github/workflows/test.yml | 15 +++++++++++++++ package.json | 2 +- src/tools/conversationSentiment.ts | 7 +++---- src/tools/searchQueues.ts | 3 +-- src/tools/voiceCallQuality.ts | 2 +- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac9c371..d43e47f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,21 @@ permissions: contents: read jobs: + test-starting-node: + runs-on: ubuntu-latest + name: Test + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + - run: npm install + - run: npm run build + - run: npm run start + env: + GENESYSCLOUD_REGION: dummy + GENESYSCLOUD_OAUTHCLIENT_ID: dummy + GENESYSCLOUD_OAUTHCLIENT_SECRET: dummy test-node: runs-on: ubuntu-latest name: Test diff --git a/package.json b/package.json index 75e114a..8ab49b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@makingchatbots/genesys-cloud-mcp-server", - "version": "0.0.5", + "version": "0.0.6", "description": "A MCP server for connecting LLMs to Genesys Cloud's Platform API", "exports": "./dist/index.js", "type": "module", diff --git a/src/tools/conversationSentiment.ts b/src/tools/conversationSentiment.ts index a722533..b330f8c 100644 --- a/src/tools/conversationSentiment.ts +++ b/src/tools/conversationSentiment.ts @@ -1,12 +1,11 @@ import { z } from "zod"; import { createTool, type ToolFactory } from "./utils/createTool.js"; import { isUnauthorisedError } from "./utils/genesys/isUnauthorisedError.js"; -import { +import type { + SpeechTextAnalyticsApi, Models, - type SpeechTextAnalyticsApi, } from "purecloud-platform-client-v2"; import { type CallToolResult } from "@modelcontextprotocol/sdk/types.js"; -import ConversationMetrics = Models.ConversationMetrics; export interface ToolDependencies { readonly speechTextAnalyticsApi: Pick< @@ -63,7 +62,7 @@ export const conversationSentiment: ToolFactory< paramsSchema, }, call: async ({ conversationIds }) => { - const conversations: ConversationMetrics[] = []; + const conversations: Models.ConversationMetrics[] = []; try { conversations.push( ...(await Promise.all( diff --git a/src/tools/searchQueues.ts b/src/tools/searchQueues.ts index c45260e..aa53a91 100644 --- a/src/tools/searchQueues.ts +++ b/src/tools/searchQueues.ts @@ -1,6 +1,5 @@ import { z } from "zod"; -import type { Models } from "purecloud-platform-client-v2"; -import { type RoutingApi } from "purecloud-platform-client-v2"; +import type { Models, RoutingApi } from "purecloud-platform-client-v2"; import { isUnauthorisedError } from "./utils/genesys/isUnauthorisedError.js"; import { createTool, type ToolFactory } from "./utils/createTool.js"; diff --git a/src/tools/voiceCallQuality.ts b/src/tools/voiceCallQuality.ts index 6eba62e..2433960 100644 --- a/src/tools/voiceCallQuality.ts +++ b/src/tools/voiceCallQuality.ts @@ -1,7 +1,7 @@ import { z } from "zod"; import { createTool, type ToolFactory } from "./utils/createTool.js"; import { isUnauthorisedError } from "./utils/genesys/isUnauthorisedError.js"; -import { Models, type AnalyticsApi } from "purecloud-platform-client-v2"; +import type { Models, AnalyticsApi } from "purecloud-platform-client-v2"; import { type CallToolResult } from "@modelcontextprotocol/sdk/types.js"; export interface ToolDependencies { From 9108d06635619eb1f0129179bc1f668fe6ecb4c8 Mon Sep 17 00:00:00 2001 From: Lucas Woodward <31957045+SketchingDev@users.noreply.github.com> Date: Thu, 29 May 2025 22:47:06 +0100 Subject: [PATCH 2/4] Rename test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d43e47f..67ee3c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ permissions: jobs: test-starting-node: runs-on: ubuntu-latest - name: Test + name: Test Starting Server steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 From c64659e00da06066ce45cad7b0ba8060f7b4ab94 Mon Sep 17 00:00:00 2001 From: Lucas Woodward <31957045+SketchingDev@users.noreply.github.com> Date: Thu, 29 May 2025 23:00:03 +0100 Subject: [PATCH 3/4] Wait for log statement --- .github/workflows/test.yml | 12 +++++++++++- src/index.ts | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 67ee3c1..055b2c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,17 @@ jobs: node-version-file: ".nvmrc" - run: npm install - run: npm run build - - run: npm run start + - run: | + npm run start 2>&1 | tee server.log & + SERVER_PID=$! + + echo "Waiting for server log output..." + timeout 10s bash -c ' + until grep -q "Started..." server.log; do sleep 0.5; done + ' + + echo "Killing server..." + kill $SERVER_PID env: GENESYSCLOUD_REGION: dummy GENESYSCLOUD_OAUTHCLIENT_ID: dummy diff --git a/src/index.ts b/src/index.ts index dda7471..58ea0bb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -92,3 +92,4 @@ server.tool( const transport = new StdioServerTransport(); await server.connect(transport); +console.log("Started..."); From afe493935b539a8ccd29eb19d22292dbe264f3b5 Mon Sep 17 00:00:00 2001 From: Lucas Woodward <31957045+SketchingDev@users.noreply.github.com> Date: Thu, 29 May 2025 23:01:27 +0100 Subject: [PATCH 4/4] Revert --- .github/workflows/test.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 055b2c2..67ee3c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,17 +22,7 @@ jobs: node-version-file: ".nvmrc" - run: npm install - run: npm run build - - run: | - npm run start 2>&1 | tee server.log & - SERVER_PID=$! - - echo "Waiting for server log output..." - timeout 10s bash -c ' - until grep -q "Started..." server.log; do sleep 0.5; done - ' - - echo "Killing server..." - kill $SERVER_PID + - run: npm run start env: GENESYSCLOUD_REGION: dummy GENESYSCLOUD_OAUTHCLIENT_ID: dummy