Skip to main content
Glama

BrowserStack MCP server

Official
utils.ts1.27 kB
import type { ApiResponse } from "../../lib/apiClient.js"; export interface LogResponse { logs?: any[]; message?: string; } export interface HarFile { log: { entries: HarEntry[]; }; } export interface HarEntry { startedDateTime: string; request: { method: string; url: string; queryString?: { name: string; value: string }[]; }; response: { status: number; statusText?: string; _error?: string; }; serverIPAddress?: string; time?: number; } export function validateLogResponse( response: Response | ApiResponse, logType: string, ): LogResponse | null { if (!response.ok) { if (response.status === 404) { return { message: `No ${logType} available for this session` }; } if (response.status === 401 || response.status === 403) { return { message: `Unable to access ${logType} - please check your credentials`, }; } return { message: `Unable to fetch ${logType} at this time` }; } return null; } export function filterLinesByKeywords( logText: string, keywords: string[], ): string[] { return logText .split(/\r?\n/) .map((line) => line.trim()) .filter((line) => keywords.some((keyword) => line.toLowerCase().includes(keyword)), ); }

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