-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-cursor-server.js
More file actions
41 lines (33 loc) · 985 Bytes
/
test-cursor-server.js
File metadata and controls
41 lines (33 loc) · 985 Bytes
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
33
34
35
36
37
38
39
40
41
// Simple test to verify the Cursor MCP server works
const { spawn } = require('child_process');
console.log('Testing Cursor MCP Server...');
const server = spawn('node', ['dist/examples/cursor-mcp-server.js'], {
stdio: ['pipe', 'pipe', 'pipe']
});
// Send initialize request
const initRequest = {
jsonrpc: '2.0',
id: 1,
method: 'initialize',
params: {
protocolVersion: '2024-11-05',
capabilities: {},
clientInfo: { name: 'test-client', version: '1.0.0' }
}
};
server.stdin.write(JSON.stringify(initRequest) + '\n');
server.stdout.on('data', (data) => {
console.log('Server response:', data.toString());
server.kill();
});
server.stderr.on('data', (data) => {
console.log('Server log:', data.toString());
});
server.on('close', (code) => {
console.log(`Server exited with code ${code}`);
});
// Kill after 3 seconds if no response
setTimeout(() => {
server.kill();
console.log('Test completed');
}, 3000);