=== NEW SERVERS ADDED (7) === - servers/closebot — 119 tools, 14 modules, 4,656 lines TS (Stage 7) - servers/google-console — Google Search Console MCP (Stage 7) - servers/meta-ads — Meta/Facebook Ads MCP (Stage 8) - servers/twilio — Twilio communications MCP (Stage 8) - servers/competitor-research — Competitive intel MCP (Stage 6) - servers/n8n-apps — n8n workflow MCP apps (Stage 6) - servers/reonomy — Commercial real estate MCP (Stage 1) === FACTORY INFRASTRUCTURE ADDED === - infra/factory-tools — mcp-jest, mcp-validator, mcp-add, MCP Inspector - 60 test configs, 702 auto-generated test cases - All 30 servers score 100/100 protocol compliance - infra/command-center — Pipeline state, operator playbook, dashboard config - infra/factory-reviews — Automated eval reports === DOCS ADDED === - docs/MCP-FACTORY.md — Factory overview - docs/reports/ — 5 pipeline evaluation reports - docs/research/ — Browser MCP research === RULES ESTABLISHED === - CONTRIBUTING.md — All MCP work MUST go in this repo - README.md — Full inventory of 37 servers + infra docs - .gitignore — Updated for Python venvs TOTAL: 37 MCP servers + full factory pipeline in one repo. This is now the single source of truth for all MCP work.
69 lines
2.0 KiB
Python
69 lines
2.0 KiB
Python
# Copyright (c) 2025 Scott Wilcox
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""
|
|
HTTP Testing Utilities
|
|
|
|
Helper functions for testing MCP over HTTP transport.
|
|
"""
|
|
|
|
import socket
|
|
import time
|
|
from urllib.parse import urlparse
|
|
|
|
def check_server(url, timeout=5):
|
|
"""
|
|
Check if a server is accessible at the given URL.
|
|
|
|
Args:
|
|
url: The server URL to check
|
|
timeout: Connection timeout in seconds
|
|
|
|
Returns:
|
|
True if the server is accessible, False otherwise
|
|
"""
|
|
print(f"Checking if server at {url} is accessible...")
|
|
|
|
# Parse the URL
|
|
parsed_url = urlparse(url)
|
|
host = parsed_url.netloc.split(':')[0]
|
|
port = int(parsed_url.netloc.split(':')[1]) if ':' in parsed_url.netloc else 80
|
|
|
|
# Try to connect to the server
|
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
s.settimeout(timeout)
|
|
|
|
try:
|
|
s.connect((host, port))
|
|
print(f"Server at {host}:{port} is accessible.")
|
|
return True
|
|
except socket.error as e:
|
|
print(f"Failed to connect to server at {host}:{port}: {e}")
|
|
return False
|
|
finally:
|
|
s.close()
|
|
|
|
def wait_for_server(url, max_retries=3, retry_interval=2, timeout=5):
|
|
"""
|
|
Wait for a server to become accessible, retrying as specified.
|
|
|
|
Args:
|
|
url: The server URL to check
|
|
max_retries: Maximum number of retries before giving up
|
|
retry_interval: Seconds to wait between retries
|
|
timeout: Connection timeout in seconds
|
|
|
|
Returns:
|
|
True if the server became accessible, False otherwise
|
|
"""
|
|
retries = 0
|
|
while retries < max_retries:
|
|
if check_server(url, timeout):
|
|
return True
|
|
|
|
retries += 1
|
|
if retries < max_retries:
|
|
print(f"Retrying in {retry_interval} seconds... (attempt {retries+1}/{max_retries})")
|
|
time.sleep(retry_interval)
|
|
|
|
print(f"Failed to connect to server after {max_retries} attempts")
|
|
return False |