yuki-sui's picture
Upload 169 files
ed71b0e verified
#!/usr/bin/env python3
"""
Stdio-based MCP server for Claude Desktop integration.
Wraps the security gateway with stdio transport.
"""
import asyncio
import sys
from security_gateway.downstream_autodiscovery import discover_downstream_tools, DISCOVERED_TOOLS
from security_gateway.server import mcp
if __name__ == "__main__":
# Run discovery before starting the server
print("[sse_server] Starting downstream discovery...", file=sys.stderr)
asyncio.run(discover_downstream_tools())
# Log what was discovered
print(f"[sse_server] Discovery complete. Found {len(DISCOVERED_TOOLS)} servers:", file=sys.stderr)
for server_key, tools in DISCOVERED_TOOLS.items():
print(f" - {server_key}: {list(tools.keys())}", file=sys.stderr)
if not DISCOVERED_TOOLS:
print("[sse_server] WARNING: No downstream tools discovered!", file=sys.stderr)
# Start stdio server for Claude Desktop
print("[sse_server] Starting stdio server...", file=sys.stderr)
mcp.run(transport="stdio")