|
|
| """
|
| 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__":
|
|
|
| print("[sse_server] Starting downstream discovery...", file=sys.stderr)
|
| asyncio.run(discover_downstream_tools())
|
|
|
|
|
| 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)
|
|
|
|
|
| print("[sse_server] Starting stdio server...", file=sys.stderr)
|
| mcp.run(transport="stdio")
|
|
|