UNPKG

@pinkpixel/prysm-mcp

Version:

MCP server for the Prysm web scraper - enabling AI assistants to scrape web content

68 lines (56 loc) โ€ข 1.67 kB
#!/usr/bin/env node // Simple test script to verify the MCP server package import { spawn } from 'child_process'; import path from 'path'; console.log('๐Ÿงช Testing Prysm MCP Server'); // Run using npx (simulates how Cursor will run it) const npmPackage = '@pinkpixel/prysm-mcp@1.0.2'; console.log(`๐Ÿ“ฆ Running: npx -y ${npmPackage}`); const ps = spawn('npx', ['-y', npmPackage], { stdio: ['pipe', 'pipe', 'pipe'] }); // Capture output let stdout = ''; let stderr = ''; ps.stdout.on('data', (data) => { stdout += data.toString(); console.log(`๐Ÿ“ค STDOUT: ${data.toString().trim()}`); }); ps.stderr.on('data', (data) => { stderr += data.toString(); console.log(`๐Ÿ“ฅ STDERR: ${data.toString().trim()}`); }); // Handle process completion ps.on('exit', (code) => { if (code === 0) { console.log(`โœ… Process exited successfully`); } else { console.log(`โŒ Process exited with code ${code}`); } if (!stdout && !stderr) { console.log('โš ๏ธ No output captured from the process'); } }); // Send a test message after 2 seconds (simulating Cursor's behavior) setTimeout(() => { try { // Simple JSON-RPC 2.0 request to list tools const request = JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'tools/list', params: {} }); console.log(`๐Ÿ” Sending test message: ${request}`); ps.stdin.write(request + '\n'); } catch (err) { console.error('Error sending test message:', err); } }, 2000); // Kill the process after 5 seconds if it's still running setTimeout(() => { if (!ps.killed) { console.log('โฑ๏ธ Timeout reached, killing process'); ps.kill(); } }, 5000);