Files
wehub-resource-sync 2cab53bc94
Docker Publish / Build and Push Docker Images (map[description:Skill Seekers CLI - Convert documentation to AI skills dockerfile:Dockerfile name:skill-seekers]) (push) Waiting to run
Docker Publish / Build and Push Docker Images (map[description:Skill Seekers MCP Server - 25 tools for AI assistants dockerfile:Dockerfile.mcp name:skill-seekers-mcp]) (push) Waiting to run
Docker Publish / Test Docker Images (push) Blocked by required conditions
Test Vector Database Adaptors / Test chroma Adaptor (push) Waiting to run
Test Vector Database Adaptors / Test faiss Adaptor (push) Waiting to run
Test Vector Database Adaptors / Test qdrant Adaptor (push) Waiting to run
Test Vector Database Adaptors / Test weaviate Adaptor (push) Waiting to run
Test Vector Database Adaptors / Test MCP Vector DB Tools (push) Waiting to run
Tests / Code Quality (Ruff & Mypy) (push) Waiting to run
Tests / Fast Unit Tests (parallel) (macos-latest, 3.11) (push) Waiting to run
Tests / Fast Unit Tests (parallel) (macos-latest, 3.12) (push) Waiting to run
Tests / Fast Unit Tests (parallel) (ubuntu-latest, 3.10) (push) Waiting to run
Tests / Fast Unit Tests (parallel) (ubuntu-latest, 3.11) (push) Waiting to run
Tests / Fast Unit Tests (parallel) (ubuntu-latest, 3.12) (push) Waiting to run
Tests / Tests (push) Blocked by required conditions
Tests / Serial / Integration / E2E Tests (push) Blocked by required conditions
Tests / MCP Server Tests (push) Blocked by required conditions
chore: import upstream snapshot with attribution
2026-07-13 12:46:28 +08:00

105 lines
2.8 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
"""
Manual test script for HTTP transport.
This script starts the MCP server in HTTP mode and tests the endpoints.
Usage:
python examples/test_http_server.py
"""
import asyncio
import subprocess
import sys
import time
import requests
async def test_http_server():
"""Test the HTTP server."""
print("=" * 60)
print("Testing Skill Seeker MCP Server - HTTP Transport")
print("=" * 60)
print()
# Start the server in the background
print("1. Starting HTTP server on port 8765...")
server_process = subprocess.Popen(
[
sys.executable,
"-m",
"skill_seekers.mcp.server_fastmcp",
"--http",
"--port",
"8765",
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)
# Wait for server to start
print("2. Waiting for server to start...")
time.sleep(3)
try:
# Test health endpoint
print("3. Testing health check endpoint...")
response = requests.get("http://127.0.0.1:8765/health", timeout=5)
if response.status_code == 200:
print(" ✓ Health check passed")
print(f" Response: {response.json()}")
else:
print(f" ✗ Health check failed: {response.status_code}")
return False
print()
print("4. Testing SSE endpoint availability...")
# Just check if the endpoint exists (full SSE testing requires MCP client)
try:
response = requests.get("http://127.0.0.1:8765/sse", timeout=5, stream=True)
print(f" ✓ SSE endpoint is available (status: {response.status_code})")
except Exception as e:
print(f" SSE endpoint response: {e}")
print(" (This is expected - full SSE testing requires MCP client)")
print()
print("=" * 60)
print("✓ All HTTP transport tests passed!")
print("=" * 60)
print()
print("Server Configuration for Claude Desktop:")
print("{")
print(' "mcpServers": {')
print(' "skill-seeker": {')
print(' "url": "http://127.0.0.1:8765/sse"')
print(" }")
print(" }")
print("}")
print()
return True
except Exception as e:
print(f"✗ Test failed: {e}")
import traceback
traceback.print_exc()
return False
finally:
# Stop the server
print("5. Stopping server...")
server_process.terminate()
try:
server_process.wait(timeout=5)
except subprocess.TimeoutExpired:
server_process.kill()
print(" ✓ Server stopped")
if __name__ == "__main__":
result = asyncio.run(test_http_server())
sys.exit(0 if result else 1)