Skip to content

deploy: serve /mcp-beta on staging (set MCP_SERVE_BETA there) - #95

Merged
aterga merged 1 commit into
mainfrom
claude/serve-beta-on-staging
Jul 29, 2026
Merged

deploy: serve /mcp-beta on staging (set MCP_SERVE_BETA there)#95
aterga merged 1 commit into
mainfrom
claude/serve-beta-on-staging

Conversation

@aterga

@aterga aterga commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

PR #92 added the beta Internet Identity instance at /mcp-beta, gated behind $MCP_SERVE_BETA (off by default so production serves /mcp alone). But no deployment set that variable, so /mcp-beta was never mounted anywhere — including staging, where it's meant to live. Requests to https://mcp.beta.id.ai/mcp-beta therefore hit no route (nothing/404).

This wires MCP_SERVE_BETA on for the staging deployment only, so staging serves /mcp-beta (beta II) alongside /mcp (production II), while production keeps serving /mcp alone.

Related issues

Follows #92. No GitHub issue open.

Changes

  • deploy/native/imcp2.service: add Environment=MCP_SERVE_BETA=__MCP_SERVE_BETA__, substituted per environment at deploy time (mirrors the existing __PUBLIC_URL__ templating).
  • deploy/native/deploy.sh: substitute __MCP_SERVE_BETA__ from $MCP_SERVE_BETA (default empty).
  • .github/workflows/deploy-native.yml: set MCP_SERVE_BETA=1 in the Deploy step when inputs.environment == 'staging', empty otherwise. Staging (deploy.yml, push to main) turns it on; production (deploy-release.yml, release-* tags) leaves it off.
  • deploy/native/README.md: note that staging sets MCP_SERVE_BETA=1 and therefore serves /mcp-beta.

An empty value reads as off (the app's serve_beta() only treats 1/true/yes/on as truthy), so production's rendered unit line Environment=MCP_SERVE_BETA= is inert.

Notes

Testing

  • Verified the systemd unit renders Environment=MCP_SERVE_BETA=1 for staging and Environment=MCP_SERVE_BETA= (empty/off) for production, using the exact deploy.sh sed substitution with the variable exported as the workflow's env: provides it.
  • bash -n deploy/native/deploy.sh (syntax check) passes; no leftover __…__ placeholders in the rendered unit.
  • cargo build / cargo test — not applicable (deploy config only; no Rust changed).

Checklist

  • I have read the Contributing guidelines.
  • Docs (deploy README) updated for the change.
  • No secrets, credentials, or internal-only information are included.

Generated by Claude Code

PR #92 gated the beta II instance at /mcp-beta behind $MCP_SERVE_BETA (off by
default), but no deployment set it, so /mcp-beta was never mounted anywhere
(including staging). Wire it on for the staging environment only:

- imcp2.service: add Environment=MCP_SERVE_BETA=__MCP_SERVE_BETA__, substituted
  by deploy.sh per environment.
- deploy.sh: substitute __MCP_SERVE_BETA__ from $MCP_SERVE_BETA (default empty).
- deploy-native.yml: pass MCP_SERVE_BETA=1 when inputs.environment == staging,
  empty otherwise, so production keeps serving /mcp (production II) alone.

An empty value reads as off, so production's rendered unit is inert. Verified
the unit renders MCP_SERVE_BETA=1 for staging and empty for production, and
deploy.sh passes `bash -n`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014T9N8USDfNK5yzznPGg7Ym
@aterga
aterga requested a review from Copilot July 28, 2026 22:22
@aterga
aterga marked this pull request as ready for review July 28, 2026 22:23
@aterga
aterga requested a review from a team as a code owner July 28, 2026 22:23

Copilot AI 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.

Pull request overview

This PR updates the native deployment pipeline so the staging environment actually enables the previously-added /mcp-beta route by setting MCP_SERVE_BETA=1 for staging only, while leaving production behavior unchanged.

Changes:

  • Add an MCP_SERVE_BETA environment line to the systemd unit template and document the behavior.
  • Extend deploy.sh to substitute the __MCP_SERVE_BETA__ placeholder during unit rendering.
  • Configure the reusable GitHub Actions deploy workflow to set MCP_SERVE_BETA=1 only when deploying to staging.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
deploy/native/README.md Documents that staging enables /mcp-beta via MCP_SERVE_BETA=1, production leaves it off.
deploy/native/imcp2.service Adds templated Environment=MCP_SERVE_BETA=__MCP_SERVE_BETA__ to the unit.
deploy/native/deploy.sh Substitutes __MCP_SERVE_BETA__ from $MCP_SERVE_BETA (default empty) when rendering the unit.
.github/workflows/deploy-native.yml Sets MCP_SERVE_BETA to '1' for inputs.environment == 'staging', otherwise empty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aterga
aterga merged commit 48f1ed6 into main Jul 29, 2026
2 checks passed
@aterga aterga mentioned this pull request Jul 29, 2026
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.

3 participants