UNPKG

@skyramp/mcp

Version:

Skyramp MCP (Model Context Protocol) Server - AI-powered test generation and execution

49 lines (47 loc) 1.46 kB
import { z } from "zod"; import { SkyrampClient } from "@skyramp/skyramp"; import { logger } from "../utils/logger.js"; export function registerLoginTool(server) { server.registerTool("skyramp_login", { description: `Login to Skyramp platform Logging into Skyramp provides access to additional platform features and services. `, inputSchema: { prompt: z .string() .describe("The prompt user provided to login to Skyramp"), }, annotations: { keywords: ["login", "authenticate", "skyramp login"], }, }, async (params) => { logger.info("Logging in to Skyramp", { prompt: params.prompt, }); const client = new SkyrampClient(); try { const result = await client.login(); logger.info("Skyramp login successful"); return { content: [ { type: "text", text: result, }, ], }; } catch (error) { const errorMessage = `Login to Skyramp failed: ${error.message}`; return { content: [ { type: "text", text: errorMessage, }, ], isError: true, }; } }); }