Skip to content

MCP search tool only searches default source — federated source content missed #710

@metaWuming

Description

@metaWuming

What happened?

The MCP tool mcp__gbrain__search returns [] for queries that find hits when run via gbrain search CLI. Concretely, content imported into a federated source via gbrain sync --strategy code is searchable via CLI but invisible to MCP search.

I have 8 federated sources registered (1 default + 7 code-stage gstack-code-* from various local repos). 347 total pages reported by both gbrain stats and gbrain sources list (default).

What did you expect?

MCP search should return the same results as CLI gbrain search for the same query — both should search across all federated sources, OR provide a source filter parameter so MCP clients can explicitly choose.

Steps to reproduce

  1. Set up gbrain with at least one code-stage federated source: gbrain sources add <id> --path <repo-path> --federated && gbrain sync --strategy code --source <id>
  2. Run via MCP: mcp__gbrain__search with query="<term known to be in that source>" → returns []
  3. Run via CLI: gbrain search "<same term>" → returns hits with score > 0.4

Concrete example from my brain:

  • gbrain search "OPENTIX 票房"[0.6351] pr_desc_v240 -- # v2.40:事件標註系統 Phase B …
  • mcp__gbrain__search { query: "TixTrack Pro Activa Productions OPENTIX 票房" }[]

Environment

  • gbrain version: 0.28.6
  • OS: macOS Darwin 25.3.0
  • Bun version: 1.3.12
  • Database: PGLite (~/.gbrain/brain.pglite)

gbrain doctor --json summary

status: warnings
health_score: 65
connection: 347 pages
embeddings: 100% coverage, 0 missing
schema_version: 38 (latest)

(Full doctor output available on request — main warns are: resolver_health 37 routing-misses, sync_failures 180 unacknowledged, frontmatter_integrity 1237 issues across code sources — see related issues.)

Workaround

Use CLI gbrain search directly when MCP returns empty for what should be present.

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