Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the Railway MCP server

Vendor MCP
Open markdown

The Railway MCP connector routes your AI agent's tool calls to Railway's own MCP server through Scalekit. Each user signs in to Railway once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 78 tools.

Tools
78
What they doRead · write · destructive
38 · 14 · 2638 read14 write26 destructive
Users sign in with
OAuth app
Your own Railway MCP server app

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Railway MCP connection

    In AgentKit > Connections, create a Railway MCP connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    Railway MCP server connections use your own OAuth app. Register one with Railway MCP server and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the Railway MCP connection.

    Console steps with screenshots

    Create a Railway OAuth app so Scalekit can authorize access to your users’ Railway workspaces through the Railway MCP server. You register the Scalekit redirect URI in the app, then add the app’s client ID and secret to your Scalekit connection.

    1. Open Developer settings in Railway

      • Sign in to Railway and open Settings > Developer for your workspace.

      • Under OAuth Apps, click New OAuth App.

        Railway Developer settings page listing OAuth apps with the New OAuth App button

    2. Create the OAuth app

      • Enter a Name for the app, such as Scalekit.

      • Set Application Type to Web Application. Scalekit runs the OAuth flow on the server, where it can store the client secret.

      • Add a short Description, then save the app.

        Railway New OAuth App form with the name, Web Application type, and description fields

    3. Copy the redirect URI from Scalekit

      • In the Scalekit dashboard, go to AgentKit > Connections > Create Connection. Find Railway MCP and click Create.
      • Click Use your own credentials and copy the redirect URI. It looks like https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback.
    4. Add the redirect URI in Railway

      • Open your OAuth app in Railway and scroll to Redirect URIs.
      • Click Add Redirect URI, paste the URI you copied, and click Save changes. Railway requires an exact match.
    5. Copy the client ID and client secret

      • Under Client Credentials, copy the Client ID.

      • Under Client Secrets, click Add Secret and copy the new secret.

        Railway OAuth app page showing Redirect URIs, the Client ID, and the Client Secrets list

    6. Add credentials in Scalekit

      • Return to the connection you created in Scalekit and enter:
        • Client ID — the Client ID from Railway
        • Client Secret — the client secret from Railway
      • Select the scopes your tools need. Railway MCP supports openid, profile, email, offline_access, and workspace:member. Include offline_access so Scalekit can refresh tokens without asking the user to authorize again.
      • Click Save.
  5. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'railwaymcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Railway MCP:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'railwaymcp_whoami',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • railwaymcp_describe_environmentInventory of everything in a Railway environment — services, volumes, buckets, shared variable names — with staged changes applied.Read-only

    Describe environment

    Inventory of everything in a Railway environment — services, volumes, buckets, shared variable names — with staged changes applied. Each resource carries a `state`: live, staged-create (exists only in the pending patch), staged-delete, or live-with-staged-changes. Includes each service's source, regions, replicas, cron, volume mounts and latest deployment, and a `staged` summary of the pending patch. Pass `region` to keep only resources in that region. For per-field staged diffs use get-staged-changes; for one service's full config use describe-service; for runtime health use environment-status. If environmentId is omitted, the production environment is used.

    Inputs

    projectIdstringrequired
    The project ID
    environmentIdstring
    Environment to describe. Defaults to `production` if present, otherwise the project's oldest environment.
    regionstring
    Only return services deploying to, and volumes/buckets provisioned in, this region (e.g. us-west2, sjc).
  • railwaymcp_describe_serviceEverything about one service in an environment: its config with staged changes applied (source, build, deploy, networking, volume mounts), the per-field staged changes pending on it, mounted volumes, live domains and TCP proxies, the latest deployment, and its tracing state.Read-only

    Describe service

    Everything about one service in an environment: its config with staged changes applied (source, build, deploy, networking, volume mounts), the per-field staged changes pending on it, mounted volumes, live domains and TCP proxies, the latest deployment, and its tracing state. `state` says whether the service is live, staged-create, staged-delete, or live-with-staged-changes. Variable names are listed but values are not — use list-variables for values. If environmentId is omitted, the production environment is used.

    Inputs

    projectIdstringrequired
    The project ID
    serviceIdstringrequired
    The service ID
    environmentIdstring
    Environment ID. Defaults to `production` if present, otherwise the project's oldest environment.
  • railwaymcp_describe_templateRead one Railway template: its name, description, README, the services it creates, every env-var input it takes (which are required and which are optional), and — for clustered database templates like postgres-ha — the HA topology counts deploy-template can size.Read-only

    Describe template

    Read one Railway template: its name, description, README, the services it creates, every env-var input it takes (which are required and which are optional), and — for clustered database templates like postgres-ha — the HA topology counts deploy-template can size. Call this before deploy-template so required inputs are collected from the user rather than guessed.

    Inputs

    codestringrequired
    The template's code (the slug in its railway.com/template/<code> URL), e.g. 'postgres', 'postgres-ha', 'redis'.
  • railwaymcp_domain_statusGet detailed status for one domain on a service, by hostname, URL, or domain ID: required DNS records and whether they currently match, ownership verification, certificate status, and any certificate error.Read-only

    Domain status

    Get detailed status for one domain on a service, by hostname, URL, or domain ID: required DNS records and whether they currently match, ownership verification, certificate status, and any certificate error. Use list-domains first if you do not know which domains exist. If environmentId is omitted, the production environment is used.

    Inputs

    domainstringrequired
    Hostname, full URL, or domain ID. For example api.example.com, https://api.example.com, or the id from list-domains.
    projectIdstringrequired
    The project ID
    serviceIdstringrequired
    The service ID
    environmentIdstring
    Environment ID. Defaults to `production` if present, otherwise the project's oldest environment.
  • railwaymcp_environment_statusHealth overview of every service in an environment in one call: current LIVE (settled) deployment state, replica status, recent failures, unresolved warnings/criticals, and cron execution results.Read-only

    Environment status

    Health overview of every service in an environment in one call: current LIVE (settled) deployment state, replica status, recent failures, unresolved warnings/criticals, and cron execution results. Also includes `pendingWork`: the environment's pending (staged/applying) work that is not live yet — a staged patch or a commit still rolling out (poll until the operation leaves this list). By default only services with issues are returned — pass includeSuccessful to see everything. For error details, follow up with get-logs on the deployment IDs returned here.

    Inputs

    projectIdstringrequired
    The project ID
    environmentIdstring
    Environment to check. Defaults to the production environment.
    hoursBackinteger
    How many hours back to count failures (default 8)
    includeSuccessfulboolean
    Include healthy services too (default false: only services with issues)
    limitinteger
    Maximum services to return (default 10)
    serviceFilterstring
    Minimatch pattern to filter services by name — NOT fuzzy; wrap in wildcards for substring matching, e.g. "*api*". Omit for all services.
  • railwaymcp_fetch_docsFetch the full markdown content of a Railway documentation page by URL or slug (e.g.Read-only

    Fetch Railway docs page

    Fetch the full markdown content of a Railway documentation page by URL or slug (e.g. 'https://docs.railway.com/quick-start' or 'reference/variables'). Use search-docs first to find the right page.

    Inputs

    urlstringrequired
    Documentation page URL or slug from search-docs results
  • railwaymcp_get_bucket_credentialsGet the S3-compatible connection details for a bucket in an environment: endpoint, bucket name, region, URL style, access key and secret.Read-only

    Get bucket credentials

    Get the S3-compatible connection details for a bucket in an environment: endpoint, bucket name, region, URL style, access key and secret. With a Railway session or API token the access key and secret are returned in plaintext; connected OAuth apps receive the connection details only. Services in the same project should normally not copy these values but reference them as variables (${{BucketName.ENDPOINT}}, ${{BucketName.BUCKET}}, ${{BucketName.REGION}}, ${{BucketName.ACCESS_KEY_ID}}, ${{BucketName.SECRET_ACCESS_KEY}}), which also survive a credential reset. To rotate the credentials use reset-bucket-credentials. If environmentId is omitted, the production environment is used.

    Inputs

    bucketIdstringrequired
    The bucket ID
    projectIdstringrequired
    The project ID the bucket belongs to
    environmentIdstring
    Environment the bucket is provisioned in. Defaults to the production environment.
  • railwaymcp_get_cloud_agent_transcriptRead what a cloud agent session is doing: its messages, tool calls and short tool results, oldest first, including the turn in flight.Read-only

    Get cloud agent transcript

    Read what a cloud agent session is doing: its messages, tool calls and short tool results, oldest first, including the turn in flight. Every line names the cloud agent: these are its actions, not yours, so relay them as such. Pass since = the previous nextCursor to get only new activity. Pass waitSeconds to long-poll: the call returns as soon as the agent starts or finishes a tool, finishes a message or ends its turn. To follow a task started with run-cloud-agent-task (waitSeconds 0), call this back to back with waitSeconds 45 until the turn is finished. Also reports the agent's live preview URL (whatever it serves on port 8080). Never wakes the VM.

    Inputs

    cloudAgentIdstringrequired
    No description.
    sessionIdstringrequired
    No description.
    limitinteger
    Most events to return, newest kept. Default 60
    sincestring
    nextCursor from the previous call; omit for the whole session
    waitSecondsinteger
    Long-poll for new activity, up to 50s. Default 0 returns at once