mcp-gateway
mcp-gateway
mcp-gateway
The mcp-gateway command starts an HTTP/HTTPS server that bridges
Model Context Protocol (MCP) servers with
SignalWire SWAIG functions. It manages sessions, handles authentication, translates
between MCP tool calls and SWAIG format, and provides rate limiting and security headers.
Path to the JSON configuration file.
The gateway is configured via a JSON file. All settings support environment variable
substitution using ${VAR_NAME|default} syntax via
ConfigLoader.
Bind address for the gateway server.
Port for the gateway server.
Username for HTTP Basic Authentication on all protected endpoints.
Password for HTTP Basic Authentication.
Bearer token for token-based authentication. If set, clients can authenticate
with Authorization: Bearer <token> as an alternative to Basic Auth.
Each key in the services object defines an MCP server that the gateway can spawn and manage.
The command and arguments to start the MCP server process.
Human-readable description of the service.
Whether the service is active. Disabled services are not started or listed.
Sandbox configuration for process isolation. Controls resource limits and environment restrictions for the spawned MCP process.
Default session timeout in seconds. Sessions are cleaned up after this duration of inactivity.
Maximum concurrent sessions per MCP service.
Interval in seconds between session cleanup sweeps.
Default rate limits applied to all endpoints.
Rate limit for the tool listing endpoint.
Rate limit for tool call endpoints.
Rate limit for session deletion endpoints.
Storage backend for rate limit counters. Use memory:// for in-process
storage or a Redis URI for distributed deployments.
The gateway exposes the following HTTP endpoints:
If a certificate file exists at certs/server.pem, the gateway automatically
enables HTTPS. The gateway also uses
SecurityConfig
for security headers (X-Content-Type-Options, X-Frame-Options, HSTS, etc.).