Skip to main content
Glama
check-rc5-apikey.cjsโ€ข3.99 kB
#!/usr/bin/env node // Check what API key RC5 uses const { spawn } = require('child_process'); const path = require('path'); class RC5ApiKeyChecker { constructor() { this.serverProcess = null; this.messageId = 1; this.pendingRequests = new Map(); } async startRC5() { console.log('๐Ÿš€ Starting RC5...'); this.serverProcess = spawn('npx', ['tsx', 'src/index.ts'], { stdio: ['pipe', 'pipe', 'pipe'], cwd: '/tmp/release-candidate' }); this.serverProcess.stdout.on('data', (data) => { const lines = data.toString().split('\n').filter(line => line.trim()); lines.forEach(line => { try { const message = JSON.parse(line); this.handleMessage(message); } catch (e) { // Look for debug logs that might show API key info if (line.includes('apikey') || line.includes('API key') || line.includes('Authorization')) { console.log('๐Ÿ” RC5 Debug:', line); } } }); }); this.serverProcess.stderr.on('data', (data) => { const output = data.toString(); if (output.includes('Umbrella MCP Server started successfully')) { console.log('โœ… RC5 ready'); } // Look for any authentication debug info if (output.includes('apikey') || output.includes('API key') || output.includes('Authorization')) { console.log('๐Ÿ” RC5 Error Debug:', output); } }); await new Promise(resolve => setTimeout(resolve, 3000)); } handleMessage(message) { if (message.id && this.pendingRequests.has(message.id)) { const resolve = this.pendingRequests.get(message.id); this.pendingRequests.delete(message.id); resolve(message); } } async sendRequest(method, params) { const id = this.messageId++; const request = { jsonrpc: '2.0', id, method, params }; return new Promise((resolve, reject) => { this.pendingRequests.set(id, resolve); this.serverProcess.stdin.write(JSON.stringify(request) + '\n'); setTimeout(() => { if (this.pendingRequests.has(id)) { this.pendingRequests.delete(id); reject(new Error('Timeout')); } }, 15000); }); } async initialize() { await this.sendRequest('initialize', { protocolVersion: '2024-11-05', capabilities: {}, clientInfo: { name: 'api-key-checker', version: '1.0.0' } }); } async authenticate() { console.log('๐Ÿ” Authenticating RC5...'); const result = await this.sendRequest('tools/call', { name: 'authenticate_user', arguments: { username: 'david+saola@umbrellacost.com', password: 'Dsamsung1!' } }); const response = result.result?.content?.[0]?.text || ''; console.log('โœ… RC5 authenticated'); // Look for any API key info in the response if (response.includes('apikey') || response.includes('API key')) { console.log('๐Ÿ” Auth response contains API key info'); } return result; } async testUserInfo() { console.log('๐Ÿ“Š Getting user info from RC5...'); const result = await this.sendRequest('tools/call', { name: 'api___users', arguments: {} }); const response = result.result?.content?.[0]?.text || ''; console.log('Response preview:', response.substring(0, 500)); return result; } async disconnect() { if (this.serverProcess) { this.serverProcess.kill(); } } } async function checkRC5ApiKey() { const checker = new RC5ApiKeyChecker(); try { console.log('๐Ÿ” CHECKING RC5 API KEY USAGE'); console.log('โ•'.repeat(50)); await checker.startRC5(); await checker.initialize(); await checker.authenticate(); await checker.testUserInfo(); } catch (error) { console.error('โŒ Check failed:', error.message); } finally { await checker.disconnect(); } } checkRC5ApiKey();

Latest Blog Posts

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/daviddraiumbrella/invoice-monitoring'

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