gh-aw-mcpg AGENTS.md

A project guide for coding agents working on a Go-based MCP Gateway, a proxy that connects applications to MCP services. It lists common commands, project structure, and configuration examples.

In plain words
What is it for?
Use it when installing dependencies, building the gateway, running unit or integration tests, checking coverage, formatting code, linting, or starting the gateway with a configuration file.
Why use it?
It gives an agent the project-specific rules and commands needed to work consistently without guessing how to build, test, lint, or run the software.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/github/gh-aw-mcpg/agents-md
Clone the repo
git clone --depth 1 https://github.com/github/gh-aw-mcpg

Made for: Codex, OpenCode.

Per session 7,741 This file is loaded in full into every session.
When invoked 7,741 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.07741 $0.07741
Opus 5 $0.03870 $0.03870
Sonnet 5 $0.01548 $0.01548
Haiku 4.5 $0.00774 $0.00774

Measured yesterday against content hash 08e446b64b72, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gh-aw-mcpg AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 549 lines

How it starts

The opening of the file, as written. The whole thing — 549 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

Quick reference for AI agents working with MCP Gateway (Go-based MCP proxy server).

Quick Start

Install: make install (install toolchains and dependencies)
Build: make build (builds awmg binary)
Test: make test (run unit tests, no build required)
Test-Unit: make test-unit (run unit tests only)
Test-Integration: make test-integration (run binary integration tests, auto-builds binary if not present)
Test-All: make test-all (run both unit and integration tests; always builds the binary first)
Test-CI: make test-ci (unit tests with coverage and JSON output for CI)
Lint: make lint (runs go vet, gofmt checks, and golangci-lint)
Coverage: make coverage (unit tests with coverage report)
Format: make format (auto-format code with gofmt)
Clean: make clean (remove build artifacts)
Agent-Finished: make agent-finished (run format, build, lint, and all tests (unit, integration, Rust guard) - ALWAYS run before completion)
Run: ./awmg --config config.toml
Run sequentially: ./awmg --config config.toml --sequential-launch
Run with Custom Log Directory: ./awmg --config config.toml --log-dir /path/to/logs
Run with Custom Payload Directory: ./awmg --config config.toml --payload-dir /path/to/payloads

Project Structure

  • internal/auth/ - Authentication header parsing and middleware
  • internal/cmd/ - CLI (Cobra)
  • internal/config/ - Config parsing (TOML/JSON) with validation; the package is split across multiple files
    • config_core.go - Core Config, GatewayConfig, and ServerConfig types plus TOML loading
    • config_stdin.go - JSON stdin structs and stdin→internal config conversion
    • config_env.go, config_feature.go, config_tracing.go - Environment- and feature-specific config helpers
    • validation.go, validation_env.go, validation_schema.go - Fail-fast field, environment, and schema validation
    • validation_test.go - Comprehensive validation tests
  • internal/difc/ - Decentralized Information Flow Control
  • internal/envutil/ - Environment variable and Docker env-arg utilities
  • internal/githubhttp/ - GitHub API-specific HTTP helpers (auth headers, collaborator permission, rate-limit parsing)
  • internal/guard/ - Security guards (NoopGuard, WasmGuard, WriteSinkGuard)
  • internal/httputil/ - Generic HTTP helper utilities (server, proxy)
  • internal/jqutil/ - Shared gojq compiler options (security: $ENV access disabled)
  • internal/launcher/ - Backend process management
  • internal/logger/ - Debug logging framework (micro logger)
  • internal/mcp/ - MCP protocol types with enhanced error logging
  • internal/mcpresult/ - MCP result text content helpers
  • internal/middleware/ - HTTP middleware (jq schema processing)
  • internal/oidc/ - GitHub Actions OIDC token provider and caching
  • internal/proxy/ - Filtering HTTP proxy for the GitHub API with DIFC enforcement
  • internal/sanitize/ - Sensitive data redaction utilities (SanitizeString, SanitizeJSON, RedactSecret) for safe log output
  • internal/server/ - HTTP server (routed/unified modes)
  • internal/util/ - String, formatting, randomness, and JSON deep-clone utilities
  • internal/syncutil/ - Concurrency utilities
  • internal/sys/ - System utilities
  • internal/testutil/ - Test utilities and helpers
  • internal/tracing/ - OpenTelemetry tracing setup and OTLP export
  • internal/tty/ - Terminal detection utilities
  • internal/urlutil/ - URL hostname extraction utilities (used by guard and middleware for domain audit logging)
  • internal/version/ - Version management

Read the full file on GitHub · 549 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 549 lines · 7,741 tokens per session scan A 08e446b64b72

Subscribe to this mod's changes

gh-aw-mcpg AGENTS.md is an instructions file published in the GitHub repository github/gh-aw-mcpg (167 stars, last pushed yesterday), licensed MIT. It adds 7,741 tokens to every session, about $0.0387 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

buildNext

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

Instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,040 tokens

langchain AGENTS.md

Instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens