#!/usr/bin/env node
/**
* Debug server parameter processing for Saola
*/
const { spawn } = require('child_process');
async function debugServer() {
console.log('🔍 DEBUGGING SERVER PARAMETER PROCESSING\n');
console.log('=========================================\n');
// Start the MCP server with Saola credentials
const server = spawn('node', ['./dist/index.js'], {
env: {
...process.env,
UMBRELLA_USERNAME: 'david+saola@umbrellacost.com',
UMBRELLA_PASSWORD: 'Dsamsung1!'
}
});
let output = '';
server.stderr.on('data', (data) => {
const text = data.toString();
output += text;
// Look for specific debug messages
if (text.includes('TAX-EXCLUSION') ||
text.includes('excludeFilters') ||
text.includes('GROUPBY-DEFAULT') ||
text.includes('MSP-FRONTEND') ||
text.includes('customer_account_key')) {
console.log(text);
}
});
server.on('close', () => {
console.log('\n📋 FULL DEBUG OUTPUT:\n');
console.log(output);
});
// Send a get_costs request after a short delay
setTimeout(() => {
const request = {
jsonrpc: '2.0',
method: 'tools/call',
params: {
name: 'get_costs',
arguments: {
startDate: '2025-08-01',
endDate: '2025-08-31',
periodGranLevel: 'month',
groupBy: 'none'
}
},
id: 1
};
server.stdin.write(JSON.stringify(request) + '\n');
// Give it time to process then kill
setTimeout(() => {
server.kill();
}, 5000);
}, 2000);
}
debugServer().catch(console.error);