GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(server): render MCP apps in Claude threads by CouchRiv · Pull Request #28739 · pingdotgg/t3code

feat(server): render MCP apps in Claude threads #28739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CouchRiv wants to merge 9 commits into pingdotgg:main from CouchRiv:feat/mcp-apps-claude
+1,445 −44
Closed

feat(server): render MCP apps in Claude threads #28739

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit Hold shift + click to select a range
373694f
feat(server): render MCP apps in Claude threads
CouchRiv Nov 1, 2026
daee7cc
fix(server): look up unknown MCP app tools off Claude's message reader
CouchRiv Nov 1, 2026
a19b8fa
fix(server): Claude MCP app catalogs expire without pausing every lookup
CouchRiv Nov 3, 2026
67f725b
fix(server): MCP apps report stopped Claude sessions as session-stopped
CouchRiv Nov 3, 2026
f4bdee9
chore: merge main into Claude MCP apps branch
maria-rcks Nov 4, 2026
7be6765
fix(server): bound live Claude MCP app reads
maria-rcks Nov 4, 2026
02cd332
chore: merge main into Claude MCP apps branch
CouchRiv Nov 4, 2026
bfa746e
fix(server): Claude MCP apps run read-only tools without asking
CouchRiv Nov 4, 2026
f51ecca
Merge remote-tracking branch 'github/main' into feat/mcp-apps-claude
maria-rcks Nov 4, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
fix(server): look up unknown MCP app tools off Claude's message reader
An MCP tool missing from the cached catalog made the tool-result handler
re-read Claude Code's MCP status while holding the SDK message lock, so a
slow server could stall streamed text and other tools for up to the lookup
timeout. Codex captures off its event reader for the same reason.

The reader now only checks the cached catalog. A tool it does not know is
looked up by the capture fiber, which already keeps the row running until it
lands and falls back to the plain row.
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@CouchRiv
CouchRiv committed Nov 3, 2026
commit daee7ccdfbaae3e5da38aa8d0760a3cc2cb49b86

Some comments aren't visible on the classic Files Changed page.

There are no files selected for viewing

37 changes: 37 additions & 0 deletions 37 apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -5162,6 +5162,43 @@ describe("ClaudeAdapterV2 background wake turns", () => {
),
);

it.effect("keeps reading Claude's messages while the MCP app catalog loads", () =>
Effect.gen(function* () {
const releaseStatus = yield* Deferred.make<void>();
const apps = weatherMcpApps();
const harness = yield* makeWakeHarnessWithOptions({
mcpApps: {
...apps,
serverStatus: Deferred.await(releaseStatus).pipe(Effect.andThen(apps.serverStatus)),
},
});
yield* callWeatherTool(harness, "mcp-app-slow-catalog");
yield* Queue.offer(
harness.sdkMessages,
makeResultFrame({ uuid: "mcp-app-slow-catalog-terminal", result: "Here it is." }),
);
assert.equal((yield* Queue.take(harness.terminalReceipts)).status, "completed");
assert.lengthOf(settledWeatherRows(harness.events), 0);

yield* Deferred.succeed(releaseStatus, undefined);
yield* harness.until(() => settledWeatherRows(harness.events).length > 0);
const rows = settledWeatherRows(harness.events);
assert.lengthOf(rows, 1);
assert.equal(rows[0]!.toolName, "weather.get_weather");
assert.isDefined(mcpAppFromToolItem(rows[0]!));
}).pipe(
Effect.scoped,
Effect.provide(
Layer.mergeAll(
IdAllocator.layer,
McpProviderSessions.layer,
NodeServices.layer,
NodeCrypto.layer,
),
),
),
);

it.effect.each(["the turn is interrupted", "Claude exits after the turn"] as const)(
"shows the plain row of an MCP app that is still loading when %s",
(ending) =>
Expand Down
92 changes: 55 additions & 37 deletions 92 apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -7398,20 +7398,26 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
) {
return undefined;
}
// Bounded: a load waits at most the lookup timeout.
const read =
mcpAppCatalogs.get(queryMcpApps)?.targets?.has(toolCall.toolName) === true
? false
: yield* loadMcpAppCatalog(queryMcpApps, {
refresh: mcpAppCatalogs.get(queryMcpApps)?.targets !== undefined,
});
const known = mcpAppCatalogs.get(queryMcpApps)?.targets?.get(toolCall.toolName);
// An unknown tool is looked up by the capture, off the message reader.
return known === null ? undefined : { queryMcpApps, known };
});

/** Bounded: a load waits at most the lookup timeout. */
const lookupMcpApp = Effect.fn("ClaudeAdapterV2.lookupMcpApp")(function* (
queryMcpApps: ClaudeAgentSdkQueryMcpApps,
toolName: string,
) {
const read = yield* loadMcpAppCatalog(queryMcpApps, {
refresh: mcpAppCatalogs.get(queryMcpApps)?.targets !== undefined,
});
const catalog = mcpAppCatalogs.get(queryMcpApps);
const target = catalog?.targets?.get(toolCall.toolName);
const target = catalog?.targets?.get(toolName);
if (read && target === undefined && catalog?.targets !== undefined) {
// Still unknown after a fresh read: do not read again for every call of it.
catalog.retryAt = (yield* Clock.currentTimeMillis) + CLAUDE_MCP_APP_LOOKUP_RETRY_MS;
}
return target == null ? undefined : { queryMcpApps, ...target };
return target ?? undefined;
});

const captureMcpApp = Effect.fn("ClaudeAdapterV2.captureMcpApp")(function* (input: {
Expand All @@ -7430,32 +7436,42 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
// Only the read and the write are cancellable; once stored, the app is attached or deleted.
Effect.uninterruptibleMask((restore) =>
Effect.gen(function* () {
const reference = yield* restore(
app.queryMcpApps.readResource(app.server, app.resourceUri).pipe(
Effect.timeout(CLAUDE_MCP_APP_CAPTURE_TIMEOUT),
Effect.flatMap((response) =>
snapshotMcpApp({
attachmentsDir,
threadId: toolCall.threadId,
server: app.server,
tool: app.tool,
resourceUri: app.resourceUri,
contents: response.contents,
}),
),
Effect.provideService(FileSystem.FileSystem, fileSystem),
// MCP connection errors can echo server headers, so log names only.
Effect.catchCauseIf(
(cause) => !Cause.hasInterruptsOnly(cause),
() =>
Effect.logWarning(
"Failed to capture an MCP app; showing a plain tool row.",
{ server: app.server, tool: app.tool, resourceUri: app.resourceUri },
).pipe(Effect.as(undefined)),
),
Effect.orDie,
),
);
const target =
app.known ??
(yield* restore(lookupMcpApp(app.queryMcpApps, toolCall.toolName)));
const reference =
target === undefined
? undefined
: yield* restore(
app.queryMcpApps.readResource(target.server, target.resourceUri).pipe(
Effect.timeout(CLAUDE_MCP_APP_CAPTURE_TIMEOUT),
Effect.flatMap((response) =>
snapshotMcpApp({
attachmentsDir,
threadId: toolCall.threadId,
server: target.server,
tool: target.tool,
resourceUri: target.resourceUri,
contents: response.contents,
}),
),
Effect.provideService(FileSystem.FileSystem, fileSystem),
// MCP connection errors can echo server headers, so log names only.
Effect.catchCauseIf(
(cause) => !Cause.hasInterruptsOnly(cause),
() =>
Effect.logWarning(
"Failed to capture an MCP app; showing a plain tool row.",
{
server: target.server,
tool: target.tool,
resourceUri: target.resourceUri,
},
).pipe(Effect.as(undefined)),
),
Effect.orDie,
),
);
if (!mcpAppCaptures.delete(toolCall.nativeItemId)) {
const filePath =
reference === undefined
Expand All @@ -7470,13 +7486,15 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
return;
}
yield* emitToolCallArtifacts(
reference === undefined || artifacts.turnItem.type !== "dynamic_tool"
reference === undefined ||
target === undefined ||
artifacts.turnItem.type !== "dynamic_tool"
? artifacts
: {
...artifacts,
turnItem: {
...artifacts.turnItem,
toolName: `${app.server}.${app.tool}`,
toolName: `${target.server}.${target.tool}`,
output: { [MCP_APP_OUTPUT_KEY]: reference, result: input.result },
},
},
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.