UI: 'Unhandled case: [object Object]' toast when claude-vscode MCP returns -32601 on tools/list

Resolved 💬 3 comments Opened May 15, 2026 by David-Castilla-Gomez Closed May 19, 2026

Versions

  • VS Code extension: anthropic.claude-code@2.1.142 (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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗