claude-code - 💡(How to fix) Fix UI: 'Unhandled case: [object Object]' toast when claude-vscode MCP returns -32601 on tools/list

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

On extension startup (or when the webview activates), a red toast appears:

Unhandled case: [object Object]

View output logs · Troubleshooting resources

The chat itself works fine — it is purely a UI handling issue.

Error Message

The extension launches an internal MCP server (claude-vscode on localhost:46741). When something calls tools/list on that server, it consistently responds with JSON-RPC error -32601 "Method not found": [DEBUG] MCP server "claude-vscode": tools/list failed (MCP error -32601: Method not found); retrying once [ERROR] MCP server "claude-vscode" Failed to fetch tools: MCP error -32601: Method not found The UI error handler appears to lack a case for this shape of error object and falls into a default branch that concatenates the object directly into the template, producing the literal string [object Object] instead of the actual error.message. 2. UI side: in the default branch of the error switch, replace ${error} with ${error?.message ?? JSON.stringify(error)} so any future unknown error at least surfaces something readable.

Root Cause

On extension startup (or when the webview activates), a red toast appears:

Unhandled case: [object Object]

View output logs · Troubleshooting resources

The chat itself works fine — it is purely a UI handling issue.

Code Example

[DEBUG] MCP server "claude-vscode": tools/list failed (MCP error -32601: Method not found); retrying once
[ERROR] MCP server "claude-vscode" Failed to fetch tools: MCP error -32601: Method not found
RAW_BUFFERClick to expand / collapse

Versions

  • VS Code extension: [email protected] (and previously @2.1.141)
  • OS: Windows 10 Home 22H2 (x64)

Summary

On extension startup (or when the webview activates), a red toast appears:

Unhandled case: [object Object]

View output logs · Troubleshooting resources

The chat itself works fine — it is purely a UI handling issue.

What the output log shows

The extension launches an internal MCP server (claude-vscode on localhost:46741). When something calls tools/list on that server, it consistently responds with JSON-RPC error -32601 "Method not found":

[DEBUG] MCP server "claude-vscode": tools/list failed (MCP error -32601: Method not found); retrying once
[ERROR] MCP server "claude-vscode" Failed to fetch tools: MCP error -32601: Method not found

The UI error handler appears to lack a case for this shape of error object and falls into a default branch that concatenates the object directly into the template, producing the literal string [object Object] instead of the actual error.message.

Suggested fix

  1. Server side: either implement tools/list on the internal claude-vscode MCP server (returning {tools: []} if there are none is enough), or stop calling it from the UI if there are intentionally no tools.
  2. UI side: in the default branch of the error switch, replace ${error} with ${error?.message ?? JSON.stringify(error)} so any future unknown error at least surfaces something readable.

Impact

Cosmetic. The toast is alarming for users who don't know what it means, but functionality is unaffected.

Extra context (also seen in the same log run)

Four claude.ai proxy MCP servers (Gmail, Google Calendar, Google Drive, Canva) fail at startup with mcp_unauthorized_no_token. Expected if the user has not authenticated those connectors; just listing it in case it's related to the toast — the timing doesn't match exactly, the toast aligns with the claude-vscode tools/list failure.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix UI: 'Unhandled case: [object Object]' toast when claude-vscode MCP returns -32601 on tools/list