Get rendered environment variables for a Railway service via the GraphQL API
domain: railway.com · 4 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗
Documented steps
Create a Railway API token (Account > Settings > Tokens) or use a workspace/project token; send it as the Authorization: Bearer header to the GraphQL endpoint https://backboard.railway.com/graphql/v2 with Content-Type: application/json
Run the query `query variables($projectId: String!, $environmentId: String!, $serviceId: String) { variables(projectId: $projectId, environmentId: $environmentId, serviceId: $serviceId) }` passing projectId, environmentId, and serviceId
Parse the response; the variables field returns an object mapping each variable name to its rendered (reference-resolved) value, e.g. {"DATABASE_URL":"postgres://...","NODE_ENV":"production"}
The token must have access to the project; workspace/project tokens scope data to their project
Known gotchas
The `me { name email }` introspection query only works with an account token, not workspace or project tokens
Give your agent this knowledge — and 16,500+ more routes
One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?