Skip to content

think over MCP returns 'no LLM available' — ANTHROPIC_API_KEY not threaded through stdio transport #952

@brunocechet

Description

@brunocechet

Summary

mcp__gbrain__think returns {"answer": "(no LLM available — set ANTHROPIC_API_KEY or pass client)", "warnings": ["NO_ANTHROPIC_API_KEY"]} over the stdio MCP transport, even when the wrapping Claude Code session has full LLM capability. The "synthesis flagship" tool is non-functional for any MCP caller.

Environment

  • gbrain 0.28.12
  • macOS 26.5
  • Engine: Postgres on Supabase
  • Transport: stdio MCP via Claude Code
  • ANTHROPIC_API_KEY: not set in user's shell (intentionally — Claude Code provides the LLM context)

Repro

{"name":"think","arguments":{"question":"Why did we choose option A over option B for feature X?"}}

// response
{
  "answer": "(no LLM available — set ANTHROPIC_API_KEY or pass client)",
  "warnings": ["NO_ANTHROPIC_API_KEY"],
  "evidence": [ /* still returns relevant pages */ ]
}

The retrieval portion works (evidence is populated). The synthesis step is what breaks.

Impact

  • think is the documented multi-hop synthesis primitive ("cited answer with conflict + gap analysis"). It's the one tool that promises to do real reasoning over the corpus instead of just retrieval. Over MCP, it's a no-op.
  • Agents fall back to manually pulling pages via query and synthesizing in their own context — which is what they'd do without gbrain at all.

Hypotheses

This is the same ctx-not-threaded family as #713 (whoami unknown_transport). The MCP server doesn't get the calling Claude Code session's LLM credentials. Two design choices:

  1. Bring-your-own-key: gbrain MCP server reads ANTHROPIC_API_KEY from its own env at startup (won't work for Claude Code MCP since the CC parent doesn't propagate it down)
  2. Per-call client: accept a client_id / model arg from the MCP caller and route through it (cleaner but bigger contract)

Expected

Either:

  • Document that think requires ANTHROPIC_API_KEY to be set in gbrain server env (and the auto-launched stdio server picks it up from user's shell)
  • Or accept a model arg + route synthesis through whatever LLM the MCP caller designates

Actual

Silent degrade to "evidence-only" mode with a one-line warning that's easy to miss in a 50KB response.

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