()
| 114 | } |
| 115 | |
| 116 | async function main() { |
| 117 | console.log('MCP Server Test Suite') |
| 118 | console.log(`Runtime ARN: ${RUNTIME_ARN}`) |
| 119 | console.log(`Region: ${REGION}`) |
| 120 | console.log('='.repeat(50) + '\n') |
| 121 | |
| 122 | // Step 1: Initialize |
| 123 | await testInitialize() |
| 124 | |
| 125 | // Step 2: Send initialized notification |
| 126 | const notifPayload = { jsonrpc: '2.0', method: 'notifications/initialized' } |
| 127 | const notifCommand = new InvokeAgentRuntimeCommand({ |
| 128 | agentRuntimeArn: RUNTIME_ARN, |
| 129 | qualifier: 'DEFAULT', |
| 130 | runtimeSessionId: sessionId, |
| 131 | payload: Buffer.from(JSON.stringify(notifPayload)), |
| 132 | contentType: 'application/json', |
| 133 | accept: 'application/json, text/event-stream', |
| 134 | }) |
| 135 | await client.send(notifCommand) |
| 136 | |
| 137 | // Step 3: List tools |
| 138 | await testListTools() |
| 139 | |
| 140 | // Step 4: Call each tool |
| 141 | await testCallTool('add', { a: 5, b: 3 }, 10) |
| 142 | await testCallTool('multiply', { a: 7, b: 6 }, 11) |
| 143 | await testCallTool('get_current_time', { timezone: 'UTC' }, 12) |
| 144 | await testCallTool('get_current_time', { timezone: 'America/New_York' }, 13) |
| 145 | |
| 146 | console.log('='.repeat(50)) |
| 147 | console.log('All tests completed!') |
| 148 | } |
| 149 | |
| 150 | main().catch((err) => { |
| 151 | console.error('Test failed:', err) |
no test coverage detected