Repository navigation
Expand file tree
/
Copy pathtest-direct-tools.sh
More file actions
executable file
·55 lines (48 loc) · 1.78 KB
/
Copy pathtest-direct-tools.sh
File metadata and controls
executable file
·55 lines (48 loc) · 1.78 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
echo "Testing MCP Tools Directly in Pod"
echo "=================================="
# Test system_info
echo -e "\n1. Testing system_info:"
kubectl exec -n mcp-system deployment/mcp-dev-tools -- python3 -c "
import asyncio, json, sys
sys.path.insert(0, '/app')
from src.server import system_info
result = asyncio.run(system_info())
print('SUCCESS:', result[:100] + '...' if len(result) > 100 else result)
"
# Test execute_command
echo -e "\n2. Testing execute_command:"
kubectl exec -n mcp-system deployment/mcp-dev-tools -- python3 -c "
import asyncio, sys
sys.path.insert(0, '/app')
from src.server import execute_command
result = asyncio.run(execute_command('echo MCP Tools Working! && date', None))
print('SUCCESS:', result)
"
# Test file operations
echo -e "\n3. Testing file_operation (write):"
kubectl exec -n mcp-system deployment/mcp-dev-tools -- python3 -c "
import asyncio, sys
sys.path.insert(0, '/app')
from src.server import file_operation
result = asyncio.run(file_operation('write', 'demo.txt', 'This file created by MCP tools!', 'utf-8'))
print('SUCCESS:', result)
"
echo -e "\n4. Testing file_operation (read):"
kubectl exec -n mcp-system deployment/mcp-dev-tools -- python3 -c "
import asyncio, sys
sys.path.insert(0, '/app')
from src.server import file_operation
result = asyncio.run(file_operation('read', 'demo.txt', None, 'utf-8'))
print('SUCCESS:', result)
"
echo -e "\n5. Testing file_operation (list):"
kubectl exec -n mcp-system deployment/mcp-dev-tools -- python3 -c "
import asyncio, sys
sys.path.insert(0, '/app')
from src.server import file_operation
result = asyncio.run(file_operation('list', '/', None, 'utf-8'))
print('SUCCESS:', result[:200] + '...' if len(result) > 200 else result)
"
echo -e "\n=================================="
echo "All Direct Tests Complete!"