#!/bin/bash # Test script to verify the Qwen Agent MCP Server is working echo "๐Ÿงช Testing Qwen Agent MCP Server..." # Check if server is running if ! curl -s http://localhost:8000/health > /dev/null 2>&1; then echo "โŒ Server is not running on localhost:8000" echo " Start it with: python server.py" exit 1 fi echo "โœ… Server is running" # Test health endpoint echo "" echo "๐Ÿ“Š Health Check:" curl -s http://localhost:8000/health | jq '.' # Test root endpoint echo "" echo "๐Ÿ“Š Capabilities:" curl -s http://localhost:8000/ | jq '.' # Test models endpoint echo "" echo "๐Ÿ“Š Available Models:" curl -s http://localhost:8000/v1/models | jq '.' # Test chat completion (non-streaming) echo "" echo "๐Ÿ“Š Testing Chat Completion (Simple):" curl -s http://localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "zdolny/qwen3-coder58k-tools:latest", "messages": [ {"role": "user", "content": "What is 2+2? Just give the answer."} ], "stream": false }' | jq '.choices[0].message.content' # Test with tool usage echo "" echo "๐Ÿ“Š Testing Chat with Tools (List Directory):" curl -s http://localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "zdolny/qwen3-coder58k-tools:latest", "messages": [ {"role": "user", "content": "List the files in the current directory using the list directory tool"} ], "stream": false }' | jq '.choices[0].message.content' # Test streaming echo "" echo "๐Ÿ“Š Testing Streaming:" curl -s -N http://localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "zdolny/qwen3-coder58k-tools:latest", "messages": [ {"role": "user", "content": "Count from 1 to 3"} ], "stream": true }' | head -n 20 echo "" echo "โœ… All tests completed!"