@relayrail/server 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +51 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2199,6 +2199,57 @@ var HTTPTransport = class {
|
|
|
2199
2199
|
function createHTTPTransport(config) {
|
|
2200
2200
|
return new HTTPTransport(config);
|
|
2201
2201
|
}
|
|
2202
|
+
|
|
2203
|
+
// src/index.ts
|
|
2204
|
+
async function main() {
|
|
2205
|
+
const apiKey = process.env.RELAYRAIL_API_KEY;
|
|
2206
|
+
if (!apiKey) {
|
|
2207
|
+
console.error("Error: RELAYRAIL_API_KEY environment variable is required");
|
|
2208
|
+
console.error("");
|
|
2209
|
+
console.error("Get your API key from https://relayrail.dev/dashboard/agents");
|
|
2210
|
+
console.error("");
|
|
2211
|
+
console.error("Example MCP configuration:");
|
|
2212
|
+
console.error(JSON.stringify({
|
|
2213
|
+
mcpServers: {
|
|
2214
|
+
relayrail: {
|
|
2215
|
+
command: "npx",
|
|
2216
|
+
args: ["@relayrail/server"],
|
|
2217
|
+
env: {
|
|
2218
|
+
RELAYRAIL_API_KEY: "rr_your_api_key_here"
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
}, null, 2));
|
|
2223
|
+
process.exit(1);
|
|
2224
|
+
}
|
|
2225
|
+
const config = {
|
|
2226
|
+
supabaseUrl: process.env.SUPABASE_URL || process.env.NEXT_PUBLIC_SUPABASE_URL || "https://lcmdokppykqmigqcwnol.supabase.co",
|
|
2227
|
+
supabaseServiceRoleKey: process.env.SUPABASE_SERVICE_ROLE_KEY || "sb_secret_cj-1Y1KxjlapuwyXvfSKLA_xBJ0oS8i",
|
|
2228
|
+
baseUrl: process.env.RELAYRAIL_BASE_URL || "https://relayrail.dev",
|
|
2229
|
+
resendApiKey: process.env.RESEND_API_KEY,
|
|
2230
|
+
telnyxApiKey: process.env.TELNYX_API_KEY,
|
|
2231
|
+
telnyxPhoneNumber: process.env.TELNYX_PHONE_NUMBER
|
|
2232
|
+
};
|
|
2233
|
+
try {
|
|
2234
|
+
const server = createServer(config);
|
|
2235
|
+
const authenticated = await server.authenticate(apiKey);
|
|
2236
|
+
if (!authenticated) {
|
|
2237
|
+
console.error("Error: Invalid API key");
|
|
2238
|
+
console.error("");
|
|
2239
|
+
console.error("Please check your RELAYRAIL_API_KEY and try again.");
|
|
2240
|
+
console.error("Get a new API key from https://relayrail.dev/dashboard/agents");
|
|
2241
|
+
process.exit(1);
|
|
2242
|
+
}
|
|
2243
|
+
await server.start();
|
|
2244
|
+
} catch (error) {
|
|
2245
|
+
console.error("Failed to start RelayRail MCP server:", error);
|
|
2246
|
+
process.exit(1);
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
main().catch((error) => {
|
|
2250
|
+
console.error("Unexpected error:", error);
|
|
2251
|
+
process.exit(1);
|
|
2252
|
+
});
|
|
2202
2253
|
export {
|
|
2203
2254
|
HTTPTransport,
|
|
2204
2255
|
MCP_ERRORS,
|