Skip to main content
Use Railway through Corsair: one client, typed API calls. Connect with a Railway token from railway.com/account/tokens: an account token reaches every workspace you are in, a workspace token one workspace. Both go out as Authorization: Bearer <token>. A project token (from a project’s settings) works with tokenKind: 'project' in the plugin options and reaches only that project’s environment.
  • One operation per GraphQL field. Every query and mutation of Railway’s public API (backboard.railway.com/graphql/v2) is an operation; its input is the field’s arguments, mostly an input object for mutations. The plugin sends a fixed document per operation that selects the result’s scalar and enum fields and the scalars of each nested object. Fields that need arguments, connections inside a result (a project’s services come from their own list operation) and fields API tokens can’t read (User.platformFeatureFlags) are left out.
  • Lists. Relay connections (projects, deployments, environments, …) take first/after (or last/before) and return { items, pageInfo }; pass pageInfo.endCursor as after for the next page. A few lists page their own way (cloudAgentTasks.list returns nextCursor and takes cursor): their output says which fields to use.
  • Errors. Railway answers most failures with HTTP 200 and a GraphQL errors list; the plugin raises them as RailwayGraphQLError with a status (403 for “Not Authorized”, 404 for a missing record, 429 for “too many requests” or “too quickly”, 400 otherwise). When the only errors are inside the result (an audit log entry whose project was deleted), the call succeeds and those nested fields come back null.
  • Risk. Queries are read. Deletes, deploys, redeploys, restarts, rollbacks, template and repo deploys, new services, environments, volumes, buckets, sandboxes and cloud agents (all use credits), tokens and credential resets, invitations (they send email), billing and usage limits, restores and transfers are destructive; other mutations are write.
  • Not wrapped: Railway’s CLI telemetry and login-session fields, its staff and careers fields, the dashboard’s landing and X-agent claim state, email change and second-factor/passkey setup (they need a person at the dashboard), and fields Railway marks deprecated. Railway’s project webhooks are not signed, so the plugin has no webhook handlers.
What you get:
  • 394 typed API operations

Setup

1

Install

2

Add the plugin

corsair.ts
With multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.
3

Choose authentication

4

Connect a tenant

Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.

Example API calls

List projects
Set a service variable
See the full list on the API page.

What’s next

API reference

Every railway.api.* operation with input and output types.

Connect / OAuth

createLink, Hub delivery, and tenant connect flows.

Use with agents

Expose this plugin’s operations as MCP tools.