test_manual.sh•815 B
#!/bin/bash
# Manual MCP Server Testing Script
# This sends raw JSON-RPC messages to the MCP server
echo "Testing MCP Server with manual JSON-RPC messages"
echo "================================================"
echo ""
# Start the MCP server and pipe commands to it
{
echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "manual-test", "version": "1.0"}}}'
sleep 1
echo '{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}'
sleep 1
echo '{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "add", "arguments": {"a": 10, "b": 5}}}'
sleep 1
echo '{"jsonrpc": "2.0", "id": 4, "method": "tools/call", "params": {"name": "subtract", "arguments": {"a": 20, "b": 8}}}'
} | uv run mcp_server.py