From a74a6313dd6767de3ad446fd1f681378d96e10cd Mon Sep 17 00:00:00 2001 From: jubnl Date: Fri, 10 Apr 2026 03:09:49 +0200 Subject: [PATCH] fix(mcp): instruct Claude to retry tool call after deprecation notice Claude stopped after surfacing the error rather than retrying. Append an explicit instruction to retry the tool call so the user gets both the deprecation warning and their actual answer. --- server/src/mcp/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/mcp/index.ts b/server/src/mcp/index.ts index fc58abac..2cc5b7a7 100644 --- a/server/src/mcp/index.ts +++ b/server/src/mcp/index.ts @@ -86,9 +86,10 @@ The following features are optional and may not be available on every TREK insta `.trim(); const STATIC_TOKEN_DEPRECATION_NOTICE = - '\n\n⚠️ IMPORTANT: This MCP session is authenticated with a static API token (trek_…). ' + + '⚠️ This MCP session is authenticated with a static API token (trek_…). ' + 'Static token authentication is deprecated and will be removed in a future version of TREK. ' + - 'Please inform the user that they must migrate to OAuth 2.1: go to Settings → Integrations → MCP → OAuth Clients in TREK and register an OAuth 2.1 application for their MCP client.'; + 'Inform the user they must migrate to OAuth 2.1: Settings → Integrations → MCP → OAuth Clients in TREK. ' + + 'This warning fires once per session. Retry the tool call now to continue normally.'; const SESSION_TTL_MS = 60 * 60 * 1000; // 1 hour const sessionParsed = Number.parseInt(process.env.MCP_MAX_SESSION_PER_USER ?? "");