UNPKG

@mseep/railway-mcp

Version:

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

70 lines (69 loc) 1.92 kB
export class TcpProxyRepository { client; constructor(client) { this.client = client; } /** * Create a new TCP proxy for a service in an environment * @param input The creation parameters for the TCP proxy */ async tcpProxyCreate(input) { const query = ` mutation tcpProxyCreate($input: TCPProxyCreateInput!) { tcpProxyCreate(input: $input) { id applicationPort createdAt deletedAt domain environmentId proxyPort serviceId updatedAt } } `; const variables = { input }; const response = await this.client.request(query, variables); return response.tcpProxyCreate; } /** * Delete a TCP proxy by ID * @param id The ID of the TCP proxy to delete */ async tcpProxyDelete(id) { const query = ` mutation tcpProxyDelete($id: String!) { tcpProxyDelete(id: $id) } `; const variables = { id }; const response = await this.client.request(query, variables); return response.tcpProxyDelete; } /** * List all TCP proxies for a service in an environment * @param environmentId The environment ID * @param serviceId The service ID */ async listTcpProxies(environmentId, serviceId) { const query = ` query tcpProxies($environmentId: String!, $serviceId: String!) { tcpProxies(environmentId: $environmentId, serviceId: $serviceId) { id applicationPort createdAt deletedAt domain environmentId proxyPort serviceId updatedAt } } `; const variables = { environmentId, serviceId }; const response = await this.client.request(query, variables); return response.tcpProxies; } }