Skip to content

Keep MCP tool callback updates inside host executors - #804

Merged
Aymericr merged 1 commit into
mainfrom
fix/mcp-tool-update-executor-20260909
Sep 9, 2026
Merged

Keep MCP tool callback updates inside host executors#804
Aymericr merged 1 commit into
mainfrom
fix/mcp-tool-update-executor-20260909

Conversation

@Aymericr

@Aymericr Aymericr commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description

RegisteredTool.update({ callback }) could replace a regular tool handler after registration and bypass the host executor. Returned registrations from both registerTool() and deprecated tool() now re-wrap callback replacements.

String renames fail closed while executeTool is configured. The SDK updater closes over the original name, so repeated renames and later remove() cannot be made reliable through its public registration API. Failed rename attempts leave the original registered tool wrapped and removable. Experimental task-based tool registration remains outside this hook and is not used by createPascalMcpServer.

Validation

  • bun test packages/mcp/src — 361 tests, 1,375 assertions passed.
  • Both registration surfaces cover callback replacement, repeated rename refusal, continued wrapped execution, and removal after failed renames.
  • bunx ultracite check packages/mcp/src/server.ts packages/mcp/src/server.test.ts
  • git diff --check
  • Package typecheck retains eight pre-existing scene-query.ts implicit-any diagnostics and has no changed-file diagnostics.

@pascal

pascal Bot commented Sep 9, 2026

Copy link
Copy Markdown

I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…).

Please try again, rephrase, or reach out if it keeps failing.

Error id: 5fe01166-83a8-424e-8dc5-71eb7f2bf7f3

@Aymericr Aymericr changed the title Preserve MCP host executors across tool updates Keep MCP tool callback updates inside host executors Sep 9, 2026
@Aymericr
Aymericr force-pushed the fix/mcp-tool-update-executor-20260909 branch from f05b546 to c2597da Compare September 9, 2026 19:17
@Aymericr
Aymericr merged commit c156615 into main Sep 9, 2026
4 checks passed
@Aymericr
Aymericr deleted the fix/mcp-tool-update-executor-20260909 branch September 9, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant