[BUG] MCP server error notifications render as "[object Object]" instead of the error message

Resolved 💬 3 comments Opened May 14, 2026 by avihay1989 Closed Jul 7, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When an MCP server connection fails during Claude Code session startup, the
VS Code extension surfaces a notification whose body is the literal string
"[object Object]" instead of the underlying error message. The notification
gives the user nothing actionable.

The errors are serialized correctly in the extension's output channel — the
bug is only in how they are forwarded to vscode.window.showErrorMessage.
It looks like the raw error object is being passed where err.message
(or String(err.message ?? err)) was intended; default JS coercion of a
plain object yields "[object Object]".

The same notification fires every Claude session start, so it is loud and
repetitive in practice.

What Should Happen?

Additional Information
Anything else that might help us understand the issue?

Screenshots (drag and drop images here)
Configuration files
Related files or code
Links to repositories demonstrating the issue

Error Messages/Logs

From the extension output channel
(C:\Users\<USER>\AppData\Roaming\Code\logs\<session>\window1\exthost\Anthropic.claude-code\Claude VSCode.log):

2026-05-14T13:08:35.648Z [ERROR] MCP server "claude.ai Google Calendar" Error: Streamable HTTP error: Error POSTing to endpoint: {"type":"error","error":{"type":"authentication_error","message":"MCP server requires authentication but no OAuth token is configured.","details":{"error_code":"mcp_unauthorized_no_token"}},"request_id":"<redacted>"}
2026-05-14T13:08:35.672Z [ERROR] MCP server "claude.ai Gmail" Error: Streamable HTTP error: Error POSTing to endpoint: {"type":"error","error":{"type":"authentication_error","message":"MCP server requires authentication but no OAuth token is configured.","details":{"error_code":"mcp_unauthorized_no_token"}},"request_id":"<redacted>"}
2026-05-14T13:08:35.693Z [ERROR] MCP server "claude.ai Google Drive" Error: Streamable HTTP error: Error POSTing to endpoint: {"type":"error","error":{"type":"authentication_error","message":"MCP server requires authentication but no OAuth token is configured.","details":{"error_code":"mcp_unauthorized_no_token"}},"request_id":"<redacted>"}
2026-05-14T13:22:57.191Z [ERROR] MCP server "claude-vscode" Failed to fetch tools: MCP error -32601: Method not found

In the UI: each of the above produces a VS Code error toast whose body is
the literal text "[object Object]". The extension's output log shows the
real error correctly — only the notification surface is broken.

Steps to Reproduce

  1. Use a Claude Code account that has the managed connectors

"claude.ai Gmail", "claude.ai Google Calendar", and "claude.ai Google Drive"
listed in ~/.claude/mcp-needs-auth-cache.json without OAuth tokens.
(These are present by default for many Claude.ai accounts; no project
configuration is needed — the project .mcp.json does NOT declare them.)

  1. Open VS Code in any workspace.
  2. Open the Claude Code panel and start a session.
  3. Within ~1 second of launch, three error toasts appear in the bottom-right

of VS Code. Each one's body reads exactly "[object Object]".

  1. Check the output channel (Output → "Claude VSCode") and you'll see the

real underlying errors are logged correctly with full message + request_id.

A separate one-shot repro for the same bug class:

  • Trigger on any Claude session start when a stdio MCP server responds to

tools/list with JSON-RPC error -32601. The built-in "claude-vscode"
server does this. One extra "[object Object]" toast fires per session.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.141

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

  • The three failing servers are not declared in the project's .mcp.json

(which only lists context7 + playwright). They come from user/account
scope at ~/.claude/mcp-needs-auth-cache.json.

  • The error rate is "every Claude session start" — three popups per launch.

Dedup would help even without the [object Object] fix.

  • Likely fix is a one-line change in the error-to-string adapter for

vscode.window.showErrorMessage(). Suggest:
const msg =
(typeof err === 'string' && err) ||
err?.message ||
(typeof err?.toString === 'function' && err.toString() !== '[object Object]' && err.toString()) ||
JSON.stringify(err);
vscode.window.showErrorMessage(msg);

  • A screenshot of one of the popups (the literal "[object Object]" toast)

would be helpful if you can grab one before dismissing.

View original on GitHub ↗

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