run

View as MarkdownOpen in Claude

Start the gateway HTTP server. Blocks until a shutdown signal is received. Automatically detects an SSL certificate at certs/server.pem and enables HTTPS if found. Registers SIGTERM and SIGINT signal handlers for graceful shutdown.

Server host and port are read from the server.host and server.port keys in the configuration file (defaults to 0.0.0.0:8080).

Parameters

None.

Returns

None — This method blocks and does not return until the server is stopped.

Example

1from signalwire.mcp_gateway import MCPGateway
2
3gateway = MCPGateway("config.json")
4gateway.run()
5# Gateway is now listening on the configured host:port
6# Use curl or any HTTP client to interact:
7# curl -u admin:changeme http://localhost:8080/services