npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@holoscript/connector-railway

v1.0.0

Published

Railway MCP Connector for HoloScript Studio Integration Hub

Readme

@holoscript/connector-railway

Railway GraphQL API connector for the HoloScript Studio Integration Hub.

Overview

Wraps the Railway GraphQL API at https://backboard.railway.com/graphql/v2 as MCP tools with rate limit handling and exponential backoff. Auto-registers with the MCP orchestrator as the holoscript-railway server.

Installation

pnpm add @holoscript/connector-railway

Environment Variables

RAILWAY_API_TOKEN=your-railway-token-here

Get your token from: https://railway.com/account/tokens

Usage

import { RailwayConnector } from '@holoscript/connector-railway';

// Initialize and connect
const railway = new RailwayConnector();
await railway.connect();

// Check health
const healthy = await railway.health();

// List available tools
const tools = await railway.listTools();

// Execute a tool
const result = await railway.executeTool('railway_project_create', {
  name: 'my-holoscript-project'
});

// Clean up
await railway.disconnect();

Available Tools

railway_project_create

Create a new Railway project.

Parameters:

  • name (string, required): Project name
  • description (string, optional): Project description

Returns: Project object with id and name

railway_service_create

Create a service inside a Railway project.

Parameters:

  • projectId (string, required): Parent project ID
  • name (string, required): Service name

Returns: Service object with id and name

railway_deploy

Trigger a deployment for a service.

Parameters:

  • serviceId (string, required): Service ID to deploy
  • environmentId (string, required): Target environment ID

Returns: Deployment object with id

railway_variable_set

Set an environment variable for a service.

Parameters:

  • projectId (string, required): Project ID
  • environmentId (string, required): Environment ID
  • serviceId (string, required): Service ID
  • name (string, required): Variable name
  • value (string, required): Variable value

Returns: Success confirmation

railway_domain_add

Attach a custom domain to a service deployment.

Parameters:

  • serviceId (string, required): Service ID
  • environmentId (string, required): Environment ID
  • domain (string, required): Domain name (e.g., api.example.com)

Returns: Domain object with id

railway_deployment_status

Check the status of a specific deployment.

Parameters:

  • deploymentId (string, required): Deployment ID to check

Returns: Deployment object with id and status

Rate Limiting

The connector automatically handles Railway's rate limits:

  • Monitors X-RateLimit-Remaining header
  • Implements exponential backoff (1s, 2s, 4s)
  • Retries up to 3 times on rate limit errors
  • Throws error if all retries exhausted

MCP Orchestrator Registration

On connect(), the connector auto-registers with the MCP orchestrator at:

https://mcp-orchestrator-production-45f9.up.railway.app/register

Registration payload:

{
  "name": "holoscript-railway",
  "url": "http://localhost:0",
  "tools": [
    "railway_project_create",
    "railway_service_create",
    "railway_deploy",
    "railway_variable_set",
    "railway_domain_add",
    "railway_deployment_status"
  ]
}

Example: Deploy HoloScript MCP Server

import { RailwayConnector } from '@holoscript/connector-railway';

const railway = new RailwayConnector();
await railway.connect();

// 1. Create project
const project = await railway.executeTool('railway_project_create', {
  name: 'holoscript-mcp-production'
}) as any;

// 2. Create service
const service = await railway.executeTool('railway_service_create', {
  projectId: project.data.projectCreate.id,
  name: 'mcp-server'
}) as any;

// 3. Set environment variables
await railway.executeTool('railway_variable_set', {
  projectId: project.data.projectCreate.id,
  environmentId: 'production-env-id',
  serviceId: service.data.serviceCreate.id,
  name: 'MCP_API_KEY',
  value: 'dev-key-12345'
});

// 4. Trigger deployment
const deployment = await railway.executeTool('railway_deploy', {
  serviceId: service.data.serviceCreate.id,
  environmentId: 'production-env-id'
}) as any;

// 5. Poll deployment status
const status = await railway.executeTool('railway_deployment_status', {
  deploymentId: deployment.data.deploymentCreate.id
}) as any;

console.log('Deployment status:', status.data.deployment.status);

// 6. Add custom domain
await railway.executeTool('railway_domain_add', {
  serviceId: service.data.serviceCreate.id,
  environmentId: 'production-env-id',
  domain: 'mcp.holoscript.net'
});

await railway.disconnect();

Architecture

RailwayConnector extends ServiceConnector
├── connect()               Auto-auth + orchestrator registration
├── disconnect()            Cleanup
├── health()                Connection status check
├── listTools()             Enumerate 6 MCP tools
├── executeTool()           Route tool calls to GraphQL mutations/queries
└── executeGraphQLWithBackoff()  HTTP client with rate limit handling

Error Handling

try {
  await railway.executeTool('railway_project_create', { name: 'test' });
} catch (error) {
  if (error.message.includes('rate limit')) {
    // Rate limit exceeded after retries
  } else if (error.message.includes('not connected')) {
    // Must call connect() first
  } else {
    // Railway API error
  }
}

Testing

# Set test credentials
export RAILWAY_API_TOKEN=test-token

# Run tests
pnpm test

Links

  • Railway API: https://docs.railway.com/reference/public-api
  • Railway Dashboard: https://railway.com/dashboard
  • MCP Orchestrator: https://mcp-orchestrator-production-45f9.up.railway.app

License

MIT