Skip to content

Commit 758e2c1

Browse files
kathiekiwiTrigger.dev RepoOps
authored andcommitted
fix(webapp): keep a blocked MCP client blocked when it connects again
Mono-RevId: 6de60f69cf5d9bd6eb506635e3673e1decf0377d
1 parent 5fa1390 commit 758e2c1

11 files changed

Lines changed: 562 additions & 77 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
A blocked MCP client stays blocked when it connects again from another local port, and a client that connects under a different name or address counts as a new one. A blocked client is no longer removed by the unused-client cleanup.

‎apps/webapp/app/mcp/policy/accessPage.server.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export const accessLoader = ({
145145
block: block ? { id: block.id, scope: block.scope } : null,
146146
})),
147147
nextCursor: connectionPage.nextCursor
148-
? `${connectionPage.nextCursor.userId}:${connectionPage.nextCursor.oauthClientId}`
148+
? `${connectionPage.nextCursor.userId}:${connectionPage.nextCursor.familyKey}`
149149
: undefined,
150150
},
151151
areas,
@@ -284,8 +284,11 @@ export const accessAction = ({
284284
);
285285

286286
function parseConnectionCursor(value: string | null): McpConnectionCursor | null {
287-
const [userId, oauthClientId, ...rest] = value?.split(":") ?? [];
288-
return userId && oauthClientId && rest.length === 0 ? { userId, oauthClientId } : null;
287+
// A metadata-URL family key contains colons; a user id never does.
288+
const at = value?.indexOf(":") ?? -1;
289+
const userId = value?.slice(0, at);
290+
const familyKey = value?.slice(at + 1);
291+
return at > 0 && userId && familyKey ? { userId, familyKey } : null;
289292
}
290293

291294
function switchableTools() {

‎apps/webapp/app/mcp/policy/mcpAccess.server.ts‎

Lines changed: 121 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ type AccessRow = {
2020
connectionBlocked: boolean;
2121
};
2222

23+
// Blocks of this organization and scope on any registration in the family of the client `c` picked
24+
// by `client`. A null family key stands for the row's own id.
25+
const familyBlocks = (
26+
organizationId: string | Prisma.Sql,
27+
scope: "ORGANIZATION_CLIENT" | "CONNECTION",
28+
scopeKey: string,
29+
client: Prisma.Sql
30+
) => Prisma.sql`
31+
SELECT b."id" FROM ${sqlDatabaseSchema}."McpClientBlock" b
32+
JOIN ${sqlDatabaseSchema}."OAuthClient" bc ON bc."id" = b."oauthClientId"
33+
JOIN ${sqlDatabaseSchema}."OAuthClient" c ON COALESCE(c."familyKey", c."id") = COALESCE(bc."familyKey", bc."id")
34+
WHERE ${client} AND b."organizationId" = ${organizationId}
35+
AND b."scope"::text = ${scope} AND b."scopeKey" = ${scopeKey}`;
36+
2337
// One primary read per call. The client comes from the source PAT, never from the token's claims;
2438
// a `pat` identity has no OAuth client, so no block applies to it.
2539
function accessRows(
@@ -28,29 +42,23 @@ function accessRows(
2842
db: PrismaClientOrTransaction
2943
): Promise<AccessRow[]> {
3044
const sourceTokenId = identity.kind === "uat" ? identity.sourceTokenId : null;
45+
const org = Prisma.sql`o."id"`;
46+
const tokenClient = Prisma.sql`c."id" = tok."oauthClientId"`;
3147
return db.$queryRaw<AccessRow[]>`
3248
SELECT o."id" AS "organizationId", o."slug", o."featureFlags",
3349
(SELECT f."value" FROM ${sqlDatabaseSchema}."FeatureFlag" f
3450
WHERE f."key" = ${FEATURE_FLAG.hasRemoteMcp}) AS "remoteMcpGlobal",
3551
COALESCE(p."allowMcp", true) AS "allowMcp",
3652
COALESCE(p."allowConnections", true) AS "allowConnections",
3753
COALESCE(p."allowPersonalTokens", true) AS "allowPersonalTokens",
38-
EXISTS (
39-
SELECT 1 FROM ${sqlDatabaseSchema}."McpClientBlock" b
40-
WHERE b."organizationId" = o."id" AND b."oauthClientId" = c."oauthClientId"
41-
AND b."scope" = 'ORGANIZATION_CLIENT' AND b."scopeKey" = '*'
42-
) AS "clientBlocked",
43-
EXISTS (
44-
SELECT 1 FROM ${sqlDatabaseSchema}."McpClientBlock" b
45-
WHERE b."organizationId" = o."id" AND b."oauthClientId" = c."oauthClientId"
46-
AND b."scope" = 'CONNECTION' AND b."scopeKey" = ${identity.userId}
47-
) AS "connectionBlocked"
54+
EXISTS (${familyBlocks(org, "ORGANIZATION_CLIENT", "*", tokenClient)}) AS "clientBlocked",
55+
EXISTS (${familyBlocks(org, "CONNECTION", identity.userId, tokenClient)}) AS "connectionBlocked"
4856
FROM ${sqlDatabaseSchema}."Organization" o
4957
LEFT JOIN ${sqlDatabaseSchema}."McpOrganizationPolicy" p ON p."organizationId" = o."id"
5058
LEFT JOIN LATERAL (
5159
SELECT t."oauthClientId" FROM ${sqlDatabaseSchema}."PersonalAccessToken" t
5260
WHERE t."id" = ${sourceTokenId}::text AND t."userId" = ${identity.userId}
53-
) c ON true
61+
) tok ON true
5462
WHERE o."id" = ANY(${organizationIds}::text[])`;
5563
}
5664

@@ -174,6 +182,12 @@ export async function blockMcpClient(
174182
const userId = i.scope === "CONNECTION" ? i.userId : null;
175183
const scopeKey = userId ?? "*";
176184
const forUser = userId ? Prisma.sql`AND t."userId" = ${userId}` : Prisma.empty;
185+
const blocked = familyBlocks(
186+
i.organizationId,
187+
i.scope,
188+
scopeKey,
189+
Prisma.sql`c."id" = ${i.oauthClientId}`
190+
);
177191
const inserted = await db.$executeRaw`
178192
INSERT INTO ${sqlDatabaseSchema}."McpClientBlock"
179193
("id", "organizationId", "scope", "userId", "oauthClientId", "scopeKey", "blockedById")
@@ -183,14 +197,15 @@ export async function blockMcpClient(
183197
SELECT 1 FROM ${sqlDatabaseSchema}."PersonalAccessToken" t
184198
JOIN ${sqlDatabaseSchema}."OrgMember" m ON m."userId" = t."userId" AND m."organizationId" = ${i.organizationId}
185199
WHERE t."oauthClientId" = ${i.oauthClientId} ${forUser}
186-
)
200+
) AND NOT EXISTS (${blocked})
187201
ON CONFLICT ("organizationId", "oauthClientId", "scopeKey") DO NOTHING`;
188202
if (inserted === 1) return { ok: true };
189-
const existing = await db.mcpClientBlock.findFirst({
190-
where: { organizationId: i.organizationId, oauthClientId: i.oauthClientId, scopeKey },
191-
select: { id: true },
192-
});
193-
return existing ? CONFLICT : { ok: false, reason: "not_connected" };
203+
return (await anyRow(blocked, db)) ? CONFLICT : { ok: false, reason: "not_connected" };
204+
}
205+
206+
async function anyRow(query: Prisma.Sql, db: PrismaClientOrTransaction): Promise<boolean> {
207+
const [row] = await db.$queryRaw<{ found: boolean }[]>`SELECT EXISTS (${query}) AS "found"`;
208+
return row?.found === true;
194209
}
195210

196211
// The column has no limit; metadata-URL client ids are URLs, so allow a long one.
@@ -214,19 +229,21 @@ export async function blockMcpClientByClientId(
214229
if (!clientId || clientId.length > PUBLIC_CLIENT_ID_MAX) {
215230
return { ok: false, reason: "unknown_client" };
216231
}
232+
const blocked = familyBlocks(
233+
i.organizationId,
234+
"ORGANIZATION_CLIENT",
235+
"*",
236+
Prisma.sql`c."clientId" = ${clientId}`
237+
);
217238
const inserted = await db.$executeRaw`
218239
INSERT INTO ${sqlDatabaseSchema}."McpClientBlock"
219240
("id", "organizationId", "scope", "userId", "oauthClientId", "scopeKey", "blockedById")
220-
SELECT ${cuid()}, ${i.organizationId}, 'ORGANIZATION_CLIENT', NULL, c."id", '*', ${i.blockedById}
221-
FROM ${sqlDatabaseSchema}."OAuthClient" c
222-
WHERE c."clientId" = ${clientId}
241+
SELECT ${cuid()}, ${i.organizationId}, 'ORGANIZATION_CLIENT', NULL, n."id", '*', ${i.blockedById}
242+
FROM ${sqlDatabaseSchema}."OAuthClient" n
243+
WHERE n."clientId" = ${clientId} AND NOT EXISTS (${blocked})
223244
ON CONFLICT ("organizationId", "oauthClientId", "scopeKey") DO NOTHING`;
224245
if (inserted === 1) return { ok: true };
225-
const existing = await db.mcpClientBlock.findFirst({
226-
where: { organizationId: i.organizationId, scopeKey: "*", oauthClient: { clientId } },
227-
select: { id: true },
228-
});
229-
return existing ? CONFLICT : { ok: false, reason: "unknown_client" };
246+
return (await anyRow(blocked, db)) ? CONFLICT : { ok: false, reason: "unknown_client" };
230247
}
231248

232249
const blockFacts = {
@@ -248,11 +265,21 @@ export async function unblockMcpClient(
248265
}
249266
| Conflict
250267
> {
251-
const where = { id: i.blockId, organizationId: i.organizationId };
252-
const block = await db.mcpClientBlock.findFirst({ where, select: blockFacts });
253-
if (!block) return CONFLICT;
254-
const deleted = await db.mcpClientBlock.deleteMany({ where });
255-
return deleted.count === 1 ? { ok: true, block } : CONFLICT;
268+
const found = await db.mcpClientBlock.findFirst({
269+
where: { id: i.blockId, organizationId: i.organizationId },
270+
select: { ...blockFacts, scopeKey: true },
271+
});
272+
if (!found) return CONFLICT;
273+
const { scopeKey, ...block } = found;
274+
const family = familyBlocks(
275+
i.organizationId,
276+
block.scope,
277+
scopeKey,
278+
Prisma.sql`c."id" = ${block.oauthClientId}`
279+
);
280+
const deleted = await db.$executeRaw`
281+
DELETE FROM ${sqlDatabaseSchema}."McpClientBlock" WHERE "id" IN (${family})`;
282+
return deleted > 0 ? { ok: true, block } : CONFLICT;
256283
}
257284

258285
// A live OAuth grant of a current member: not revoked, past neither its fixed nor its idle expiry
@@ -282,30 +309,39 @@ export function listMcpClients(
282309
): Promise<McpClientListItem[]> {
283310
return db.$queryRaw<McpClientListItem[]>`
284311
WITH live AS (${liveGrants(organizationId)}),
285-
blocked AS (
286-
SELECT "id", "oauthClientId" FROM ${sqlDatabaseSchema}."McpClientBlock"
312+
blocks AS (
313+
SELECT "id", "oauthClientId", "createdAt" FROM ${sqlDatabaseSchema}."McpClientBlock"
287314
WHERE "organizationId" = ${organizationId} AND "scope" = 'ORGANIZATION_CLIENT'
288315
),
316+
clients AS (
317+
SELECT c."id", c."displayName", c."selfReportedName", c."kind", c."createdAt",
318+
COALESCE(c."familyKey", c."id") AS "family"
319+
FROM ${sqlDatabaseSchema}."OAuthClient" c
320+
WHERE c."id" IN (SELECT "oauthClientId" FROM live UNION SELECT "oauthClientId" FROM blocks)
321+
),
322+
families AS (
323+
SELECT DISTINCT ON ("family") * FROM clients ORDER BY "family", "createdAt" DESC, "id"
324+
),
289325
counts AS (
290-
SELECT "oauthClientId", count(DISTINCT "userId")::int AS "memberCount"
291-
FROM live GROUP BY "oauthClientId"
326+
SELECT k."family", count(DISTINCT l."userId")::int AS "memberCount"
327+
FROM live l JOIN clients k ON k."id" = l."oauthClientId"
328+
GROUP BY k."family"
292329
),
293-
ids AS (
294-
SELECT "oauthClientId" FROM counts
295-
UNION
296-
SELECT "oauthClientId" FROM blocked
330+
blocked AS (
331+
SELECT DISTINCT ON (k."family") k."family", b."id"
332+
FROM blocks b JOIN clients k ON k."id" = b."oauthClientId"
333+
ORDER BY k."family", b."createdAt", b."id"
297334
)
298-
SELECT c."id", c."displayName", c."selfReportedName", c."kind"::text AS "kind",
335+
SELECT f."id", f."displayName", f."selfReportedName", f."kind"::text AS "kind",
299336
COALESCE(n."memberCount", 0) AS "memberCount",
300337
b."id" AS "blockId"
301-
FROM ids
302-
JOIN ${sqlDatabaseSchema}."OAuthClient" c ON c."id" = ids."oauthClientId"
303-
LEFT JOIN counts n ON n."oauthClientId" = c."id"
304-
LEFT JOIN blocked b ON b."oauthClientId" = c."id"
305-
ORDER BY c."displayName" NULLS LAST, c."id"`;
338+
FROM families f
339+
LEFT JOIN counts n ON n."family" = f."family"
340+
LEFT JOIN blocked b ON b."family" = f."family"
341+
ORDER BY f."displayName" NULLS LAST, f."id"`;
306342
}
307343

308-
export type McpConnectionCursor = { userId: string; oauthClientId: string };
344+
export type McpConnectionCursor = { userId: string; familyKey: string };
309345

310346
export type McpConnectionListItem = {
311347
userId: string;
@@ -333,10 +369,11 @@ export async function listMcpConnections(
333369
pageSize = 50
334370
): Promise<{ connections: McpConnectionListItem[]; nextCursor: McpConnectionCursor | null }> {
335371
const after = cursor
336-
? Prisma.sql`WHERE (p."userId", p."oauthClientId") > (${cursor.userId}, ${cursor.oauthClientId})`
372+
? Prisma.sql`WHERE (p."userId", p."family") > (${cursor.userId}, ${cursor.familyKey})`
337373
: Prisma.empty;
338374
const rows = await db.$queryRaw<
339375
(Omit<McpConnectionListItem, "block"> & {
376+
family: string;
340377
blockId: string | null;
341378
blockScope: "CONNECTION" | "ORGANIZATION_CLIENT" | null;
342379
blockedById: string | null;
@@ -345,27 +382,36 @@ export async function listMcpConnections(
345382
})[]
346383
>`
347384
WITH live AS (
348-
SELECT g."userId", g."oauthClientId", min(g."createdAt") AS "firstConnectedAt"
385+
SELECT g."userId", COALESCE(gc."familyKey", gc."id") AS "family",
386+
min(g."createdAt") AS "firstConnectedAt",
387+
(array_agg(g."oauthClientId" ORDER BY g."createdAt" DESC, g."oauthClientId"))[1] AS "oauthClientId"
349388
FROM (${liveGrants(organizationId)}) g
350-
GROUP BY g."userId", g."oauthClientId"
389+
JOIN ${sqlDatabaseSchema}."OAuthClient" gc ON gc."id" = g."oauthClientId"
390+
GROUP BY g."userId", COALESCE(gc."familyKey", gc."id")
391+
),
392+
blocks AS (
393+
SELECT b.*, COALESCE(bc."familyKey", bc."id") AS "family"
394+
FROM ${sqlDatabaseSchema}."McpClientBlock" b
395+
JOIN ${sqlDatabaseSchema}."OAuthClient" bc ON bc."id" = b."oauthClientId"
396+
WHERE b."organizationId" = ${organizationId}
351397
),
352398
connection_blocks AS (
353-
SELECT b.* FROM ${sqlDatabaseSchema}."McpClientBlock" b
354-
WHERE b."organizationId" = ${organizationId} AND b."scope" = 'CONNECTION'
399+
SELECT DISTINCT ON ("userId", "family") * FROM blocks WHERE "scope" = 'CONNECTION'
400+
ORDER BY "userId", "family", "createdAt", "id"
355401
),
356402
client_blocks AS (
357-
SELECT b.* FROM ${sqlDatabaseSchema}."McpClientBlock" b
358-
WHERE b."organizationId" = ${organizationId} AND b."scope" = 'ORGANIZATION_CLIENT'
403+
SELECT DISTINCT ON ("family") * FROM blocks WHERE "scope" = 'ORGANIZATION_CLIENT'
404+
ORDER BY "family", "createdAt", "id"
359405
),
360406
pairs AS (
361-
SELECT "userId", "oauthClientId" FROM live
407+
SELECT "userId", "family" FROM live
362408
UNION
363-
SELECT "userId", "oauthClientId" FROM connection_blocks
409+
SELECT "userId", "family" FROM connection_blocks
364410
)
365-
SELECT p."userId", (m."id" IS NOT NULL) AS "isMember",
411+
SELECT p."userId", p."family", (m."id" IS NOT NULL) AS "isMember",
366412
CASE WHEN m."id" IS NOT NULL THEN COALESCE(u."displayName", u."name") END AS "userName",
367413
CASE WHEN m."id" IS NOT NULL THEN u."email" END AS "userEmail",
368-
p."oauthClientId", c."displayName" AS "clientDisplayName",
414+
c."id" AS "oauthClientId", c."displayName" AS "clientDisplayName",
369415
c."selfReportedName" AS "clientSelfReportedName", l."firstConnectedAt",
370416
COALESCE(cb."id", ob."id") AS "blockId",
371417
COALESCE(cb."scope", ob."scope")::text AS "blockScope",
@@ -375,20 +421,28 @@ export async function listMcpConnections(
375421
FROM pairs p
376422
JOIN ${sqlDatabaseSchema}."User" u ON u."id" = p."userId"
377423
LEFT JOIN ${sqlDatabaseSchema}."OrgMember" m ON m."userId" = p."userId" AND m."organizationId" = ${organizationId}
378-
JOIN ${sqlDatabaseSchema}."OAuthClient" c ON c."id" = p."oauthClientId"
379-
LEFT JOIN live l ON l."userId" = p."userId" AND l."oauthClientId" = p."oauthClientId"
380-
LEFT JOIN connection_blocks cb ON cb."userId" = p."userId" AND cb."oauthClientId" = p."oauthClientId"
381-
LEFT JOIN client_blocks ob ON ob."oauthClientId" = p."oauthClientId"
424+
LEFT JOIN live l ON l."userId" = p."userId" AND l."family" = p."family"
425+
LEFT JOIN connection_blocks cb ON cb."userId" = p."userId" AND cb."family" = p."family"
426+
LEFT JOIN client_blocks ob ON ob."family" = p."family"
427+
JOIN ${sqlDatabaseSchema}."OAuthClient" c ON c."id" = COALESCE(l."oauthClientId", cb."oauthClientId")
382428
LEFT JOIN ${sqlDatabaseSchema}."User" bu ON bu."id" = COALESCE(cb."blockedById", ob."blockedById")
383429
${after}
384-
ORDER BY p."userId", p."oauthClientId"
430+
ORDER BY p."userId", p."family"
385431
LIMIT ${pageSize + 1}`;
386432

387433
const page = rows.slice(0, pageSize);
388434
const last = page.at(-1);
389435
return {
390436
connections: page.map(
391-
({ blockId, blockScope, blockedById, blockedByName, blockedAt, ...connection }) => ({
437+
({
438+
family: _family,
439+
blockId,
440+
blockScope,
441+
blockedById,
442+
blockedByName,
443+
blockedAt,
444+
...connection
445+
}) => ({
392446
...connection,
393447
block:
394448
blockId && blockScope && blockedAt
@@ -397,9 +451,7 @@ export async function listMcpConnections(
397451
})
398452
),
399453
nextCursor:
400-
rows.length > pageSize && last
401-
? { userId: last.userId, oauthClientId: last.oauthClientId }
402-
: null,
454+
rows.length > pageSize && last ? { userId: last.userId, familyKey: last.family } : null,
403455
};
404456
}
405457

@@ -414,11 +466,13 @@ export async function mcpBlockingOrganizations(
414466
): Promise<Map<string, string[]>> {
415467
if (oauthClientIds.length === 0) return new Map();
416468
const rows = await db.$queryRaw<{ oauthClientId: string; title: string }[]>`
417-
SELECT DISTINCT b."oauthClientId", o."title"
469+
SELECT DISTINCT c."id" AS "oauthClientId", o."title"
418470
FROM ${sqlDatabaseSchema}."McpClientBlock" b
419471
JOIN ${sqlDatabaseSchema}."Organization" o ON o."id" = b."organizationId" AND o."deletedAt" IS NULL
420472
JOIN ${sqlDatabaseSchema}."OrgMember" m ON m."organizationId" = o."id" AND m."userId" = ${userId}
421-
WHERE b."oauthClientId" = ANY(${oauthClientIds}::text[])
473+
JOIN ${sqlDatabaseSchema}."OAuthClient" bc ON bc."id" = b."oauthClientId"
474+
JOIN ${sqlDatabaseSchema}."OAuthClient" c ON COALESCE(c."familyKey", c."id") = COALESCE(bc."familyKey", bc."id")
475+
WHERE c."id" = ANY(${oauthClientIds}::text[])
422476
AND (
423477
(b."scope" = 'ORGANIZATION_CLIENT' AND b."scopeKey" = '*')
424478
OR (b."scope" = 'CONNECTION' AND b."scopeKey" = ${userId})

‎apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.access/McpAccessSection.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function McpAccessSection({
5151
<div>
5252
<Subsection
5353
title="Member connections"
54-
description="AI tools your members have connected. Blocking a tool stops its calls in this organization until you unblock it. Connecting the same tool again does not lift the block."
54+
description="AI tools your members have connected. Blocking a tool stops its calls in this organization until you unblock it. Connecting the same tool again does not lift the block. A tool that connects under a different name or address counts as a new tool."
5555
action={<ForwardPagination nextCursor={nextCursor} cursorParam={cursorParam} />}
5656
/>
5757
<Table showTopBorder={false}>

‎apps/webapp/app/services/oauth/clientSweep.server.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { PrismaClientOrTransaction } from "@trigger.dev/database";
22
import { tryCatch } from "@trigger.dev/core";
3+
import { fillClientFamilyKeys } from "./clients.server";
34

45
const SWEEP_BATCH_SIZE = 1_000;
56
const MAX_BATCHES_PER_RUN = 20;
@@ -12,6 +13,9 @@ export async function sweepOAuthClients(
1213
now: Date = new Date(),
1314
{ batchSize = SWEEP_BATCH_SIZE, maxBatches = MAX_BATCHES_PER_RUN } = {}
1415
): Promise<{ deleted: number; failedChunks: number }> {
16+
for (let batch = 0; batch < maxBatches; batch++) {
17+
if ((await fillClientFamilyKeys(prisma, { batch: batchSize })) < batchSize) break;
18+
}
1519
let deleted = 0;
1620
let failedChunks = 0;
1721
let afterId = "";
@@ -40,6 +44,7 @@ async function sweepBatch(
4044
AND NOT EXISTS (SELECT 1 FROM "PersonalAccessToken" p WHERE p."oauthClientId" = c.id)
4145
AND NOT EXISTS (SELECT 1 FROM "OAuthRefreshToken" r WHERE r."oauthClientId" = c.id)
4246
AND NOT EXISTS (SELECT 1 FROM "AuthorizationCode" a WHERE a."oauthClientId" = c.id)
47+
AND NOT EXISTS (SELECT 1 FROM "McpClientBlock" b WHERE b."oauthClientId" = c.id)
4348
ORDER BY c.id
4449
LIMIT ${batchSize}
4550
`;
@@ -55,7 +60,8 @@ async function sweepBatch(
5560
AND COALESCE(c."metadataExpiresAt", c."updatedAt" + ${DCR_TTL_MS}::bigint * interval '1 millisecond') < ${now}
5661
AND NOT EXISTS (SELECT 1 FROM "PersonalAccessToken" p WHERE p."oauthClientId" = c.id)
5762
AND NOT EXISTS (SELECT 1 FROM "OAuthRefreshToken" r WHERE r."oauthClientId" = c.id)
58-
AND NOT EXISTS (SELECT 1 FROM "AuthorizationCode" a WHERE a."oauthClientId" = c.id)`
63+
AND NOT EXISTS (SELECT 1 FROM "AuthorizationCode" a WHERE a."oauthClientId" = c.id)
64+
AND NOT EXISTS (SELECT 1 FROM "McpClientBlock" b WHERE b."oauthClientId" = c.id)`
5965
);
6066
if (error) failedChunks++;
6167
else deleted += count;

0 commit comments

Comments
 (0)