From 0672e201e24b25a3d81a91c58919be468ae932be Mon Sep 17 00:00:00 2001 From: Rhys Sullivan <39114868+RhysSullivan@users.noreply.github.com> Date: Sun, 28 Jun 2026 14:13:47 -0700 Subject: [PATCH 1/3] fix(cloud): back the MCP session Durable Object with SQLite The MCP session DO now extends the Cloudflare Agents `McpAgent` base, which stores its state in SQLite. apps/cloud still had the original `McpSessionDO` class on the key-value backend (`new_classes`), and Cloudflare cannot convert a live class to SQLite in place, so every session 500'd with "This Durable Object is not backed by SQLite storage". Session state is ephemeral, so delete the old KV class and create a new SQLite-backed class (`McpSessionDOSqlite`) in migration v2, repointing the `MCP_SESSION` binding. The DO is addressed by binding + idFromName, so the rename is transparent at runtime. host-cloudflare was already on `new_sqlite_classes`, so only cloud was affected. --- apps/cloud/src/server.ts | 6 +++++- apps/cloud/wrangler.jsonc | 14 +++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/apps/cloud/src/server.ts b/apps/cloud/src/server.ts index 7760fef7d..e05c60bf7 100644 --- a/apps/cloud/src/server.ts +++ b/apps/cloud/src/server.ts @@ -41,7 +41,11 @@ const sentryOptions = (env: Env) => ({ // not a global fetch wrapper. // --------------------------------------------------------------------------- -export const McpSessionDO = Sentry.instrumentDurableObjectWithSentry( +// Exported under `McpSessionDOSqlite` (not `McpSessionDO`) to match the SQLite +// class migration in wrangler.jsonc: the Agents (`McpAgent`) base needs a +// SQLite-backed DO, and the original KV-backed `McpSessionDO` class cannot be +// converted in place, so it is deleted and replaced by this new class. +export const McpSessionDOSqlite = Sentry.instrumentDurableObjectWithSentry( sentryOptions, McpSessionDOBase, ); diff --git a/apps/cloud/wrangler.jsonc b/apps/cloud/wrangler.jsonc index 0e92fbfa3..98b8fcadd 100644 --- a/apps/cloud/wrangler.jsonc +++ b/apps/cloud/wrangler.jsonc @@ -20,15 +20,27 @@ "bindings": [ { "name": "MCP_SESSION", - "class_name": "McpSessionDO", + "class_name": "McpSessionDOSqlite", }, ], }, + // The MCP session DO moved to the Cloudflare Agents (`McpAgent`) base, which + // stores its state in SQLite. The original `McpSessionDO` class was deployed + // with the key-value backend (`new_classes`), and Cloudflare cannot convert a + // live class to SQLite in place. Session state is ephemeral, so v2 deletes the + // old KV class and creates a new SQLite-backed class under a new name; the + // `MCP_SESSION` binding repoints to it. The DO is addressed by binding + + // `idFromName`, so the class rename is transparent at runtime. "migrations": [ { "tag": "v1", "new_classes": ["McpSessionDO"], }, + { + "tag": "v2", + "deleted_classes": ["McpSessionDO"], + "new_sqlite_classes": ["McpSessionDOSqlite"], + }, ], "services": [ { From b53191e48ab77b14b69d4ef22c55f6cc17c22e9f Mon Sep 17 00:00:00 2001 From: Rhys Sullivan <39114868+RhysSullivan@users.noreply.github.com> Date: Sun, 28 Jun 2026 14:21:23 -0700 Subject: [PATCH 2/3] chore: oxfmt the package.json files that were failing format:check on main --- packages/core/cli/package.json | 4 ++-- packages/core/config/package.json | 4 ++-- packages/core/execution/package.json | 4 ++-- packages/core/integrations-registry/package.json | 4 ++-- packages/core/sdk/package.json | 4 ++-- packages/core/vite-plugin/package.json | 4 ++-- packages/kernel/core/package.json | 4 ++-- packages/kernel/runtime-quickjs/package.json | 4 ++-- packages/plugins/desktop-settings/package.json | 4 ++-- packages/plugins/example/package.json | 4 ++-- packages/plugins/file-secrets/package.json | 4 ++-- packages/plugins/google/package.json | 4 ++-- packages/plugins/graphql/package.json | 4 ++-- packages/plugins/keychain/package.json | 4 ++-- packages/plugins/mcp/package.json | 4 ++-- packages/plugins/microsoft/package.json | 4 ++-- packages/plugins/onepassword/package.json | 4 ++-- packages/plugins/openapi/package.json | 4 ++-- packages/plugins/toolkits/package.json | 4 ++-- packages/plugins/workos-vault/package.json | 4 ++-- 20 files changed, 40 insertions(+), 40 deletions(-) diff --git a/packages/core/cli/package.json b/packages/core/cli/package.json index e9f58c766..e02474f3d 100644 --- a/packages/core/cli/package.json +++ b/packages/core/cli/package.json @@ -23,6 +23,7 @@ ".": "./src/index.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -30,8 +31,7 @@ "default": "./dist/index.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/core/config/package.json b/packages/core/config/package.json index a2ded694a..a01b40d83 100644 --- a/packages/core/config/package.json +++ b/packages/core/config/package.json @@ -19,6 +19,7 @@ ".": "./src/index.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -26,8 +27,7 @@ "default": "./dist/index.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/core/execution/package.json b/packages/core/execution/package.json index 4173b1c6d..88f3a0009 100644 --- a/packages/core/execution/package.json +++ b/packages/core/execution/package.json @@ -20,6 +20,7 @@ "./promise": "./src/promise.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -33,8 +34,7 @@ "default": "./dist/core.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/core/integrations-registry/package.json b/packages/core/integrations-registry/package.json index 44456c112..26511416d 100644 --- a/packages/core/integrations-registry/package.json +++ b/packages/core/integrations-registry/package.json @@ -20,6 +20,7 @@ ".": "./src/index.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -27,8 +28,7 @@ "default": "./dist/index.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/core/sdk/package.json b/packages/core/sdk/package.json index 1c8430712..b318481c1 100644 --- a/packages/core/sdk/package.json +++ b/packages/core/sdk/package.json @@ -28,6 +28,7 @@ "./public-origin": "./src/public-origin.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -83,8 +84,7 @@ "default": "./dist/public-origin.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/core/vite-plugin/package.json b/packages/core/vite-plugin/package.json index d8dfac836..22aae8890 100644 --- a/packages/core/vite-plugin/package.json +++ b/packages/core/vite-plugin/package.json @@ -23,6 +23,7 @@ } }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -30,8 +31,7 @@ "default": "./dist/index.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/kernel/core/package.json b/packages/kernel/core/package.json index 17cb18c9f..4ae6a5096 100644 --- a/packages/kernel/core/package.json +++ b/packages/kernel/core/package.json @@ -19,6 +19,7 @@ ".": "./src/index.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -26,8 +27,7 @@ "default": "./dist/index.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/kernel/runtime-quickjs/package.json b/packages/kernel/runtime-quickjs/package.json index 0d886c180..0896805fc 100644 --- a/packages/kernel/runtime-quickjs/package.json +++ b/packages/kernel/runtime-quickjs/package.json @@ -19,6 +19,7 @@ ".": "./src/index.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -26,8 +27,7 @@ "default": "./dist/index.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/plugins/desktop-settings/package.json b/packages/plugins/desktop-settings/package.json index cc766ff3e..b2b05839d 100644 --- a/packages/plugins/desktop-settings/package.json +++ b/packages/plugins/desktop-settings/package.json @@ -20,6 +20,7 @@ "./client": "./src/client.tsx" }, "publishConfig": { + "access": "public", "exports": { "./server": { "import": { @@ -33,8 +34,7 @@ "default": "./dist/client.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup", diff --git a/packages/plugins/example/package.json b/packages/plugins/example/package.json index 45ebbb303..488d2ccbf 100644 --- a/packages/plugins/example/package.json +++ b/packages/plugins/example/package.json @@ -21,6 +21,7 @@ "./shared": "./src/shared.ts" }, "publishConfig": { + "access": "public", "exports": { "./server": { "import": { @@ -40,8 +41,7 @@ "default": "./dist/shared.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/plugins/file-secrets/package.json b/packages/plugins/file-secrets/package.json index bcfbf732a..0e02900d0 100644 --- a/packages/plugins/file-secrets/package.json +++ b/packages/plugins/file-secrets/package.json @@ -20,6 +20,7 @@ "./promise": "./src/promise.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -33,8 +34,7 @@ "default": "./dist/core.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/plugins/google/package.json b/packages/plugins/google/package.json index ba5379814..dff35716f 100644 --- a/packages/plugins/google/package.json +++ b/packages/plugins/google/package.json @@ -23,6 +23,7 @@ "./client": "./src/react/plugin-client.tsx" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -42,8 +43,7 @@ "default": "./dist/client.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/plugins/graphql/package.json b/packages/plugins/graphql/package.json index d69119197..c6736d58e 100644 --- a/packages/plugins/graphql/package.json +++ b/packages/plugins/graphql/package.json @@ -25,6 +25,7 @@ "./testing": "./src/testing/index.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -50,8 +51,7 @@ "default": "./dist/testing.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/plugins/keychain/package.json b/packages/plugins/keychain/package.json index f4160085f..2ddb7b5ca 100644 --- a/packages/plugins/keychain/package.json +++ b/packages/plugins/keychain/package.json @@ -20,6 +20,7 @@ "./promise": "./src/promise.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -33,8 +34,7 @@ "default": "./dist/core.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/plugins/mcp/package.json b/packages/plugins/mcp/package.json index c6ee01021..2d51f5597 100644 --- a/packages/plugins/mcp/package.json +++ b/packages/plugins/mcp/package.json @@ -25,6 +25,7 @@ "./testing": "./src/testing/index.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -50,8 +51,7 @@ "default": "./dist/testing.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/plugins/microsoft/package.json b/packages/plugins/microsoft/package.json index 45f35d5db..d3d60aed8 100644 --- a/packages/plugins/microsoft/package.json +++ b/packages/plugins/microsoft/package.json @@ -23,6 +23,7 @@ "./client": "./src/react/plugin-client.tsx" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -42,8 +43,7 @@ "default": "./dist/client.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/plugins/onepassword/package.json b/packages/plugins/onepassword/package.json index c30fec111..7ba86b757 100644 --- a/packages/plugins/onepassword/package.json +++ b/packages/plugins/onepassword/package.json @@ -23,6 +23,7 @@ "./client": "./src/react/plugin-client.tsx" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -42,8 +43,7 @@ "default": "./dist/client.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/plugins/openapi/package.json b/packages/plugins/openapi/package.json index 2602e4837..12887f36e 100644 --- a/packages/plugins/openapi/package.json +++ b/packages/plugins/openapi/package.json @@ -25,6 +25,7 @@ "./testing": "./src/testing/index.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -50,8 +51,7 @@ "default": "./dist/testing.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/plugins/toolkits/package.json b/packages/plugins/toolkits/package.json index 2858a6d9d..880751288 100644 --- a/packages/plugins/toolkits/package.json +++ b/packages/plugins/toolkits/package.json @@ -21,6 +21,7 @@ "./shared": "./src/shared.ts" }, "publishConfig": { + "access": "public", "exports": { "./server": { "import": { @@ -40,8 +41,7 @@ "default": "./dist/shared.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", diff --git a/packages/plugins/workos-vault/package.json b/packages/plugins/workos-vault/package.json index 191bc70ed..1f1017918 100644 --- a/packages/plugins/workos-vault/package.json +++ b/packages/plugins/workos-vault/package.json @@ -23,6 +23,7 @@ "./testing": "./src/sdk/testing.ts" }, "publishConfig": { + "access": "public", "exports": { ".": { "import": { @@ -42,8 +43,7 @@ "default": "./dist/testing.js" } } - }, - "access": "public" + } }, "scripts": { "build": "tsup && (tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src || true)", From d998f495044fb7a54d924b35f9d02efa9f7831e1 Mon Sep 17 00:00:00 2001 From: Rhys Sullivan <39114868+RhysSullivan@users.noreply.github.com> Date: Sun, 28 Jun 2026 14:31:51 -0700 Subject: [PATCH 3/3] fix(cloud): recreate MCP session DO as SQLite via migration (revert class rename) Same-name delete+recreate (v2 delete, v3 new_sqlite) keeps the McpSessionDO binding and worker export unchanged, avoiding the rename that left the deleted KV class still exported. Reverts the server.ts/app.ts rename from the prior attempt; the only code-level change is the wrangler migration. --- apps/cloud/src/server.ts | 6 +----- apps/cloud/wrangler.jsonc | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/apps/cloud/src/server.ts b/apps/cloud/src/server.ts index e05c60bf7..7760fef7d 100644 --- a/apps/cloud/src/server.ts +++ b/apps/cloud/src/server.ts @@ -41,11 +41,7 @@ const sentryOptions = (env: Env) => ({ // not a global fetch wrapper. // --------------------------------------------------------------------------- -// Exported under `McpSessionDOSqlite` (not `McpSessionDO`) to match the SQLite -// class migration in wrangler.jsonc: the Agents (`McpAgent`) base needs a -// SQLite-backed DO, and the original KV-backed `McpSessionDO` class cannot be -// converted in place, so it is deleted and replaced by this new class. -export const McpSessionDOSqlite = Sentry.instrumentDurableObjectWithSentry( +export const McpSessionDO = Sentry.instrumentDurableObjectWithSentry( sentryOptions, McpSessionDOBase, ); diff --git a/apps/cloud/wrangler.jsonc b/apps/cloud/wrangler.jsonc index 98b8fcadd..19a81e71f 100644 --- a/apps/cloud/wrangler.jsonc +++ b/apps/cloud/wrangler.jsonc @@ -20,17 +20,16 @@ "bindings": [ { "name": "MCP_SESSION", - "class_name": "McpSessionDOSqlite", + "class_name": "McpSessionDO", }, ], }, // The MCP session DO moved to the Cloudflare Agents (`McpAgent`) base, which - // stores its state in SQLite. The original `McpSessionDO` class was deployed - // with the key-value backend (`new_classes`), and Cloudflare cannot convert a - // live class to SQLite in place. Session state is ephemeral, so v2 deletes the - // old KV class and creates a new SQLite-backed class under a new name; the - // `MCP_SESSION` binding repoints to it. The DO is addressed by binding + - // `idFromName`, so the class rename is transparent at runtime. + // stores state in SQLite. `McpSessionDO` was originally created with the + // key-value backend (`new_classes`), and Cloudflare cannot convert a live class + // to SQLite in place. Session state is ephemeral, so v2 deletes the KV class and + // v3 recreates the same name on the SQLite backend. Keeping the name avoids any + // binding/export rename. "migrations": [ { "tag": "v1", @@ -39,7 +38,10 @@ { "tag": "v2", "deleted_classes": ["McpSessionDO"], - "new_sqlite_classes": ["McpSessionDOSqlite"], + }, + { + "tag": "v3", + "new_sqlite_classes": ["McpSessionDO"], }, ], "services": [