Skip to content

whoami returns unknown_transport over stdio MCP transport (v0.28.6) #713

@lucha0404

Description

@lucha0404

Repro:

  1. gbrain serve (stdio MCP server, no flags)
  2. From MCP client (Claude Code), call mcp__gbrain__whoami

Expected: {transport: "local", scopes: []}

Actual:

{
  "error": "unknown_transport",
  "message": "whoami called over a remote transport that did not thread ctx.auth. This is a transport bug — every remote call site must populate ctx.auth or set ctx.remote === false."
}

Other tools work fine over the same stdio transport — find_orphans, takes_list, sources_list, get_stats, list_pages all return correct responses. Only whoami mis-detects the transport.

Likely cause (from quick grep on src/mcp/server.ts):

  • Line 36 sets remote: true (HTTP server context)
  • Line 58 sets remote: false (stdio context)

The whoami handler probably checks ctx.remote === true first and bails into the unknown_transport branch before reaching the local-shape return — OR the stdio entry point doesn't actually reach line 58 in some code path.

Environment: gbrain v0.28.6 (commit b325f28) / Bun 1.3.13 / Linux (Ubuntu 22.04, Vertex AI ADC fork) + Windows 11 client. Both clients exhibit the same error over their respective stdio MCP server.

Happy to PR a fix if you confirm the diagnosis direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions