// Test script to directly test the logic tool
import { spawn } from 'child_process';
const testRequest = {
jsonrpc: "2.0",
method: "tools/call",
params: {
name: "logic-thinking",
arguments: {
system: "propositional",
operation: "validate",
input: "P and Q",
format: "natural"
}
},
id: 1
};
console.log('Testing logic tool directly...\n');
const mcpServer = spawn('node', ['--max-old-space-size=4096', '--expose-gc', '--max-semi-space-size=64', './dist/index.js'], {
cwd: process.cwd(),
stdio: ['pipe', 'pipe', 'pipe']
});
mcpServer.stdout.on('data', (data) => {
console.log('Server response:');
console.log(data.toString());
});
mcpServer.stderr.on('data', (data) => {
console.error('Server error:', data.toString());
});
// Wait for server to start, then send request
setTimeout(() => {
console.log('Sending request:', JSON.stringify(testRequest, null, 2));
mcpServer.stdin.write(JSON.stringify(testRequest) + '\n');
setTimeout(() => {
console.log('Closing connection...');
mcpServer.kill('SIGINT');
process.exit(0);
}, 2000);
}, 1000);
mcpServer.on('close', (code) => {
console.log(`Server exited with code ${code}`);
});