#!/bin/bash # Test script for the MCP remote proxy # This simulates how Claude Desktop would interact with the proxy set -e # Colors for output GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' # No Color # Configuration REMOTE_URL="${MCP_REMOTE_URL:-https://mcp.flipsidecrypto.xyz/beta/sse}" API_KEY="${FLIPSIDE_API_KEY}" DEBUG="${MCP_DEBUG:-true}" if [ -z "$API_KEY" ]; then echo "Error: FLIPSIDE_API_KEY environment variable is required" echo "Usage: FLIPSIDE_API_KEY=your_key ./test-proxy.sh" exit 1 fi echo -e "${BLUE}๐Ÿงช Testing MCP Remote Proxy${NC}" echo -e "${BLUE}Remote URL: ${REMOTE_URL}${NC}" echo -e "${BLUE}Debug Mode: ${DEBUG}${NC}" echo -e "${BLUE}API Key: ${API_KEY:0:8}...${NC}" echo "" # Build the proxy if it doesn't exist if [ ! -f "./remote-mcp-proxy" ]; then echo -e "${YELLOW}Building proxy binary...${NC}" go build -o remote-mcp-proxy . fi # Function to test a message test_message() { local message="$1" local description="$2" echo -e "${YELLOW}๐Ÿ“ค Testing: ${description}${NC}" echo -e "${BLUE}Message: ${message}${NC}" echo -e "${GREEN}Response (press Ctrl+C when done):${NC}" echo "" echo "$message" | MCP_REMOTE_URL="$REMOTE_URL" FLIPSIDE_API_KEY="$API_KEY" MCP_DEBUG="$DEBUG" ./remote-mcp-proxy echo "" echo -e "${BLUE}โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€${NC}" echo "" } echo -e "${GREEN}๐Ÿš€ Starting proxy tests...${NC}" echo "" # Test 1: Initialize echo "TEST 1: Initialize" read -p "Press Enter to continue or Ctrl+C to skip..." test_message '{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": { "name": "test-client", "version": "1.0.0" } } }' "Initialize" # Test 2: List Tools echo "TEST 2: List Tools" read -p "Press Enter to continue or Ctrl+C to skip..." test_message '{ "jsonrpc": "2.0", "id": 2, "method": "tools/list" }' "List Tools" echo -e "${GREEN}โœ… All tests completed!${NC}"