test-ai-docs.mjs•889 B
#!/usr/bin/env node
// Simple test script to verify the AI docs functionality works
import { spawn } from 'child_process';
console.log('Testing the search_ember_ai_docs tool...');
// Start the MCP server
const mcpServer = spawn('node', ['dist/index.js'], {
stdio: ['pipe', 'pipe', 'pipe']
});
// Test message to search for Component
const testMessage = {
jsonrpc: '2.0',
id: 1,
method: 'tools/call',
params: {
name: 'search_ember_ai_docs',
arguments: {
query: 'Component',
apiType: 'classes'
}
}
};
mcpServer.stdin.write(JSON.stringify(testMessage) + '\n');
mcpServer.stdout.on('data', (data) => {
console.log('Response:', data.toString());
});
mcpServer.stderr.on('data', (data) => {
console.error('Error:', data.toString());
});
// Clean up after 5 seconds
setTimeout(() => {
mcpServer.kill();
console.log('Test completed');
}, 5000);