Repository navigation
Description
Overview
#3664 (ADR-095) made nodespace mcp depend on a database: it serves tools only when the routed database's external_tools_enabled is true, mcp install/uninstall set that flag in a selected database, and the server binds to one database id at start. That is wrong. NodeSpace works against one active database at a time, the daemon's default, and the user decides which. mcp is the app's passthrough to the CLI and must act on whichever database is active when a call is made, with no database dependency of its own.
Problem Statement
external_tools_enabledis a field ofdatabase-settingsthat does not belong there: enablement is a machine-level decision, not a database one.mcp install/uninstall/statusand the server need a running daemon and a selected database;uninstallcannot complete its disable step when the daemon is down.- The server pins a database id at start, so switching the active database does not move it, and a client enabled for one database is a different trust question from one enabled for another. The review of Move the daemon's settings into each database's settings node and delete daemon.toml (ADR-095) #3664 found a bypass here (a call naming another
--database) and closed it by binding harder, which is the wrong direction. - The passthrough can run
database use, letting a client change the active database, which is the user's decision.
Proposed Solution
- Remove
external_tools_enabledfrom thedatabase-settingsschema, wire type, typed update, generated TypeScript and thenode-types.mdsheet (node type sequence applies; reset the database, no migration). - Enablement is the client config
nodespace mcp installwrites:installwrites it,uninstallremoves it,statusreports whether it is present. No flag is stored anywhere.install/uninstall/statusand the server no longer connect to the daemon for settings, take no database, and print no database label. - The server does not bind a database. It forwards calls with the daemon socket it started with and lets the CLI route to the active (default) database as any other command does. A call cannot select a database: refuse
--database(both spellings) and--socketnaming anything other than the server's own daemon. Refuse thedatabasesubcommand in calls. - Delete the per-database refusal test coverage and the id-binding added in Move the daemon's settings into each database's settings node and delete daemon.toml (ADR-095) #3664; keep the refusal of
--database/--socketin calls, now for the active-database rule. - Update the CLI reference (
packages/skill/references/cli.mdhand-written "Database settings" section and the generatedmcptext) and regenerate withbun run skill:gen.
Documentation
- ADR-095 §4 - amended 2026-10-06: external tools are not a database setting;
mcpacts on the active database; enablement ismcp install;databaseregistry commands are refused in the passthrough. - ADR-038 - Trust Boundary: explicit user enablement for
mcpisnodespace mcp install, machine-level. - Node type sequence - mandatory: a field is removed from a core type.
- Updates, pushed just before the merge: the
database-settingssheet in Node Types (remove theexternal_tools_enabledrow and its consumer bullet; the merge gate compares the sheet with the schema).
Architecture Impact
Amends ADR-095 §4 and the ADR-038 trust-boundary note. Both are already amended in nodespace-docs (2026-10-06); no further decision change is needed. This reverses the external_tools_enabled field and the mcp database binding that #3664 shipped.
Acceptance Criteria
-
database-settingsno longer declaresexternal_tools_enabled; schema,DatabaseSettingsFields, the typed update, TS (bun run gen:types) and the sheet agree;bun run node-types:checkpasses. A flatnode updatenaming the field is rejected as an undeclared key. -
nodespace mcp install,uninstallandstatusmake no daemon connection and take no database;statusreports whether a client config is present;uninstallworks with the daemon stopped. - The server starts without reading any settings node and serves with the daemon down at start; each call acts on the active database at that moment: after
nodespace database use <other>, the next call operates on<other>. - A call naming
--database(either spelling) or a--socketother than the server's own is refused; a call to thedatabasesubcommand is refused; a printed deleteconfirm_commandstill replays. - The routing-header binding, database label and id-resolution added to
commands/mcp.rsin Move the daemon's settings into each database's settings node and delete daemon.toml (ADR-095) #3664 are gone, with their tests replaced by the active-database tests above. - CLI guidance describes
mcpas enabled byinstall, acting on the active database; SKILL.md drift check passes. -
bun run test:changedpasses; code passesbun run quality:fix.
Technical Specifications
Reference Files
packages/cli/src/commands/mcp.rs:connect_settings_target,read_settings,set_external_tools_enabled,enforce_enabled,run_server,build_child_args,install,uninstall,status.packages/cli/tests/it/mcp_integration.rs: the per-database tests added in Move the daemon's settings into each database's settings node and delete daemon.toml (ADR-095) #3664.packages/nodespace-types/src/database_settings.rs,packages/nodespace-types/src/convert.rs: field, update, promoted fields.packages/core/src/models/core_schemas.rs: thedatabase-settingsschema and its test.packages/core/tests/it/database_settings_fields_test.rs,packages/daemon/tests/it/per_db_settings.rs,packages/core/src/services/node_service/mod.rs(seed test),packages/desktop-app/app-lib/tests/it/adapter_contract_test.rs: expectations naming the field.packages/skill/references/cli.md,packages/skill/src/mcp-installer.ts(comments).
Implementation Details
- Following the project's no-migration rule: change the shape and reset the database; no code reads or removes an existing
external_tools_enabledvalue. - Whether a client config is present is what the installer's
mcp-statusalready reports; reuse it.
Related Issues
- Move the daemon's settings into each database's settings node and delete daemon.toml (ADR-095) #3649 (the issue whose implementation this corrects; PR Move the daemon's settings into each database's settings node and delete daemon.toml (ADR-095) #3664)
Non-Goals
- Selecting or switching the active database from the passthrough.
- Per-client or per-database trust levels.
Activity
mstomar125 commentedon Oct 6, 2026
Picking this up now, following the proposed solution in the issue. If this is already in progress on your side, comment here and I'll stop and hand it over. I'll check this issue and the open PRs again before pushing anything.
🤖 Generated with Claude Code