Skip to content

Forward --remote to setup agent in cli.new installer#918

Merged
codyde merged 2 commits into
masterfrom
cli-new-remote-flag
May 26, 2026
Merged

Forward --remote to setup agent in cli.new installer#918
codyde merged 2 commits into
masterfrom
cli-new-remote-flag

Conversation

@codyde
Copy link
Copy Markdown
Collaborator

@codyde codyde commented May 26, 2026

Summary

  • Adds a --remote flag to install.sh (served as cli.new).

  • When passed alongside --agents, the installer forwards --remote to railway setup agent, configuring the hosted MCP endpoint at mcp.railway.com instead of the local stdio server.

  • Lets users opt into remote MCP in a single one-liner that mirrors the existing local flow:

    # Local (existing)
    bash <(curl -fsSL cli.new) --agents -y
    
    # Remote (new)
    bash <(curl -fsSL cli.new) --agents --remote -y

The flag is only consumed when --agents is set, since that's the only path that invokes run_agent_setup / railway setup agent.

Why

The docs previously had to compose three commands for the remote case (cli.new -y && railway skills install && railway mcp install --remote), which skipped the login check and universal .agents directory that setup agent writes. This restores symmetry with the local install path.

Pairs with the upcoming Railway docs PR that switches the agent install command builder to emit the new one-liner.

Test plan

  • bash install.sh -h shows the new --remote flag in help output.
  • ./install.sh --agents --remote -y on a clean machine installs the CLI and runs railway setup agent --remote -y.
  • ./install.sh --remote (without --agents) is a no-op for MCP (matches help text constraint).
  • ./install.sh --agents -y (no --remote) still configures the local MCP server as before.

🤖 Generated with Claude Code

Lets users opt into the hosted MCP server in one command without a
follow-up `railway mcp install --remote`. Mirrors the existing --agents
one-liner for the local stdio case.

  bash <(curl -fsSL cli.new) --agents --remote -y

The flag is only consumed when --agents is also set, since that's the
only path that invokes `railway setup agent`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Warn when --remote is passed without --agents (silent no-op
  previously since run_agent_setup only fires under --agents).
- Refuse early when --remote is requested against a Homebrew-installed
  CLI older than the latest release. The existing brew path warns and
  continues with the old binary, which would then fail with an
  unrecognized-arg error from `setup agent --remote` after the
  installer already announced success.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codyde codyde added the release/minor Author minor release label May 26, 2026
@codyde codyde merged commit 651e1ca into master May 26, 2026
6 of 7 checks passed
@codyde codyde deleted the cli-new-remote-flag branch May 26, 2026 16:50
codyde added a commit to railwayapp/docs that referenced this pull request May 26, 2026
…1170)

* docs: consolidate MCP install onto one page with Local/Remote toggle

Merges /ai/remote-mcp-server into /ai/mcp-server behind a page-level
Local/Remote toggle. The per-editor sections now render the `railway`
command for local stdio and the `mcp.railway.com` URL for remote,
replacing the `npx @railway/mcp-server` recommendation throughout.

- New `<McpInstallGuide />` component owns the toggle and editor
  configs. Single-mode editors (Windsurf, Cline, Devin) show an inline
  "Switch to Remote" notice rather than a stale config.
- Cursor deeplink now points at the remote MCP server.
- `<AgentInstallCommand />` Agents+Remote now emits the symmetric
  one-liner `cli.new --agents --remote -y` (requires railwayapp/cli#918
  to be live for the new flag to be forwarded by the installer).
- Redirect /ai/remote-mcp-server -> /ai/mcp-server. Sidebar and hub
  pages collapse the two MCP entries into one.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Align MCP install guide with what `railway mcp install` writes

Three fixes after auditing the guide against railwayapp/cli master:

1. GitHub Copilot Remote: was pointed at VS Code's `settings.json`,
   which is a different product. The CLI's `copilot` slug writes to
   `~/.copilot/mcp-config.json` (GitHub Copilot CLI). Rewrote the
   Remote shape to match what `railway mcp install --agent copilot
   --remote` actually writes, and renamed the editor heading to
   "GitHub Copilot CLI" to remove the VS Code ambiguity.

2. Server name casing: `railway mcp install` writes the entry under
   the lowercase key `"railway"` and matches on that exact key for
   idempotency. Several Local configs in the guide used capitalized
   `"Railway"`, which would have caused the CLI to add a duplicate
   entry under `"railway"` on a subsequent install. Lowercased
   across Cursor, VS Code, and GitHub Copilot CLI.

3. Manual CLI add commands (`claude mcp add ...`, `codex mcp add ...`,
   `droid mcp add ...`) now name the server `railway` to match the
   `railway mcp install` output.

Also lowercased the Cursor one-click deeplink `name=` parameter for
the same display-consistency reason.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(mcp): lead with Quick Start before per-editor details

Reorder /ai/mcp-server so the page is actionable above the fold.
The opening section now mirrors /agents: a brief intro, the
local-vs-remote framing, and the <AgentInstallCommand /> one-liner
that installs the CLI, skills, and MCP in one go. Manual per-editor
configuration, MCP background, prerequisites, examples, and tools
move below for readers who need the detail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
codyde added a commit that referenced this pull request Jun 4, 2026
…-browser-login

* origin/master: (28 commits)
  chore: Release railwayapp version 5.0.0
  feat(sandbox): fork, templates, and `--variable`/`--env-file` on create (#933)
  chore: Release railwayapp version 4.68.0
  feat(volume): include modified time in files JSON (#931)
  chore: Release railwayapp version 4.67.0
  Add service source connection support (#934)
  chore: Release railwayapp version 4.66.2
  Make GraphQL HTTP timeout configurable via RAILWAY_HTTP_TIMEOUT (#932)
  chore: Release railwayapp version 4.66.1
  feat(volume): show status and scheduled deletion date in volume list (#928)
  SSH Command: Handle Identity Files (#926)
  chore: Release railwayapp version 4.66.0
  feat(sandbox): `railway sandbox` commands (create/list/ssh/exec/destroy) (#925)
  chore: Release railwayapp version 4.65.0
  SSH Agent Support, `russh` edition. (#915)
  chore: Release railwayapp version 4.64.0
  chore: Release railwayapp version 4.63.0
  Rephrase agent advisory and gate by CLI version (#919)
  Forward --remote to setup agent in cli.new installer (#918)
  chore: Release railwayapp version 4.62.0
  ...

# Conflicts:
#	src/consts.rs
#	src/util/mod.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/minor Author minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant