You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Routing**: `/mcp/{serverID}` (routed) or `/mcp` (unified)
35
36
-**Docker**: Launches MCP servers as containers
37
+
-**Validation**: Spec-compliant with fail-fast error handling
38
+
-**Variable Expansion**: `${VAR_NAME}` syntax for environment variables
36
39
37
40
## Config Examples
38
41
42
+
**Configuration Spec**: See **[MCP Gateway Configuration Reference](https://github.com/githubnext/gh-aw/blob/main/docs/src/content/docs/reference/mcp-gateway.md)** for complete specification.
Copy file name to clipboardExpand all lines: README.md
+82-6Lines changed: 82 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,21 @@ A gateway for Model Context Protocol (MCP) servers.
4
4
5
5
This gateway is used with [GitHub Agentic Workflows](https://github.com/githubnext/gh-aw) via the `sandbox.mcp` configuration to provide MCP server access to AI agents running in sandboxed environments.
6
6
7
+
📖 **[Full Configuration Specification](https://github.com/githubnext/gh-aw/blob/main/docs/src/content/docs/reference/mcp-gateway.md)** - Complete reference for all configuration options and validation rules.
8
+
7
9
## Features
8
10
9
11
-**Configuration Modes**: Supports both TOML files and JSON stdin configuration
12
+
-**Spec-Compliant Validation**: Fail-fast validation with detailed error messages
13
+
-**Variable Expansion**: Environment variable substitution with `${VAR_NAME}` syntax
14
+
-**Type Normalization**: Automatic conversion of legacy `"local"` type to `"stdio"`
10
15
-**Routing Modes**:
11
16
-**Routed**: Each backend server accessible at `/mcp/{serverID}`
12
17
-**Unified**: Single endpoint `/mcp` that routes to configured servers
13
18
-**Docker Support**: Launch backend MCP servers as Docker containers
14
19
-**Stdio Transport**: JSON-RPC 2.0 over stdin/stdout for MCP communication
20
+
-**Container Detection**: Automatic detection of containerized environments with security warnings
21
+
-**Enhanced Debugging**: Detailed error context and troubleshooting suggestions for command failures
For the complete JSON configuration specification with all validation rules, see the **[MCP Gateway Configuration Reference](https://github.com/githubnext/gh-aw/blob/main/docs/src/content/docs/reference/mcp-gateway.md)**.
**Environment Variable Passthrough**: Set the value to an empty string (`""`) to pass through the variable from the host environment.
87
+
#### Server Configuration Fields
88
+
89
+
-**`type`** (optional): Server transport type
90
+
-`"stdio"` - Standard input/output transport (default)
91
+
-`"http"` - HTTP transport (not yet implemented)
92
+
-`"local"` - Alias for `"stdio"` (backward compatibility)
93
+
94
+
-**`container`** (required for stdio): Docker container image (e.g., `"ghcr.io/github/github-mcp-server:latest"`)
95
+
- Automatically wraps as `docker run --rm -i <container>`
96
+
-**Note**: The `command` field is NOT supported per the specification
97
+
-**`entrypointArgs`** (optional): Arguments passed to container entrypoint
98
+
-**`env`** (optional): Environment variables
99
+
- Set to `""` (empty string) for passthrough from host environment
100
+
- Set to `"value"` for explicit value
101
+
- Use `"${VAR_NAME}"` for environment variable expansion (fails if undefined)
102
+
-**`url`** (required for http): HTTP endpoint URL for `type: "http"` servers
103
+
104
+
**Validation Rules:**
105
+
106
+
-**Stdio servers** must specify `container` (required)
107
+
-**HTTP servers** must specify `url` (required)
108
+
- Empty/"local" type automatically normalized to "stdio"
109
+
- Variable expansion with `${VAR_NAME}` fails fast on undefined variables
110
+
- All validation errors include JSONPath and helpful suggestions
111
+
-**The `command` field is not supported** - stdio servers must use `container`
112
+
113
+
See **[Configuration Specification](https://github.com/githubnext/gh-aw/blob/main/docs/src/content/docs/reference/mcp-gateway.md)** for complete validation rules.
114
+
115
+
#### Gateway Configuration Fields (Reserved)
116
+
117
+
-**`port`** (optional): Gateway HTTP port (default: from `--listen` flag)
118
+
- Valid range: 1-65535
119
+
-**`apiKey`** (optional): API key for authentication
120
+
-**`domain`** (optional): Domain name for the gateway
121
+
-**`startupTimeout`** (optional): Seconds to wait for backend startup (default: 30)
122
+
- Must be positive integer
123
+
-**`toolTimeout`** (optional): Seconds to wait for tool execution (default: 60)
124
+
- Must be positive integer
125
+
126
+
**Note**: Gateway configuration fields are validated and parsed but not yet fully implemented.
127
+
128
+
**Environment Variable Features**:
129
+
-**Passthrough**: Set value to empty string (`""`) to pass through from host
130
+
-**Expansion**: Use `${VAR_NAME}` syntax for dynamic substitution (fails if undefined)
0 commit comments