Skip to main content
Glama

BrowserStack MCP server

Official
add-percy-snapshots.ts1.18 kB
import { storedPercyResults } from "../lib/inmemory-store.js"; import { updateFileAndStep } from "./percy-snapshot-utils/utils.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { percyWebSetupInstructions } from "../tools/sdk-utils/percy-web/handler.js"; export async function updateTestsWithPercyCommands(args: { index: number; }): Promise<CallToolResult> { const { index } = args; const stored = storedPercyResults.get(); if (!stored || !stored.testFiles) { throw new Error( `No test files found in memory. Please call listTestFiles first.`, ); } const fileStatusMap = stored.testFiles; const filePaths = Object.keys(fileStatusMap); if (index < 0 || index >= filePaths.length) { throw new Error( `Invalid index: ${index}. There are ${filePaths.length} files available.`, ); } const result = await updateFileAndStep( filePaths[index], index, filePaths.length, percyWebSetupInstructions, ); const updatedStored = { ...stored }; updatedStored.testFiles[filePaths[index]] = true; // true = updated storedPercyResults.set(updatedStored); return { content: result, }; }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/browserstack/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server