Skip to main content
Glama

Puppeteer MCP Server

by merajmehrabi
MIT License
2,829
256
  • Apple
  • Linux
logger.ts1.31 kB
import winston from 'winston'; import 'winston-daily-rotate-file'; import path from 'path'; import fs from 'fs'; // Create logs directory if it doesn't exist const logsDir = path.join(process.cwd(), 'logs'); if (!fs.existsSync(logsDir)) { fs.mkdirSync(logsDir, { recursive: true }); } // Configure Winston logger export const logger = winston.createLogger({ level: 'debug', format: winston.format.combine( winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSS' }), winston.format.errors({ stack: true }), winston.format.splat(), winston.format.json() ), defaultMeta: { service: 'mcp-puppeteer' }, transports: [ // Write to rotating log files only to avoid interfering with MCP protocol new winston.transports.DailyRotateFile({ filename: path.join(logsDir, 'mcp-puppeteer-%DATE%.log'), datePattern: 'YYYY-MM-DD', zippedArchive: true, maxSize: '20m', maxFiles: '14d', format: winston.format.combine( winston.format.timestamp(), winston.format.json() ) }) ] }); // Log unhandled errors process.on('uncaughtException', (error) => { logger.error('Uncaught Exception:', error); process.exit(1); }); process.on('unhandledRejection', (error) => { logger.error('Unhandled Rejection:', error); });

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/merajmehrabi/puppeteer-mcp-server'

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