MCP Directory

Railway MCP Setup: CLI Login, OAuth, and Project Checks

Connect Railway MCP through the current Railway CLI or the official hosted endpoint, then verify your identity and target project before allowing infrastructure changes.

MCPtrove·October 7, 2026·6 min read
System with various wires managing access to centralized resource of server in data center
Photo by Brett Sayles on Pexels

Connect Railway MCP through the current Railway CLI or the official hosted endpoint, then verify your identity and target project before allowing infrastructure changes. A green connection indicator is only the beginning: the useful result is an assistant that can name the correct service and environment without deploying anything.

This guide covers the official connection, with documentation checked on October 7, 2026. The Railway directory entry currently describes a community implementation. Use it to identify that implementation, but do not mix its credentials or installation commands with the official route below.

Table of contents

Which Railway server should you connect?

Use Railway's current CLI integration or hosted MCP endpoint when you want the official implementation. An old tutorial that installs the standalone npm package may describe a different architecture, even if its screenshots and package name look familiar.

The archived official repository says that @railway/mcp-server is deprecated and now delegates to railway mcp. Its archive date is May 23, 2026. That is a practical migration signal, not evidence that Railway stopped supporting MCP.

Before editing your client configuration, inspect the existing server entry. Record its command, arguments, URL if present, and which project owns the configuration file. If two entries both appear as Railway, disable one while testing. Otherwise, a successful response could come from the implementation you intended to replace.

Keep the old configuration in version history without credentials. Once the new connection passes a read check, remove the redundant entry. Our preference is one clearly named connection per purpose; duplicate tool names make a deployment review harder than it needs to be.

How do you choose CLI login or OAuth?

Use the CLI connection if you already work locally with Railway, and direct OAuth if your client supports it and you want to avoid a local CLI dependency. Both choices still require the correct Railway identity; neither automatically establishes that your next action targets the right environment.

The current MCP documentation requires Railway CLI 5.44.0 or newer for the CLI connection and gives https://mcp.railway.com as the hosted endpoint. It also distinguishes a separate in-process local mode. Choose deliberately:

RouteWhat you configureWhat to verify
CLI connectionrailway with argument mcpCLI installation and login identity
Direct OAuthOfficial hosted URLBrowser account and authorized access
In-process local modeCurrent documented local commandNetwork constraints and its different tools

Do not infer execution location solely from a stdio configuration. A local process can forward requests to hosted infrastructure. Write down the selected route so a teammate can reproduce it without guessing from the client badge.

For direct OAuth, complete the browser authorization in the intended account. Review the access shown there before returning to your editor. An unexpected Workspace is a reason to correct the login, not to continue and hope a later project filter will compensate.

Team of developers working together on computers in a modern tech office.
Photo by cottonbro studio on Pexels

How do you add the CLI connection?

Verify the CLI installation and login first, then add one MCP entry using your client's expected configuration format. Testing these separately gives you a useful diagnosis if the editor cannot start the process.

Follow the Railway CLI installation guide for your operating system. In a terminal, check:

railway --version
railway login
railway whoami

For Cursor, the official MCP guide documents this configuration in .cursor/mcp.json:

{
  "mcpServers": {
    "railway": {
      "command": "railway",
      "args": ["mcp"]
    }
  }
}

Merge the entry into your existing object instead of replacing unrelated servers. The Cursor client guide explains the project versus global configuration distinction. Prefer a project configuration when the connection is only needed for that repository.

Use the configuration validator to catch malformed JSON before restarting or reloading the client. It cannot authenticate Railway or determine whether your account can see a project. Once the entry loads, inspect the discovered tools and retain ordinary action approval controls during the first session.

If the terminal works but the GUI editor reports a missing command, compare their executable search paths. Installing a second unrelated MCP package is unlikely to fix an editor that simply cannot locate the Railway executable.

What should the first project check prove?

The first check should identify the account, project, service, and intended environment without changing infrastructure. Ask for a small inventory you can compare with the Railway dashboard, rather than a broad instruction such as “set up my app.”

A useful first request is: “Identify my Railway account, list the projects I can access, and show the services in the project I select. Do not create, redeploy, change variables, or accept staged changes.” Inspect the tool actions as well as the final explanation.

Railway's environment documentation says projects start with a production environment and service changes are scoped to an environment. Therefore, “the project is correct” is insufficient. A staging service and its production counterpart can share a recognizable name while having very different consequences.

Keep this acceptance record:

  • The account and Workspace you intended to use.
  • The project identifier and recognizable project name.
  • The service identifier and environment you checked.
  • The read operation, its result, and the time you compared it with the dashboard.

Do not include variable values in the record. Ask the assistant to omit secrets from explanations and screenshots. Reading infrastructure metadata is enough to establish initial targeting; exporting environment files is unnecessary for this check.

How do you diagnose missing access?

Separate process startup, authentication, and project visibility before changing permissions. A missing executable is a local installation problem, while an absent project after successful authentication usually demands an account or scope check.

Use this order: confirm the configured route, inspect the client error, check the CLI or OAuth identity, and compare the accessible projects with the dashboard. Keep the failing operation and redacted error together so each retry tests a specific hypothesis.

The Railway MCP guide states that project tokens are not accepted by this server. Do not paste one into a configuration just because it worked in another Railway automation. Credential compatibility is determined by the endpoint, not by the brand printed on the token page.

Use Config Doctor for the configuration layer. If tools already appear and only one project fails, focus on that project's access rather than reinstalling the client. If a previously working login expires, reauthenticate through the selected route, then repeat the same narrow read check before resuming work.

When is the connection ready for deployment?

The connection is ready for a deployment workflow only after targeting is verified and the proposed change is concrete enough to review. MCP access alone does not establish that the code builds, the service is healthy, or the release can be reversed.

We recommend a short release brief: repository revision, project, environment, service, expected change, verification request, and rollback choice. Ask the assistant to identify what it will do before it runs a deployment tool. A request to “fix production” is too broad for an initial connection exercise.

Use an existing non-critical environment for the first authorized change where practical. Railway's environment guide describes isolation between configurations, but external dependencies still deserve attention: a staging variable can point at a production database if someone configured it that way.

After the change, compare the actual deployment and application behavior with the brief. Retain the revision and result in your normal release record. That makes the connection useful beyond its first successful demo: future work starts from a checked operational baseline.

FAQ

Is the old npm package still the recommended setup?

The archived official repository says the package is deprecated and delegates to the Railway CLI. Follow the current CLI or hosted connection documentation when creating a new configuration.

Does OAuth need the Railway CLI?

Direct OAuth uses the hosted endpoint and does not require the CLI. The CLI connection is a separate route that reuses your Railway login.

Can a project token authenticate this server?

The current official MCP documentation says project tokens are not accepted. Use the supported user authentication route rather than substituting a token from another workflow.

Is a connected server ready to deploy?

It is ready for verification. Confirm identity, target, permissions, and a reviewed change before deploying. Then check the resulting deployment and application behavior separately.

Put this into practice

Browse MCP servers by capability, or check your own setup's tool budget and security.

More in Integrations

Browse all integrations articles.