Skip to content

📚 Documentation Reconciliation Report - 2026-04-04 #3151

@github-actions

Description

@github-actions

Summary

Found 1 discrepancy between documentation and implementation during nightly reconciliation check.

Critical Issues 🔴

None.

Important Issues 🟡

None.

Minor Issues 🔵

1. MCP_GATEWAY_SESSION_TIMEOUT Environment Variable is Undocumented

Location: docs/ENVIRONMENT_VARIABLES.md (missing entry)
Problem: The MCP_GATEWAY_SESSION_TIMEOUT environment variable is used in the codebase to configure the session timeout for the unified mode HTTP transport, but it does not appear anywhere in the documentation.
Actual Behavior: When set, this env var overrides the default 2-hour session timeout for unified mode (/mcp endpoint). It accepts any Go duration string (e.g., 30m, 1h, 2h30m). Unified mode uses this value; routed mode has a hardcoded 30-minute timeout and is unaffected.
Impact: Users running in unified mode who need to tune session lifetime for either short-running tasks or very long-running workflows have no visibility into this knob. The variable is already tested in internal/envutil/envutil_test.go.
Suggested Fix: Add a row to the "Optional (Non-Containerized Mode)" table in docs/ENVIRONMENT_VARIABLES.md:

| `MCP_GATEWAY_SESSION_TIMEOUT` | Session timeout for unified mode (`/mcp`) stateful sessions. Accepts Go duration strings (e.g., `30m`, `1h`). Default is 2 hours to accommodate long-running agentic workflows. Routed mode is unaffected (hardcoded 30 min). | `2h` |

Code Reference: internal/server/transport.go:41

SessionTimeout: envutil.GetEnvDuration("MCP_GATEWAY_SESSION_TIMEOUT", 2*time.Hour),

Documentation Completeness

Missing Documentation

  • MCP_GATEWAY_SESSION_TIMEOUT is used in code (internal/server/transport.go) but not listed in docs/ENVIRONMENT_VARIABLES.md or AGENTS.md

Accurate Sections ✅

  • Docker quick start section — "apiKey", "mcpServers", "type", "container", "env" fields all match StdinGatewayConfig/StdinServerConfig JSON struct tags
  • TOML format (config.example.toml) — field names (api_key, port, domain, startup_timeout, tool_timeout, command, args) match GatewayConfig/ServerConfig TOML struct tags
  • Environment variables MCP_GATEWAY_PORT, MCP_GATEWAY_DOMAIN, MCP_GATEWAY_API_KEY — all present and used in internal/config/config_env.go and internal/config/validation_env.go
  • Go version requirement (1.25.0) matches go.mod
  • All documented make targets exist in Makefile: build, test, test-unit, test-integration, test-all, lint, coverage, install, format, clean, release, agent-finished
  • Binary name awmg matches Makefile BINARY_NAME
  • Default port 3000 for direct binary (--listen 127.0.0.1:3000) and 8000 for run.sh default are both accurate
  • --config-stdin flag, --log-dir, --env, -v, --payload-dir, --payload-size-threshold — all registered in internal/cmd/flags_*.go
  • Project structure in CONTRIBUTING.md — all directories exist under internal/
  • JSON stdin command field correctly omitted (only TOML supports it)
  • DOCKER_API_VERSION fallback to 1.44 for all architectures matches run.sh

Tested Commands

  • make --dry-run build — matches: go build -o awmg .
  • make --dry-run test — alias for test-unit
  • make --dry-run test-unitgo test -v ./internal/...
  • make --dry-run test-integration — auto-builds if needed, then go test -v ./test/integration/...
  • make --dry-run test-all — builds then go test -v ./...
  • make --dry-run lintgo vet, gofmt, golangci-lint
  • make --dry-run coveragego test -coverprofile
  • make --dry-run install — checks Go/golangci-lint, runs go mod download && verify
  • ⚠️ make build — could not execute (Go 1.25.0 toolchain download blocked in sandbox); documented targets are structurally correct

Recommendations

Immediate Actions Required:

  1. Add MCP_GATEWAY_SESSION_TIMEOUT to docs/ENVIRONMENT_VARIABLES.md (see suggested fix above)
  2. Consider adding MCP_GATEWAY_SESSION_TIMEOUT to the AGENTS.md environment variables table for completeness

Nice to Have:

  1. The routed.go 30-minute hardcoded session timeout (routedSessionTimeout) could also be mentioned in documentation, as it is not configurable and differs from unified mode's configurable 2-hour default.

Code References

  • Session timeout: internal/server/transport.go:41
  • Routed mode hardcoded timeout: internal/server/routed.go:102
  • Env var utility: internal/envutil/envutil.go:35 (GetEnvDuration)
  • Env var test: internal/envutil/envutil_test.go:115 (tests MCP_GATEWAY_SESSION_TIMEOUT)
  • Documented env vars: docs/ENVIRONMENT_VARIABLES.md

Generated by Nightly Documentation Reconciler ·

  • expires on Apr 7, 2026, 3:43 AM UTC

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions