docs: reconcile env-variable semantics and server config docs with implementation#5475
Merged
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix discrepancies in documentation for environment variables
docs: reconcile env-variable semantics and server config docs with implementation
May 11, 2026
This was referenced May 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates documentation and examples to align gateway configuration semantics with the actual implementation, adding missing server config fields and correcting contributor guidance.
Changes:
- Document
tool_response_filtersindocs/CONFIGURATION.md(shape + startup validation behavior). - Expand
config.example.tomlwith commented examples for additional server fields (filters, timeouts, rate limiting, auth, etc.). - Clarify env-var semantics in
AGENTS.mdand adjust contributor docs inCONTRIBUTING.md.
Show a summary per file
| File | Description |
|---|---|
| docs/CONFIGURATION.md | Adds documentation for tool_response_filters under server configuration fields. |
| CONTRIBUTING.md | Corrects the project tree root label and adds github.com/spf13/pflag to the dependency list. |
| config.example.toml | Adds commented configuration examples for additional per-server fields (filters/timeouts/rate-limits/auth/registry/working_directory). |
| AGENTS.md | Updates env-var descriptions to reflect validation/container-check semantics rather than automatic config overrides. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
AGENTS.md:406
- This note says
run.shuses plainPORT/HOST/MODE, but the script actually prefersMCP_GATEWAY_PORTwhen set (and container entrypoint usesMCP_GATEWAY_PORTas well). Updating the note to mentionMCP_GATEWAY_PORTin the shell entrypoints would prevent confusion about which env var controls the bind port when running via scripts.
**Note:** `MCP_GATEWAY_PORT` is read by the `awmg` binary for environment validation (`--validate-env`) only. Plain `PORT`, `HOST`, and `MODE` are not read by `awmg` directly. However, `run.sh` uses `PORT`, `HOST` (default: `0.0.0.0`), and `MODE` (default: `--routed`) to set the bind address and routing mode. Use the `--listen` and `--routed`/`--unified` flags when running `awmg` directly.
- Files reviewed: 4/4 changed files
- Comments generated: 1
| - `MCP_GATEWAY_PORT` - Gateway listen port (overrides config `port` field; validated 1-65535) | ||
| - `MCP_GATEWAY_DOMAIN` - Gateway domain name (overrides config `domain` field) | ||
| - `MCP_GATEWAY_API_KEY` - Gateway API key (overrides config `api_key` field) | ||
| - `MCP_GATEWAY_PORT` - Used by environment validation (`--validate-env`) for container port-mapping checks (validated 1-65535); does not override the gateway listen address |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug Fix
What was the bug?
Nightly reconciliation found multiple doc/implementation mismatches:
MCP_GATEWAY_PORT/DOMAIN/API_KEYwere documented as automatic config overrides (they are not),tool_response_filterswas undocumented, and contributor/example docs were missing or inaccurate in a few high-impact spots.How did you fix it?
Environment variable behavior clarified (
AGENTS.md)MCP_GATEWAY_PORT,MCP_GATEWAY_DOMAIN, andMCP_GATEWAY_API_KEYdescriptions to match actual runtime behavior (validation/container checks vs. automatic gateway field override).MCP_GATEWAY_PORTvs plainPORTsemantics in the note at the end of the environment variable section.Missing server field documentation added (
docs/CONFIGURATION.md)tool_response_filtersunder server configuration fields.map[toolName]jqExpression) and startup validation behavior for jq expressions.Configuration example coverage expanded (
config.example.toml)tool_response_filtersconnect_timeouttool_timeoutrate_limit_thresholdrate_limit_cooldownauth(github-oidc)working_directoryregistryContributor docs corrected (
CONTRIBUTING.md)github.com/spf13/pflag.awmg/togh-aw-mcpg/.Testing
Docs-only change; no production logic changes.