-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathtest-client.js
More file actions
32 lines (28 loc) · 1.07 KB
/
Copy pathtest-client.js
File metadata and controls
32 lines (28 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
async function main() {
const transport = new StdioClientTransport({ command: 'node', args: ['build/index.js'] });
const client = new Client({ transport });
const request = {
name: 'vibe_check',
arguments: {
goal: 'Implement the core logic for the new feature',
plan: '1. Define the data structures. 2. Implement the main algorithm. 3. Add error handling.',
userPrompt: 'Create a new feature that does X, Y, and Z.',
progress: 'Just started',
uncertainties: ['The third-party API might be unreliable'],
taskContext: 'This is part of a larger project to refactor the billing module.',
sessionId: 'test-session-123',
},
};
try {
await client.connect();
const response = await client.callTool(request.name, request.arguments);
console.log(JSON.stringify(response, null, 2));
} catch (error) {
console.error(error);
} finally {
transport.destroy();
}
}
main();