Skip to content

docs: reconcile env-variable semantics and server config docs with implementation#5475

Merged
lpcox merged 2 commits into
mainfrom
copilot/fix-documentation-discrepancies
May 11, 2026
Merged

docs: reconcile env-variable semantics and server config docs with implementation#5475
lpcox merged 2 commits into
mainfrom
copilot/fix-documentation-discrepancies

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

Bug Fix

What was the bug?

Nightly reconciliation found multiple doc/implementation mismatches: MCP_GATEWAY_PORT/DOMAIN/API_KEY were documented as automatic config overrides (they are not), tool_response_filters was 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)

    • Updated MCP_GATEWAY_PORT, MCP_GATEWAY_DOMAIN, and MCP_GATEWAY_API_KEY descriptions to match actual runtime behavior (validation/container checks vs. automatic gateway field override).
    • Clarified MCP_GATEWAY_PORT vs plain PORT semantics in the note at the end of the environment variable section.
  • Missing server field documentation added (docs/CONFIGURATION.md)

    • Added tool_response_filters under server configuration fields.
    • Documented expected shape (map[toolName]jqExpression) and startup validation behavior for jq expressions.
  • Configuration example coverage expanded (config.example.toml)

    • Added commented examples for:
      • tool_response_filters
      • connect_timeout
      • per-server tool_timeout
      • rate_limit_threshold
      • rate_limit_cooldown
      • HTTP auth (github-oidc)
      • working_directory
      • registry
  • Contributor docs corrected (CONTRIBUTING.md)

    • Added missing direct dependency github.com/spf13/pflag.
    • Corrected project tree root label from awmg/ to gh-aw-mcpg/.

Testing

Docs-only change; no production logic changes.

# Example now documented in config.example.toml
[servers.github.tool_response_filters]
search_code = ".results[:20]"
get_file_contents = "{path: .path, sha: .sha}"

Copilot AI linked an issue May 11, 2026 that may be closed by this pull request
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
Copilot AI requested a review from lpcox May 11, 2026 14:05
Copilot finished work on behalf of lpcox May 11, 2026 14:05
@lpcox lpcox marked this pull request as ready for review May 11, 2026 14:39
Copilot AI review requested due to automatic review settings May 11, 2026 14:39
@lpcox lpcox merged commit 22a6707 into main May 11, 2026
13 checks passed
@lpcox lpcox deleted the copilot/fix-documentation-discrepancies branch May 11, 2026 14:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_filters in docs/CONFIGURATION.md (shape + startup validation behavior).
  • Expand config.example.toml with commented examples for additional server fields (filters, timeouts, rate limiting, auth, etc.).
  • Clarify env-var semantics in AGENTS.md and adjust contributor docs in CONTRIBUTING.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.sh uses plain PORT/HOST/MODE, but the script actually prefers MCP_GATEWAY_PORT when set (and container entrypoint uses MCP_GATEWAY_PORT as well). Updating the note to mention MCP_GATEWAY_PORT in 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

Comment thread AGENTS.md
- `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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📚 Documentation Reconciliation Report - 2026-05-10

3 participants