diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe12dac..695ac7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,10 @@ jobs: - name: mcp-server client migration tests run: node --test test/*.test.mjs working-directory: mcp-server - - name: worker install + dry-run deploy + OAuth device-flow tests + - name: worker install + typecheck + dry-run deploy + OAuth device-flow tests run: | npm ci + npm run typecheck npx wrangler deploy --dry-run --outdir dist npm test working-directory: worker diff --git a/worker/package-lock.json b/worker/package-lock.json index 82f3def..6e00dc3 100644 --- a/worker/package-lock.json +++ b/worker/package-lock.json @@ -8,7 +8,7 @@ "name": "@github-webhook-mcp/worker", "version": "0.0.1", "dependencies": { - "@modelcontextprotocol/sdk": "^1.0.0", + "@modelcontextprotocol/sdk": "1.26.0", "agents": "^0.8.0", "zod": "^4.0.0" }, @@ -1998,9 +1998,9 @@ "license": "MIT" }, "node_modules/@modelcontextprotocol/sdk": { - "version": "1.27.1", - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.27.1.tgz", - "integrity": "sha512-sr6GbP+4edBwFndLbM60gf07z0FQ79gaExpnsjMGePXqFcSSb7t6iscpjk9DhFhwd+mTEQrzNafGP8/iGGFYaA==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.26.0.tgz", + "integrity": "sha512-Y5RmPncpiDtTXDbLKswIJzTqu2hyBKxTNsgKqKclDbhIgg1wgtf1fRuvxgTnRfcnxtvvgbIEcqUOzZrJ6iSReg==", "license": "MIT", "dependencies": { "@hono/node-server": "^1.19.9", @@ -2654,46 +2654,6 @@ } } }, - "node_modules/agents/node_modules/@modelcontextprotocol/sdk": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.26.0.tgz", - "integrity": "sha512-Y5RmPncpiDtTXDbLKswIJzTqu2hyBKxTNsgKqKclDbhIgg1wgtf1fRuvxgTnRfcnxtvvgbIEcqUOzZrJ6iSReg==", - "license": "MIT", - "dependencies": { - "@hono/node-server": "^1.19.9", - "ajv": "^8.17.1", - "ajv-formats": "^3.0.1", - "content-type": "^1.0.5", - "cors": "^2.8.5", - "cross-spawn": "^7.0.5", - "eventsource": "^3.0.2", - "eventsource-parser": "^3.0.0", - "express": "^5.2.1", - "express-rate-limit": "^8.2.1", - "hono": "^4.11.4", - "jose": "^6.1.3", - "json-schema-typed": "^8.0.2", - "pkce-challenge": "^5.0.0", - "raw-body": "^3.0.0", - "zod": "^3.25 || ^4.0", - "zod-to-json-schema": "^3.25.1" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@cfworker/json-schema": "^4.1.1", - "zod": "^3.25 || ^4.0" - }, - "peerDependenciesMeta": { - "@cfworker/json-schema": { - "optional": true - }, - "zod": { - "optional": false - } - } - }, "node_modules/ai": { "version": "6.0.138", "resolved": "https://registry.npmjs.org/ai/-/ai-6.0.138.tgz", diff --git a/worker/package.json b/worker/package.json index 87b5591..c02445e 100644 --- a/worker/package.json +++ b/worker/package.json @@ -6,10 +6,11 @@ "scripts": { "dev": "wrangler dev", "deploy": "wrangler deploy", + "typecheck": "tsc --noEmit", "test": "tsx --test test/*.test.ts && vitest run --config vitest.workers.config.ts" }, "dependencies": { - "@modelcontextprotocol/sdk": "^1.0.0", + "@modelcontextprotocol/sdk": "1.26.0", "agents": "^0.8.0", "zod": "^4.0.0" }, @@ -22,9 +23,10 @@ "wrangler": "^4.0.0" }, "comments": { - "overrides": "Pin @cloudflare/workers-types across the tree to the version the worker code is written against; the vitest-pool-workers toolchain otherwise pulls a newer one whose stricter binding types can break existing src types (types-only; runtime unaffected)." + "overrides": "Pin @cloudflare/workers-types across the tree to the version the worker code is written against; the vitest-pool-workers toolchain otherwise pulls a newer one whose stricter binding types can break existing src types (types-only; runtime unaffected). Pin @modelcontextprotocol/sdk to 1.26.0 so the tree holds a single copy: agents@0.8.2 nests its own 1.26.0, and a separate worker-direct copy made McpServer's private _serverInfo incompatible at the type level (types-only; 1.26/1.27 are runtime-compatible)." }, "overrides": { - "@cloudflare/workers-types": "$@cloudflare/workers-types" + "@cloudflare/workers-types": "$@cloudflare/workers-types", + "@modelcontextprotocol/sdk": "$@modelcontextprotocol/sdk" } } diff --git a/worker/src/agent.ts b/worker/src/agent.ts index 7b2f2cb..dfa0f26 100644 --- a/worker/src/agent.ts +++ b/worker/src/agent.ts @@ -21,12 +21,12 @@ interface Env { } /** Tenant context passed via props when creating per-tenant instances */ -export interface TenantProps { +export type TenantProps = { account_id?: number; account_login?: string; /** All account IDs (user + orgs) whose stores this session can read */ accessible_account_ids?: number[]; -} +}; export class WebhookMcpAgent extends McpAgent { server = new McpServer({