UNPKG

@skyramp/mcp

Version:

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

57 lines (49 loc) 2.77 kB
// src/prompts/skyrampPrompt.ts import { logger } from "../utils/logger.js"; export function registerStartTraceCollectionPrompt(mcpServer) { logger.info("registering start trace collection prompt"); mcpServer.registerPrompt("skyramp_trace_prompt", { description: "Skyramp trace collection prompt", argsSchema: {}, }, () => ({ messages: [ { role: "user", content: { type: "text", text: ` **General information about Skyramp's trace collection:** * You can start a Skyramp trace session to capture network traffic from an active terminal window and for activity within a browser. * Once you start a Skyramp trace session, you can stop it any time. Once stopped, a new session will be required to start a new trace collection. * Please refer to the Skyramp documentation at https://www.skyramp.dev/docs/concepts/trace-collection for more details on trace collection. * Once you have all the data call the start trace generation tool to start the trace collection. * Always ask user if they want to enable playwright for trace collection. **Playwright Configuration Options:** When playwright is enabled for trace collection, you can optionally configure: 1. **Playwright Storage Path** (playwrightStoragePath): - Path to a playwright session storage file containing authentication data (cookies, localStorage, sessionStorage, etc.) - MUST be an absolute path like /path/to/storage.json - Use this when you have manually created a session from the login flow and want to reuse it for future trace collections to avoid manual login every time - The session file should be created beforehand using Playwright's storageState feature during the login flow 2. **Playwright Viewport Size** (playwrightViewportSize): - Defines the browser window size for trace collection - Supported formats: * 'hd' - 1280x720 * 'full-hd' - 1920x1080 * '2k' - 2560x1440 * Custom: 'width,height' (e.g., '1920,1080') **Example usage prompt for trace collection:** * To start a trace collection session using agent, run the following command: Generate trace with default settings and include realworld.demo.com:8080 **Example usage prompt for trace collection for playwright trace:** * To start a playwright trace collection session using agent, run the following command: Start playwright trace collection with default settings. **Example usage prompt for trace collection with playwright storage and viewport:** * Start playwright trace collection with storage path /Users/dev/session-storage.json and viewport size full-hd **CRITICAL: NEVER SHOW THE CLI COMMANDS.** `, }, }, ], })); }