File size: 1,768 Bytes
3ed6d7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// test-mcp-local.js - Test MCP server locally
// This simulates what Claude would do

import { spawn } from 'child_process';
import readline from 'readline';

console.log('πŸš€ Starting MCP Server Test...\n');

// Start the MCP server
const mcp = spawn('node', ['mcp-server.js'], {
  env: {
    ...process.env,
    REUBENOS_URL: 'https://huggingface.co/spaces/MCP-1st-Birthday/Reuben_OS'
  }
});

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

// Handle MCP output
mcp.stderr.on('data', (data) => {
  console.log('MCP:', data.toString());
});

mcp.stdout.on('data', (data) => {
  console.log('MCP Output:', data.toString());
});

// Send test commands
async function testCommands() {
  const sessionId = 'session_1763722877048_527d6bb8b7473568';

  // Test manage_files tool
  const testFileCommand = {
    jsonrpc: '2.0',
    id: 1,
    method: 'tools/call',
    params: {
      name: 'manage_files',
      arguments: {
        sessionId: sessionId,
        action: 'save',
        fileName: 'test_from_mcp.txt',
        content: 'This is a test from the MCP server'
      }
    }
  };

  console.log('πŸ“ Testing file save...');
  console.log('Command:', JSON.stringify(testFileCommand, null, 2));

  // Note: This would need proper JSON-RPC communication
  // For now, this just shows what would be sent
}

console.log('πŸ“Œ Session ID for testing:', 'session_1763722877048_527d6bb8b7473568');
console.log('\nTo test manually:');
console.log('1. Restart Claude Desktop');
console.log('2. Tell Claude: "My session is session_1763722877048_527d6bb8b7473568"');
console.log('3. Ask Claude to save a file or deploy a quiz\n');

rl.question('Press Enter to exit...', () => {
  mcp.kill();
  rl.close();
});

testCommands();