Skip to main content
Glama

MCP ChatGPT Multi-Server Suite

by bobhuff0
test-mcp-server.shโ€ข3.79 kB
#!/bin/zsh # Colors for terminal output RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' CYAN='\033[0;36m' NC='\033[0m' # No Color echo "${CYAN}โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—${NC}" echo "${CYAN}โ•‘ MCP Server Testing Suite โ•‘${NC}" echo "${CYAN}โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•${NC}\n" echo "${BLUE}๐Ÿ” Testing MCP Server Implementation...${NC}\n" # Check if server is running if ! lsof -i :3000 | grep LISTEN > /dev/null; then echo "${RED}โŒ Server not running on port 3000${NC}" echo "${YELLOW}Start it with: ./start.sh${NC}\n" exit 1 fi echo "${GREEN}โœ… Server is running on port 3000${NC}\n" # Test 1: List Tools (GET) echo "${BLUE}๐Ÿ“‹ Test 1: List Available Tools${NC}" echo "${YELLOW}GET /mcp/tools/list${NC}" echo "" RESPONSE=$(curl -s http://localhost:3000/mcp/tools/list) if [ $? -eq 0 ]; then echo "${GREEN}โœ… Success!${NC}" echo "$RESPONSE" | jq . 2>/dev/null || echo "$RESPONSE" else echo "${RED}โŒ Failed to get tools list${NC}" fi echo "" # Test 2: Call Tool (POST) echo "${BLUE}๐Ÿ”ง Test 2: Call topMovers Tool${NC}" echo "${YELLOW}POST /mcp/tools/call${NC}" echo "" RESPONSE=$(curl -s -X POST http://localhost:3000/mcp/tools/call \ -H "Content-Type: application/json" \ -d '{"name":"topMovers","arguments":{"limit":3}}') if [ $? -eq 0 ]; then echo "${GREEN}โœ… Success!${NC}" echo "$RESPONSE" | jq . 2>/dev/null || echo "$RESPONSE" else echo "${RED}โŒ Failed to call tool${NC}" fi echo "" # Test 3: Frontend echo "${BLUE}๐ŸŒ Test 3: Frontend Access${NC}" echo "${YELLOW}GET /${NC}" echo "" RESPONSE=$(curl -s -I http://localhost:3000/ | head -1) if echo "$RESPONSE" | grep -q "200 OK"; then echo "${GREEN}โœ… Frontend accessible!${NC}" echo "${BLUE}Open: http://localhost:3000${NC}" else echo "${RED}โŒ Frontend not accessible${NC}" fi echo "" # Test 4: MCP Protocol (if available) echo "${BLUE}๐Ÿ”Œ Test 4: MCP Protocol Server${NC}" echo "${YELLOW}Testing stdio MCP server...${NC}" echo "" if [ -f "test-mcp-protocol.js" ]; then echo "${BLUE}Running MCP protocol test...${NC}" node test-mcp-protocol.js else echo "${YELLOW}โš ๏ธ MCP protocol test script not found${NC}" echo "${YELLOW} Run: node test-mcp-protocol.js${NC}" fi echo "" # Summary echo "${CYAN}โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—${NC}" echo "${CYAN}โ•‘ Test Summary โ•‘${NC}" echo "${CYAN}โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•${NC}\n" echo "${GREEN}โœ… Your server implements:${NC}" echo " ${BLUE}โ€ข Express REST API${NC} (for ChatGPT/web)" echo " ${BLUE}โ€ข MCP Protocol Server${NC} (for MCP clients)" echo " ${BLUE}โ€ข Beautiful Frontend${NC} (DaisyUI + Tailwind)" echo " ${BLUE}โ€ข Real-time Data${NC} (Alpha Vantage API)" echo "" echo "${YELLOW}๐Ÿ”— Available Endpoints:${NC}" echo " ${BLUE}GET /${NC} โ†’ Frontend UI" echo " ${BLUE}GET /mcp/tools/list${NC} โ†’ List MCP tools" echo " ${BLUE}POST /mcp/tools/call${NC} โ†’ Execute MCP tools" echo "" echo "${YELLOW}๐Ÿงช Test Commands:${NC}" echo " ${BLUE}curl http://localhost:3000/mcp/tools/list${NC}" echo " ${BLUE}curl -X POST http://localhost:3000/mcp/tools/call \\${NC}" echo " ${BLUE} -H 'Content-Type: application/json' \\${NC}" echo " ${BLUE} -d '{\"name\":\"topMovers\",\"arguments\":{\"limit\":3}}'${NC}" echo ""

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bobhuff0/MCPAddIn'

If you have feedback or need assistance with the MCP directory API, please join our Discord server