How to integrate Railway MCP with Codex

Connect Codex to Railway MCP. List recent failed railway deployments, redeploy production service on railway, and more using natural language, with authentication handled for you.

Railway logoRailway
Api KeyOauth2

Railway is a deployment platform for building, shipping, and scaling applications with managed infrastructure. It helps teams deploy faster with instant builds, automatic scaling, and simple project operations.

59 Tools

Introduction

Codex is one of the most popular coding harnesses out there. And MCP makes the experience even better. With Railway MCP integration, you can draft, triage, summarise emails, and much more, all without leaving the terminal or the app, whichever you prefer.

Also integrate Railway with

Why use Composio?

Apart from a managed and hosted MCP server, you will get:

  • CodeAct: A dedicated workbench that allows GPT to write its code to handle complex tool chaining. Reduces to-and-fro with LLMs for frequent tool calling.
  • Large tool responses: Handle them to minimise context rot.
  • Dynamic just-in-time access to 20,000 tools across 1500+ other Apps for cross-app workflows. It loads the tools you need, so GPTs aren't overwhelmed by tools you don't need.

How to install Railway MCP in Codex

Run the setup command

Run this command in your terminal to add the Composio MCP server to Codex.

Terminal

It will initiate the authentication in a browser window, authorize Codex to access your Composio account.

Composio authentication page

(Optional) Authenticate with OAuth

To authenticate manually, run the login command to open a browser window and authorize Codex to access your Composio account.

bash
codex mcp login composio

Verify the connection

Run codex mcp list to confirm Composio appears as a registered MCP server.

bash
codex mcp list

Codex App

Codex App follows the same approach as VS Code.

  1. Click ⚙️ on the bottom left → MCP Servers → + Add servers → Streamable HTTP:
  2. Fill the header and Key fields with { "x-consumer-api-key" = "ck_*******" }.
  3. The Key is the Composio API key, that you can find on dashboard.composio.dev
  4. Click on Authenticate and authorize Codex to your Composio account and you're all set.
Codex App MCP setup
  1. Restart and verify if it's there in .codex/config.toml
bash
[mcp_servers.composio]
url = "https://connect.composio.dev/mcp"
http_headers = { "x-consumer-api-key" = "ck_*******" }

What is the Railway MCP server, and what's possible with it?

The Railway MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Railway account. It provides structured and secure access to your projects, environments, services, deployments, logs, metrics, domains, and storage, so your agent can create infrastructure, deploy services, monitor performance, troubleshoot failures, and manage resources on your behalf.

  • Project and environment setup: Have your agent create projects, build or clone environments, review staged changes, and commit approved environment updates.
  • Service and deployment management: Let the agent create services from repositories, images, or templates, start deployments, check their status, cancel builds in progress, or remove completed deployments.
  • Logs and troubleshooting: Direct your agent to inspect build, runtime, and HTTP logs, collect deployment evidence, and review deployment details when something goes wrong.
  • Performance monitoring: Instruct your agent to examine HTTP traffic, response times, CPU, memory, disk, network, backup, and volume metrics for your Railway services.
  • Domains, networking, and storage: Have your agent create or remove domains, configure buckets and private networking, and create, attach, or delete persistent volumes.

Conclusion

You've successfully integrated Railway with Codex using Composio's MCP server. Now you can interact with Railway directly from your terminal, VS Code, or the Codex App using natural language commands.

Key benefits of this setup:

  • Seamless integration across CLI, VS Code, and standalone app
  • Natural language commands for Railway operations
  • Managed authentication through Composio
  • Access to 20,000+ tools across 1500+ apps for cross-app workflows
  • CodeAct workbench for complex tool chaining

Next steps:

  • Try asking Codex to perform various Railway operations
  • Explore cross-app workflows by connecting more toolkits
  • Build automation scripts that leverage Codex's AI capabilities
TOOLS

Supported Tools

Every Railway action and event your agent gets out of the box.

Cancel Deployment

Cancel a Railway deployment that is queued or building, preventing that in-progress deployment from completing.

Collect Deployment Evidence

Collect a bounded, best-effort Railway deployment evidence bundle from live-validated deployment, snapshot, event, service-instance, log, and metric sources.

Commit Environment Changes

Commit existing staged changes for a Railway environment, completing a staged STAGE_TEMPLATE or create-environment workflow.

Configure Buckets and Private Network

Commit an explicit Railway patch for bucket creation, updates, or deletion and the environment private-network enabled state.

Create Domain

Create either a generated railway.

Create Environment

Create an empty Railway environment or clone an existing environment, with explicit initial-deployment and change-staging behavior.

Create Plugin

Creates a new plugin in Railway for the specified project.

Create Project

Create a Railway project in an accessible workspace and return its project and default-environment IDs.

Create Service

Create an empty, repository-backed, image-backed, or template-backed service in a Railway project.

Create Volume

Create a persistent Railway volume and optionally attach it to one service and environment.

Delete Deployment

Permanently delete a completed Railway deployment from deployment history and stop any remaining project usage from it.

Delete Domain

Permanently delete one generated Railway domain or custom domain by ID after explicit confirmation.

Delete Environment

Permanently delete one Railway environment and its deployments.

Delete Variable

Delete a Railway environment variable.

Delete Volume

Permanently delete a persistent volume and all its associated data from Railway.

Delete workspace

Delete a Railway workspace and all data associated with it.

Deploy Service

Start a Railway deployment from a service's already connected repository or image source, optionally at a repository commit SHA, and return the deployment ID.

Deploy Template

Deploy a complete Railway template configuration into a new project or an existing project environment.

Disconnect Discord account

Disconnects the authenticated user's Railway account from Discord.

Get Build Logs

Return a bounded, optionally filtered time window of build-phase logs for one Railway deployment.

Get Deployment

Return one deployment's status, timestamps, metadata, and rollback eligibility.

Get Deployment Logs

Retrieve runtime logs for a deployment.

Get Environment

Get details of a specific Railway environment by its ID, including service instances and deployment information.

Get GitHub PR Info

Get information for a GitHub pull request associated with a Railway service.

Get HTTP Logs

Return a bounded date-anchor window of HTTP request logs for one deployment, including request, response, timing, and routing fields.

Get HTTP Metrics

Return either HTTP request counts grouped by status code or p50/p90/p95/p99 response-time series for one Railway service and environment.

Get Resource Metrics

Return sampled CPU, memory, disk, network, backup, or volume measurements for selected Railway resources and time range.

Get Template

Return a Railway template's ID, name, and serialized configuration required for deterministic deployment.

Get User Kickback Earnings

Get the total kickback earnings for the authenticated Railway user.

List API Tokens

Retrieve all API tokens for the authenticated user from Railway.

List Deployments

List one page of Railway deployments filtered by project, environment, service, status, or deletion state.

List Domains

List Railway and custom domains for a service, including IDs, ports, DNS records, certificate state, and custom-domain verification token.

List Environment Patches

Retrieve all patches for a Railway environment using the GraphQL API.

List Environments

List one page of project environments with IDs, pull-request metadata, source environment, and staged-change count.

List GitHub Repos

Retrieve a list of GitHub repositories that Railway has access to.

List GitHub Writable Scopes

Retrieve the list of GitHub scopes the user has installed the installation to.

List Integration Auths

Retrieve all integration auths for the authenticated user from Railway.

List Notification Deliveries

Retrieve notification deliveries for the authenticated user.

List Projects

List one page of projects in an accessible Railway workspace with project and workspace identifiers.

List Services

List one page of service IDs and names in a project for service, deployment, logs, metrics, domain, and volume tools.

List Railway Trusted Domains

Fetch all trusted domains for the authenticated Railway workspace.

List Variables

Return Railway shared-environment or service variables.

List Volumes

List one page of persistent volume IDs and names in a project for storage configuration and metrics workflows.

Redeploy Deployment

Create a new Railway deployment with the selected deployment's exact code and build/deploy configuration, optionally using its previous image tag.

Rename Environment

Rename one environment without changing or deploying its configuration.

Replace Variables

Replace the entire Railway shared-environment or service variable collection with the supplied complete map.

Restart Deployment

Restart a running or crashed Railway deployment by reusing its existing image without rebuilding or creating a deployment from newer source.

Retry Domain Certificate

Read the corrected Railway domainStatus object, then retry custom-domain certificate issuance only when Railway reports certificateRetryable=true.

Rollback Deployment

Restore a previous Railway deployment's Docker image and custom variables as the active deployment without rebuilding.

Search Templates

Search one cursor-controlled page of Railway templates by text, verification state, and category.

Stage Template

Create all resources from a complete Railway template configuration in a new project or an existing project environment, but leave the resulting changes staged.

Stop Deployment

Stop a currently running Railway deployment without deleting the service or its deployment-history record.

Update Domain

Update the hostname or target port of one generated Railway domain, or update the target port of one custom domain.

Update Project

Update project settings and configuration on Railway.

Update Service

Update a service's name or icon without changing environment-specific deployment settings.

Update Service Instance

Update build/deploy settings for a service in a specific environment on Railway.

Update Volume

Rename a Railway volume without changing any volume instance.

Update Volume Instance

Update a Railway volume's environment-specific mount path, attached service, or state.

Upsert Variables

Create or update a non-empty map of Railway shared-environment or service variables without deleting variables omitted from the submitted map.

FAQ

Frequently asked questions

With a standalone Railway MCP server, the agents and LLMs can only access a fixed set of Railway tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Railway and many other apps based on the task at hand, all through a single MCP endpoint.

Yes, you can. Codex fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Railway tools.

Yes, absolutely. You can configure which Railway scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Railway data and credentials are handled as safely as possible.

Start with Railway.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Railway tool your agent needs.Free to start.

Start building