Skip to content

fix(compose): drop MCP_SERVER_TOKEN hard-require per CANONICAL_NAMES §5 - #1977

Merged
POWERFULMOVES merged 4 commits into
mainfrom
fix/compose-mcp-token-canon
Jul 6, 2026
Merged

POWERFULMOVES merged 4 commits into
mainfrom
fix/compose-mcp-token-canon

Conversation

@POWERFULMOVES

@POWERFULMOVES POWERFULMOVES commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

- A0_SET_mcp_server_token=${MCP_SERVER_TOKEN:?...} hard-fails file-wide compose interpolation on any node without the var — today it blocked make -C pmoves up-model-management (an unrelated service) on Knuckles, reproducing the "MCP_SERVER_TOKEN not pinned" GAP from the 2026-07-03 standup audit.

CANONICAL_NAMES.md §5 already prescribes the fix: do not set it in the compose env list at allenv_file: env.tier-agent provides A0_SET_mcp_server_token when the operator has pinned a token; otherwise Agent Zero auto-generates one at startup. This PR applies exactly that: the line becomes an explanatory comment, and env.tier-agent.example documents the canonical slot.

Note the previous deprecated pattern was ${MCP_SERVER_TOKEN:-} (empty-default silently overriding env_file). The :? hard-require fixed the silent override but traded it for fleet-wide interpolation failure. Omission is the §5 canon.

Test plan

  • On a node without MCP_SERVER_TOKEN: make -C pmoves up-model-management now interpolates cleanly (was: required variable MCP_SERVER_TOKEN is missing a value)
  • Agent Zero a2a path: token resolves from env.tier-agent when pinned; auto-generated otherwise (per §5)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Compose now starts even when the MCP server token is not set, avoiding a startup failure during environment interpolation.
    • Agent Zero can now auto-generate the token at startup if none is provided.
  • Documentation

    • Added clearer configuration guidance for the MCP server token, including the default behavior when it is left blank.

The ${MCP_SERVER_TOKEN:?...} interpolation hard-require on agent-zero's env
list made every compose invocation against the shared file fail on nodes
without the var — blocking bring-up of unrelated services (model-registry on
Knuckles, 2026-07-06). §5 canon: compose omits the var entirely; env.tier-agent
provides A0_SET_mcp_server_token when the operator pins one, else Agent Zero
auto-generates at startup. Documents the slot in env.tier-agent.example.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR changes the A0_SET_mcp_server_token environment variable interpolation in docker-compose.agents.yml and docker-compose.yml from a hard-required (:?) form to a soft default (:-), preventing compose failures when MCP_SERVER_TOKEN is unset. It also documents the canonical token location in env.tier-agent.example.

Changes

MCP Server Token Configuration

Layer / File(s) Summary
Compose token interpolation softened
pmoves/docker-compose.agents.yml, pmoves/docker-compose.yml
Changed A0_SET_mcp_server_token from ${MCP_SERVER_TOKEN:?...} to ${MCP_SERVER_TOKEN:-} to avoid hard-failing compose interpolation when the variable is unset, with comments explaining the behavior and Agent Zero's auto-generation fallback.
Example env documentation for MCP token
pmoves/env.tier-agent.example
Added a commented A0_SET_mcp_server_token section describing it as the canonical pinned token location and noting Agent Zero auto-generates one if left unset.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • POWERFULMOVES/PMOVES.AI#1446: Both PRs change the same A0_SET_mcp_server_token interpolation in pmoves/docker-compose.yml from a hard-fail form to a non-hard-fail behavior.
  • POWERFULMOVES/PMOVES.AI#1616: Updates the same compose interpolation that was originally introduced for A2A support, which this PR further softens.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main compose change and the MCP token hard-require removal.
Description check ✅ Passed The description includes the required Summary and Testing sections, but it omits the template's Required Checks, Review Coordination, and Reviewer Notes sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/compose-mcp-token-canon

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Docker Hardening Validation

Hardening Validation Report

Validated: Mon Jul 6 12:40:14 UTC 2026

Services Checked

PMOVES.AI Docker Hardening Validation

[INFO] Checking: pmoves/docker-compose.hardened.yml

[INFO] Validating: hi-rag-gateway-v2
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: extract-worker
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: langextract
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: presign
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: render-webhook
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: retrieval-eval
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: pdf-ingest
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: jellyfin-bridge
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: invidious-companion-proxy
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: ffmpeg-whisper
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: media-video
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: media-audio
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: hi-rag-gateway-v2-gpu
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: hi-rag-gateway-gpu
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: deepresearch
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: supaserch
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: publisher-discord
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: mesh-agent
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: nats-echo-req
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: nats-echo-res
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: comfy-watcher
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: grayjay-plugin-host
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: agent-zero
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: archon
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: channel-monitor
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: pmoves-yt
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: notebook-sync
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: supabase_service_role_key
[WARN] No user directive
[WARN] No read_only directive
[WARN] No cap_drop: ["ALL"]
[WARN] No no-new-privileges
[WARN] No resource limits

[INFO] Validating: supabase_jwt_secret
[WARN] No user directive
[WARN] No read_only directive
[WARN] No cap_drop: ["ALL"]
[WARN] No no-new-privileges
[WARN] No resource limits

======================================
Summary: 108 passed, 37 warnings, 0 errors

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57ce876bea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pmoves/docker-compose.yml Outdated
POWERFULMOVES and others added 3 commits July 6, 2026 17:47
…l removal)

Codex P2 on #1977: dropping the A0_SET_mcp_server_token mapping entirely means
nodes that pinned MCP_SERVER_TOKEN lose it — Agent Zero reads A0_SET_* (not the
plain env var), so it auto-generates instead of honoring the pin. Restore the
mapping with a soft default ${MCP_SERVER_TOKEN:-} (not the old :? hard-require),
keeping the Knuckles bring-up fix (no interpolation hard-fail) while bridging a
pinned token to Agent Zero's setting.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Docker Hardening Validation

Hardening Validation Report

Validated: Mon Jul 6 21:48:44 UTC 2026

Services Checked

PMOVES.AI Docker Hardening Validation

[INFO] Checking: pmoves/docker-compose.hardened.yml

[INFO] Validating: hi-rag-gateway-v2
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: extract-worker
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: langextract
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: presign
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: render-webhook
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: retrieval-eval
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: pdf-ingest
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: jellyfin-bridge
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: invidious-companion-proxy
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: ffmpeg-whisper
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: media-video
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: media-audio
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: hi-rag-gateway-v2-gpu
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: hi-rag-gateway-gpu
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: deepresearch
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: supaserch
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: publisher-discord
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: mesh-agent
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: nats-echo-req
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: nats-echo-res
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: comfy-watcher
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: grayjay-plugin-host
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: agent-zero
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: archon
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: channel-monitor
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: pmoves-yt
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: notebook-sync
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: supabase_service_role_key
[WARN] No user directive
[WARN] No read_only directive
[WARN] No cap_drop: ["ALL"]
[WARN] No no-new-privileges
[WARN] No resource limits

[INFO] Validating: supabase_jwt_secret
[WARN] No user directive
[WARN] No read_only directive
[WARN] No cap_drop: ["ALL"]
[WARN] No no-new-privileges
[WARN] No resource limits

======================================
Summary: 108 passed, 37 warnings, 0 errors

@POWERFULMOVES
POWERFULMOVES merged commit 494a557 into main Jul 6, 2026
32 of 33 checks passed
@POWERFULMOVES
POWERFULMOVES deleted the fix/compose-mcp-token-canon branch July 6, 2026 21:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
pmoves/docker-compose.yml (1)

2651-2658: 🗄️ Data Integrity & Integration | 🔴 Critical | 🏗️ Heavy lift

Same override-vs-env_file conflict as docker-compose.agents.yml.

This is the same A0_SET_mcp_server_token=${MCP_SERVER_TOKEN:-} pattern that CANONICAL_NAMES.md §5 explicitly names as deprecated because the environment: entry always overrides the env_file:-supplied pin from env.tier-agent, silently emptying it when MCP_SERVER_TOKEN is unset in the shell. Since this is the canonical compose file (per the PR objective, this is the one the migration path in CANONICAL_NAMES.md was closing first), it should drop the environment: line entirely and rely on env_file passthrough, matching the fix proposed for docker-compose.agents.yml.

🛡️ Proposed fix
-    # A0_SET_mcp_server_token: soft default (CANONICAL_NAMES.md §5). The previous
-    # ${MCP_SERVER_TOKEN:?...} hard-require made *every* compose invocation on the
-    # shared file fail interpolation on nodes without the var — blocking bring-up
-    # of unrelated services (hit on Knuckles 2026-07-06). Use ${...:-} not :? —
-    # a pinned MCP_SERVER_TOKEN is STILL bridged to Agent Zero's setting (Codex
-    # `#1977`: AZ reads A0_SET_* not the plain env var, so the pin must be mapped);
-    # unset → empty, no hard-fail, Agent Zero auto-generates at startup.
-    - A0_SET_mcp_server_token=${MCP_SERVER_TOKEN:-}
+    # A0_SET_mcp_server_token is intentionally NOT set here (CANONICAL_NAMES.md §5).
+    # env_file: env.tier-agent supplies A0_SET_mcp_server_token when an operator
+    # has pinned a token; otherwise Agent Zero auto-generates one at startup.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pmoves/docker-compose.yml` around lines 2651 - 2658, The
A0_SET_mcp_server_token entry in the main compose service is still overriding
the value from env_file and can silently empty a pinned MCP_SERVER_TOKEN when
the shell variable is unset. Remove the environment: mapping for
A0_SET_mcp_server_token and let the existing env_file-provided token flow
through unchanged, matching the intended behavior for docker-compose.agents.yml
and the canonical compose path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pmoves/docker-compose.agents.yml`:
- Around line 88-95: The A0_SET_mcp_server_token entry in the compose service
environment is overriding env_file and can blank out the pinned token from
env.tier-agent when MCP_SERVER_TOKEN is unset. Remove this environment mapping
from the relevant service configuration so env.tier-agent remains the source of
truth, and keep the surrounding Agent Zero token handling in the compose setup
unchanged.

In `@pmoves/env.tier-agent.example`:
- Around line 77-84: The documented pinning contract for A0_SET_mcp_server_token
is being overridden by the compose configuration, so fix the compose files
rather than this env example. In docker-compose.agents.yml and
docker-compose.yml, remove the environment entry that sets
A0_SET_mcp_server_token from MCP_SERVER_TOKEN so the value from env.tier-agent
can persist when pinned, and only leave it unset for auto-generation behavior.

---

Duplicate comments:
In `@pmoves/docker-compose.yml`:
- Around line 2651-2658: The A0_SET_mcp_server_token entry in the main compose
service is still overriding the value from env_file and can silently empty a
pinned MCP_SERVER_TOKEN when the shell variable is unset. Remove the
environment: mapping for A0_SET_mcp_server_token and let the existing
env_file-provided token flow through unchanged, matching the intended behavior
for docker-compose.agents.yml and the canonical compose path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ee14ec3f-e6ea-4db5-8d03-f525747dc185

📥 Commits

Reviewing files that changed from the base of the PR and between 8294f2c and 7d872ac.

📒 Files selected for processing (3)
  • pmoves/docker-compose.agents.yml
  • pmoves/docker-compose.yml
  • pmoves/env.tier-agent.example

Comment on lines +88 to +95
# A0_SET_mcp_server_token: soft default (CANONICAL_NAMES.md §5). The previous
# ${MCP_SERVER_TOKEN:?...} hard-require made *every* compose invocation on the
# shared file fail interpolation on nodes without the var — blocking bring-up
# of unrelated services (hit on Knuckles 2026-07-06). Use ${...:-} not :? —
# a pinned MCP_SERVER_TOKEN is STILL bridged to Agent Zero's setting (Codex
# #1977: AZ reads A0_SET_* not the plain env var, so the pin must be mapped);
# unset → empty, no hard-fail, Agent Zero auto-generates at startup.
- A0_SET_mcp_server_token=${MCP_SERVER_TOKEN:-}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Remove A0_SET_mcp_server_token from environment:

environment: overrides env_file:, so A0_SET_mcp_server_token=${MCP_SERVER_TOKEN:-} will blank out any pinned value from env.tier-agent whenever MCP_SERVER_TOKEN is unset in the host shell. Let env.tier-agent supply it instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pmoves/docker-compose.agents.yml` around lines 88 - 95, The
A0_SET_mcp_server_token entry in the compose service environment is overriding
env_file and can blank out the pinned token from env.tier-agent when
MCP_SERVER_TOKEN is unset. Remove this environment mapping from the relevant
service configuration so env.tier-agent remains the source of truth, and keep
the surrounding Agent Zero token handling in the compose setup unchanged.

Comment on lines +77 to +84

# ---------------------------------------------------------------------------
# Agent Zero MCP server token (CANONICAL_NAMES.md §5)
# ---------------------------------------------------------------------------
# Canonical home for the MCP/a2a token. Compose intentionally does NOT set
# A0_SET_mcp_server_token in its env list — pin it here to make it durable,
# or leave unset and Agent Zero auto-generates one at startup.
# A0_SET_mcp_server_token=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Documentation itself is correct, but conflicts with actual compose behavior.

This documentation correctly states the canonical pinning contract — pin A0_SET_mcp_server_token in env.tier-agent, leave unset for auto-generation. However, as written, this is currently broken by docker-compose.agents.yml and docker-compose.yml, both of which still set A0_SET_mcp_server_token=${MCP_SERVER_TOKEN:-} under environment:, which overrides whatever value is pinned here when MCP_SERVER_TOKEN is unset in the shell (see comments on those files). No change needed here once the compose files are fixed to drop that environment: entry.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pmoves/env.tier-agent.example` around lines 77 - 84, The documented pinning
contract for A0_SET_mcp_server_token is being overridden by the compose
configuration, so fix the compose files rather than this env example. In
docker-compose.agents.yml and docker-compose.yml, remove the environment entry
that sets A0_SET_mcp_server_token from MCP_SERVER_TOKEN so the value from
env.tier-agent can persist when pinned, and only leave it unset for
auto-generation behavior.

POWERFULMOVES added a commit that referenced this pull request Jul 11, 2026
…_TOKEN (review P1)

Compose interpolation resolves from the project env (env.shared), not from
sibling environment: entries — so the added MCP_SERVER_TOKEN container env
never fed A0_SET_mcp_server_token, and A0 (which reads A0_SET_*, Codex #1977)
kept deriving a per-instance token. The A0_SET line now interpolates the
fleet-canonical AGENT_ZERO_MCP_TOKEN directly, with legacy MCP_SERVER_TOKEN
project-env as fallback and empty (derive-on-unset) when both are absent.
Split overlay regenerated. Known Road compose:issue:2056 (trail committed).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
POWERFULMOVES added a commit that referenced this pull request Jul 11, 2026
…OKEN) (#2057)

* feat(secrets): fleet-canonical Agent Zero MCP token (AGENT_ZERO_MCP_TOKEN)

GRAPHITI_MARK: B850-CLAUDE::A0-MCP-TOKEN-FLEET::2026-07-11

Closes #2056. Agent Zero derives its inbound-MCP token per instance when
MCP_SERVER_TOKEN is unset (stable sha256(runtime_id:user:pass), but
per-instance and silently rotates on credential/volume changes) — cross-node
callers need a declarative fleet credential. Operator minted
AGENT_ZERO_MCP_TOKEN into the Prod environment (name matches the existing
PMOVES-DoX mapping pattern).

- sync-secrets-local.yml: forward AGENT_ZERO_MCP_TOKEN
- compose: agent-zero gets MCP_SERVER_TOKEN=${AGENT_ZERO_MCP_TOKEN:-}
  (empty default preserves derive-on-unset; edited under Known Road
  compose:issue:2056, split overlay regenerated via make compose-split)
- secrets_funnel_populate: catalog row renamed to AGENT_ZERO_MCP_TOKEN
  (both spellings validate); 21/21 tests green
- checklist/receipt form: all 11 inventory keys now IN-GH-SECRETS, NEEDED=0

Remaining (operator/manifest lane, tracked in #2056): manifest_v2 projection
routing AGENT_ZERO_MCP_TOKEN into env.tier-agent.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(compose): interpolate A0_SET_mcp_server_token from AGENT_ZERO_MCP_TOKEN (review P1)

Compose interpolation resolves from the project env (env.shared), not from
sibling environment: entries — so the added MCP_SERVER_TOKEN container env
never fed A0_SET_mcp_server_token, and A0 (which reads A0_SET_*, Codex #1977)
kept deriving a per-instance token. The A0_SET line now interpolates the
fleet-canonical AGENT_ZERO_MCP_TOKEN directly, with legacy MCP_SERVER_TOKEN
project-env as fallback and empty (derive-on-unset) when both are absent.
Split overlay regenerated. Known Road compose:issue:2056 (trail committed).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant