Skip to content

Commit 125f22a

Browse files
authored
Document payload directory configuration options (#702)
Nightly reconciliation identified 3 undocumented features for large payload storage. The code supported `--payload-dir` flag, `MCP_GATEWAY_PAYLOAD_DIR` env var, and `payload_dir` config option, but none were documented. ### Changes - **README.md CLI flags**: Added `--payload-dir` flag to usage section with default `/tmp/jq-payloads` - **README.md environment variables**: Added `MCP_GATEWAY_PAYLOAD_DIR` to optional variables table - **config.example.toml**: Documented `payload_dir` gateway option with session segmentation pattern All three methods configure the same directory where large tool response payloads are stored, organized as `{payload_dir}/{sessionID}/{queryID}/payload.json`. Implementation in `internal/cmd/flags_logging.go`, `internal/config/config_core.go`, and `internal/config/config_stdin.go` unchanged. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> ---- *This section details on the original issue you should resolve* <issue_title>📚 Documentation Reconciliation Report - 2026-02-05</issue_title> <issue_description>## Summary Found **3** discrepancies between documentation and implementation during nightly reconciliation check. - Date: 2026-02-05 - Branch: main - Status: Minor documentation gaps found ## Important Issues 🟡 Issues that are misleading but have workarounds: ### 1. Missing `--payload-dir` Flag in README Usage Section **Location:** README.md, line 214-226 (Usage section) **Problem:** The README's Usage section shows CLI flags but is missing the `--payload-dir` flag that actually exists in the codebase. **Actual Behavior:** The code defines `--payload-dir` flag in `internal/cmd/flags_logging.go`: ```````go cmd.Flags().StringVar(&payloadDir, "payload-dir", getDefaultPayloadDir(), "Directory for storing large payload files (segmented by session ID)") `````` **Impact:** Users reading the CLI help in the README won't know about the `--payload-dir` flag and may not discover this feature for managing large tool response payloads. **Suggested Fix:** Add the missing flag to the Usage section in README.md after line 220: `````` --payload-dir string Directory for storing large payload files (segmented by session ID) (default "/tmp/jq-payloads") ``````` **Code Reference:** `internal/cmd/flags_logging.go:26-27` ## Minor Issues 🔵 Small inconsistencies or missing details: ### 1. Missing `MCP_GATEWAY_PAYLOAD_DIR` Environment Variable Documentation **Location:** README.md, line 232-263 (Environment Variables section) **Problem:** The environment variable `MCP_GATEWAY_PAYLOAD_DIR` is not documented in the Environment Variables section, even though it's used in the code. **Actual Behavior:** The code checks for `MCP_GATEWAY_PAYLOAD_DIR` in `internal/cmd/flags_logging.go`: ``````go func getDefaultPayloadDir() string { if envPayloadDir := os.Getenv("MCP_GATEWAY_PAYLOAD_DIR"); envPayloadDir != "" { return envPayloadDir } return defaultPayloadDir } `````` **Impact:** Users won't know they can set this environment variable to customize the payload directory location, especially useful in containerized environments. **Suggested Fix:** Add to the "Optional (Non-Containerized Mode)" table in the Environment Variables section: ``````markdown | `MCP_GATEWAY_PAYLOAD_DIR` | Large payload storage directory (sets default for `--payload-dir` flag) | `/tmp/jq-payloads` | `````` **Code Reference:** `internal/cmd/flags_logging.go:40-46` ### 2. Quick Start payload_dir Configuration Not Mentioned **Location:** README.md, line 38-51 (Quick Start configuration example) **Problem:** The Quick Start configuration example doesn't show the optional `payload_dir` field in the gateway configuration, even though it's supported. **Actual Behavior:** The code supports `payload_dir` in both TOML and JSON configurations: - `internal/config/config_core.go`: `PayloadDir string` field in `GatewayConfig` - `internal/config/config_stdin.go`: `PayloadDir string` field in `StdinGatewayConfig` **Impact:** Users won't know they can configure the payload directory in their configuration files. **Suggested Fix:** Add a note or example showing the `payload_dir` field can be set in gateway configuration. Note: `config.example.toml` already documents this correctly, so this is just about the README examples. **Code Reference:** - `internal/config/config_core.go:56` - `internal/config/config_stdin.go:33` ## Documentation Completeness ### Missing Documentation - `--payload-dir` CLI flag - implemented but missing from Usage section - `MCP_GATEWAY_PAYLOAD_DIR` environment variable - implemented but not in Environment Variables table ### Accurate Sections ✅ The following sections were verified to be accurate and match the implementation: - ✅ Docker Quick Start section - verified accurate - ✅ TOML configuration format - verified accurate - ✅ JSON stdin format - verified accurate - ✅ Configuration validation rules - verified accurate - ✅ Variable expansion (`${VAR_NAME}`) - verified accurate - ✅ Schema normalization - verified accurate - ✅ Routing modes (routed/unified) - verified accurate - ✅ Docker support - verified accurate - ✅ All make targets in CONTRIBUTING.md - verified all exist and work - ✅ Prerequisites (Go 1.25.0) - matches go.mod - ✅ Binary name (awmg) - verified correct - ✅ Authentication (MCP spec 7.1) - verified accurate - ✅ All other documented environment variables - verified accurate ## Tested Commands All commands from CONTRIBUTING.md were verified against the Makefile: - ✅ `make build` - works as documented - ✅ `make test` / `make test-unit` - works as documented - ✅ `make test-integration` - works as documented - ✅ `make test-all` - works as documented - ✅ `make lint` - works as documented - ✅ `make coverage` - works as documented - ✅ `make install` - works as documented - ✅ `make format` - works as documented - ✅ `mak... </details> > **Custom agent used: agentic-workflows** > GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #701 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.
2 parents 0f6216e + db13c91 commit 125f22a

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ Flags:
218218
-h, --help help for awmg
219219
-l, --listen string HTTP server listen address (default "127.0.0.1:3000")
220220
--log-dir string Directory for log files (falls back to stdout if directory cannot be created) (default "/tmp/gh-aw/mcp-logs")
221+
--payload-dir string Directory for storing large payload files (segmented by session ID) (default "/tmp/jq-payloads")
221222
--routed Run in routed mode (each backend at /mcp/<server>)
222223
--sequential-launch Launch MCP servers sequentially during startup (parallel launch is default)
223224
--unified Run in unified mode (all backends at /mcp)
@@ -254,6 +255,7 @@ When running locally (`run.sh`), these variables are optional (warnings shown if
254255
| `HOST` | Gateway bind address | `0.0.0.0` |
255256
| `MODE` | Gateway mode flag | `--routed` |
256257
| `MCP_GATEWAY_LOG_DIR` | Log file directory (sets default for `--log-dir` flag) | `/tmp/gh-aw/mcp-logs` |
258+
| `MCP_GATEWAY_PAYLOAD_DIR` | Large payload storage directory (sets default for `--payload-dir` flag) | `/tmp/jq-payloads` |
257259

258260
### Docker Configuration
259261

config.example.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ startup_timeout = 60
2929
# How long to wait for a tool call to complete before timing out
3030
tool_timeout = 120
3131

32+
# Directory for storing large payload files (default: /tmp/jq-payloads)
33+
# Payloads are segmented by session ID: {payload_dir}/{sessionID}/{queryID}/payload.json
34+
# Can also be set via MCP_GATEWAY_PAYLOAD_DIR environment variable or --payload-dir flag
35+
# payload_dir = "/tmp/jq-payloads"
36+
3237
# ============================================================================
3338
# MCP Server Configurations
3439
# ============================================================================

0 commit comments

Comments
 (0)