MCP `sources_add` silently discards `path` — `local_path` persists as null, so `sync --all` skips the source forever
#3,645 opened on Jul 30, 2026
Repository metrics
- Stars
- (21,368 stars)
- PR merge metrics
- (Avg merge 18d 10h) (162 merged PRs in 30d)
Description
Version: gbrain 0.42.67.0 · engine: postgres
The MCP sources_add tool accepts a path argument, reports success, and does not persist it — local_path comes back null. Because sync --all only picks up sources with a local_path, every source registered over MCP silently syncs nothing.
Repro
// call
{ "id": "service-a",
"path": "/home/user/workspace/monorepo/repos/service-a",
"federated": true }
// response — note local_path
{ "id": "service-a", "name": "service-a",
"local_path": null, "last_commit": null, "last_sync_at": null,
"config": { "federated": true } }
sources_list confirms it persisted as null:
{ "id": "service-a", "local_path": null, "remote_url": null,
"federated": true, "page_count": 0 }
The CLI equivalent persists correctly:
$ gbrain sources add service-a --path /home/user/workspace/monorepo/repos/service-a
$ gbrain sources list
service-a isolated 0 pages never synced
/home/user/workspace/monorepo/repos/service-a
Impact
Registering repos over MCP appears to succeed and produces a brain that never indexes anything. Discovered while onboarding a multi-repo workspace: every source registered "successfully" over MCP, and sync --all skipped all of them without a warning. Had to drop them and re-register via CLI.
Expected
Either persist path (matching CLI behaviour), or reject the call when path cannot be honoured. Silently accepting and discarding a required argument is the problem.
A secondary guard worth considering: sync --all could warn when it skips sources for a missing local_path, rather than skipping silently — that would have surfaced this in seconds instead of after a full sync cycle.