[GH-ISSUE #7535] [Bug] Amp registration writes global settings despite --no-global #4478

Open
opened 2026-10-31 00:50:09 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @coygeek on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/7535

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

MCP or agent integration

Observed behavior

node "$ENTRY" mcp add --no-global --agent amp --command 'node project-rea.mjs' --json, run from an empty project directory, exits 0 and reports successful registration with Amp. It creates $HOME/.config/amp/settings.json containing the REA server and creates no file in the project. An existing global settings fixture is also modified by this project-scoped request.

Reproduction

From the already-built baseline checkout with Node.js 24.22.1 on PATH:

  1. Capture the checkout entrypoint and create an isolated environment and empty project:

    ENTRY="$PWD/scripts/rea.mjs"
    WORK=$(mktemp -d)
    export HOME="$WORK/home" XDG_CONFIG_HOME="$WORK/config" XDG_CACHE_HOME="$WORK/cache"
    export XDG_DATA_HOME="$WORK/data" XDG_STATE_HOME="$WORK/state" TMPDIR="$WORK/tmp"
    mkdir -p "$HOME" "$TMPDIR" "$WORK/project"
    cd "$WORK/project"
    
  2. Request project-scoped Amp registration:

    node "$ENTRY" mcp add --no-global --agent amp --command 'node project-rea.mjs' --json
    echo "exit=$?"
    
  3. Inspect the resulting global settings and the empty project:

    cat "$HOME/.config/amp/settings.json"
    find . -type f
    

Fresh-home runs reproduced three times. An additional run with existing global settings reproduced the same scope violation. A fresh-home control without --no-global produced identical settings.

Expected behavior

The command's observed help promises --no-global will Install to project instead of globally. The installation guide also explicitly documents this separate registration route. Selecting Amp should therefore create a project-scoped registration, or reject the unsupported combination with a nonzero diagnostic before creating or modifying global settings.

Impact and scope

P2: a valid project-scoped request produces a persistent global configuration change and leaves the requested project configuration absent. The existing-settings fixture retained its unrelated server and theme but gained the new global REA registration. Removing that added entry manually can undo the edit; a working project-local Amp registration workaround was not verified. Verification covered macOS and the selected Amp writer only. No Amp application session was started, so effects inside running clients remain untested.

REA version

Exact node scripts/rea.mjs --version output: 6.8.0.
Source baseline: 65f1c447344a423fa2785847dbcea1e9a9e2454a.

Runtime and platform

Node.js v24.22.1; macOS 27.0.1; Darwin arm64. Repository-pinned Incur 0.6.1.

Target and artifact context

Empty project directories and disposable homes. The registration string is stored as configuration data; it is not executed. The existing-settings control contained only a theme and a separate synthetic server.

Interface

CLI

Earliest failure stage

Setup or provider admission

Relevant output or evidence

The executed project-scoped command printed:

✓ Registered rea as MCP server
  Agents: Amp

Agents can now use rea tools.
{
  "name": "rea",
  "command": "node project-rea.mjs",
  "agents": [
    "Amp"
  ]
}
exit=0

Reading $HOME/.config/amp/settings.json returned:

{
  "amp.mcpServers": {
    "rea": {
      "command": "node",
      "args": ["project-rea.mjs"]
    }
  }
}

find . -type f returned no project files. The expected scope contract is present in mcp add --help and docs/installation.md:1100-1109.

Typed outcome or recovery expected

If Amp project registration is unsupported, return an explicit nonzero error identifying that scope limitation and leave global settings absent or unchanged. No particular error code or project-settings filename is assumed here.

Analysis or suspected cause

Source-derived: REA deliberately routes registration helpers through Incur (scripts/rea.mjs:9-11,31-40) and constructs the CLI with its REA MCP launcher (src/cli.ts:96-103). The pinned dependency parses --no-global and forwards global: false (node_modules/incur/src/Cli.ts:1277-1301), but only the package-runner branch consumes the scope option. The Amp branch calls its writer without a scope argument and selects the home-directory configuration path (node_modules/incur/src/SyncMcp.ts:21-33,51-82). This is an implementation cause in Incur that violates the contract exposed by REA's own CLI.

Additional context

Read open and closed issue/PR search results through the public GitHub API after isolated GitHub CLI searches required authentication. Related #7375 and PR #7453 reject surplus positional arguments; the reproduction here contains only supported options. #5811 and PR #6347 concern the Windows package-runner startup path. #2187 and PR #2414 concern project scope in setup for Claude Code. None describes the reproduced Amp scope violation.

Originally created by @coygeek on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/7535 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area MCP or agent integration ### Observed behavior `node "$ENTRY" mcp add --no-global --agent amp --command 'node project-rea.mjs' --json`, run from an empty project directory, exits 0 and reports successful registration with Amp. It creates `$HOME/.config/amp/settings.json` containing the REA server and creates no file in the project. An existing global settings fixture is also modified by this project-scoped request. ### Reproduction From the already-built baseline checkout with Node.js 24.22.1 on PATH: 1. Capture the checkout entrypoint and create an isolated environment and empty project: ```sh ENTRY="$PWD/scripts/rea.mjs" WORK=$(mktemp -d) export HOME="$WORK/home" XDG_CONFIG_HOME="$WORK/config" XDG_CACHE_HOME="$WORK/cache" export XDG_DATA_HOME="$WORK/data" XDG_STATE_HOME="$WORK/state" TMPDIR="$WORK/tmp" mkdir -p "$HOME" "$TMPDIR" "$WORK/project" cd "$WORK/project" ``` 2. Request project-scoped Amp registration: ```sh node "$ENTRY" mcp add --no-global --agent amp --command 'node project-rea.mjs' --json echo "exit=$?" ``` 3. Inspect the resulting global settings and the empty project: ```sh cat "$HOME/.config/amp/settings.json" find . -type f ``` Fresh-home runs reproduced three times. An additional run with existing global settings reproduced the same scope violation. A fresh-home control without `--no-global` produced identical settings. ### Expected behavior The command's observed help promises `--no-global` will `Install to project instead of globally`. The installation guide also explicitly documents this separate registration route. Selecting Amp should therefore create a project-scoped registration, or reject the unsupported combination with a nonzero diagnostic before creating or modifying global settings. ### Impact and scope P2: a valid project-scoped request produces a persistent global configuration change and leaves the requested project configuration absent. The existing-settings fixture retained its unrelated server and theme but gained the new global REA registration. Removing that added entry manually can undo the edit; a working project-local Amp registration workaround was not verified. Verification covered macOS and the selected Amp writer only. No Amp application session was started, so effects inside running clients remain untested. ### REA version Exact `node scripts/rea.mjs --version` output: `6.8.0`. Source baseline: `65f1c447344a423fa2785847dbcea1e9a9e2454a`. ### Runtime and platform Node.js v24.22.1; macOS 27.0.1; Darwin arm64. Repository-pinned Incur 0.6.1. ### Target and artifact context Empty project directories and disposable homes. The registration string is stored as configuration data; it is not executed. The existing-settings control contained only a theme and a separate synthetic server. ### Interface CLI ### Earliest failure stage Setup or provider admission ### Relevant output or evidence The executed project-scoped command printed: ```text ✓ Registered rea as MCP server Agents: Amp Agents can now use rea tools. { "name": "rea", "command": "node project-rea.mjs", "agents": [ "Amp" ] } exit=0 ``` Reading `$HOME/.config/amp/settings.json` returned: ```json { "amp.mcpServers": { "rea": { "command": "node", "args": ["project-rea.mjs"] } } } ``` `find . -type f` returned no project files. The expected scope contract is present in `mcp add --help` and `docs/installation.md:1100-1109`. ### Typed outcome or recovery expected If Amp project registration is unsupported, return an explicit nonzero error identifying that scope limitation and leave global settings absent or unchanged. No particular error code or project-settings filename is assumed here. ### Analysis or suspected cause Source-derived: REA deliberately routes registration helpers through Incur (`scripts/rea.mjs:9-11,31-40`) and constructs the CLI with its REA MCP launcher (`src/cli.ts:96-103`). The pinned dependency parses `--no-global` and forwards `global: false` (`node_modules/incur/src/Cli.ts:1277-1301`), but only the package-runner branch consumes the scope option. The Amp branch calls its writer without a scope argument and selects the home-directory configuration path (`node_modules/incur/src/SyncMcp.ts:21-33,51-82`). This is an implementation cause in Incur that violates the contract exposed by REA's own CLI. ### Additional context Read open and closed issue/PR search results through the public GitHub API after isolated GitHub CLI searches required authentication. Related [#7375](https://github.com/morluto/rea/issues/7375) and [PR #7453](https://github.com/morluto/rea/pull/7453) reject surplus positional arguments; the reproduction here contains only supported options. [#5811](https://github.com/morluto/rea/issues/5811) and [PR #6347](https://github.com/morluto/rea/pull/6347) concern the Windows package-runner startup path. [#2187](https://github.com/morluto/rea/issues/2187) and [PR #2414](https://github.com/morluto/rea/pull/2414) concern project scope in setup for Claude Code. None describes the reproduced Amp scope violation.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#4478
No description provided.