UNPKG

@mseep/railway-mcp

Version:

Model Context Protocol server for Railway.app - Enables AI agents to manage Railway infrastructure through natural language

49 lines (48 loc) 1.61 kB
import { z } from 'zod'; import { createTool, formatToolDescription } from '../utils/tools.js'; import { railwayClient } from '../api/api-client.js'; export const configTools = [ createTool("configure_api_token", formatToolDescription({ type: 'UTILITY', description: "Configure the Railway API token for authentication (only needed if not set in environment variables)", bestFor: [ "Initial setup", "Token updates", "Authentication configuration" ], notFor: [ "Project configuration", "Service settings", "Environment variables" ], relations: { nextSteps: ["project_list", "service_list"], related: ["project_create"] } }), { token: z.string().describe("Railway API token (create one at https://railway.app/account/tokens)") }, async ({ token }) => { try { await railwayClient.setToken(token); return { content: [ { type: "text", text: `✅ Successfully connected to Railway API`, }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: `❌ Failed to connect to Railway API: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], }; } }) ];