Conversation
Remove the custom MCP firewall proxy (src/mcp_firewall.rs), embedded tool metadata (src/mcp_metadata.rs, mcp-metadata.json), and all firewall tests. The copilot CLI no longer has built-in MCPs, so: - Replace BUILTIN_MCPS constant with is_custom_mcp() helper - Remove --disable-builtin-mcps, --disable-mcp-server, --mcp from copilot params - Remove mcp-firewall CLI subcommand - Simplify create wizard to MCP-level selection (no tool-level metadata) - Update 1ES compiler to use is_custom_mcp() check - Remove terminal_size dependency (only used by deleted MCP tool selector) All MCPs are now handled through the MCP Gateway (MCPG) instead of the custom firewall proxy. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add infrastructure for the gh-aw-mcpg gateway integration:
- Add MCPG_VERSION and MCPG_IMAGE constants in common.rs
- Add {{ mcpg_version }} and {{ mcpg_image }} template markers
- Replace generate_firewall_config() with generate_mcpg_config() that
produces MCPG-compatible JSON (mcpServers + gateway sections)
- SafeOutputs always included as HTTP backend via host.docker.internal
- Custom MCPs (with command:) become stdio servers in MCPG config
- Add host.docker.internal to CORE_ALLOWED_HOSTS for AWF container
to reach host-side MCPG
- Add mcp-http subcommand: serves SafeOutputs over HTTP using rmcp's
StreamableHttpService with axum, API key auth, and health endpoint
- Add axum and rmcp transport-streamable-http-server dependencies
- Remove terminal_size dependency (no longer used)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the legacy MCP firewall pipeline steps with MCPG architecture: - Replace 'Prepare MCP firewall config' with 'Prepare MCPG config' - Replace stdio MCP config (safeoutputs + mcp-firewall) with HTTP config pointing copilot to MCPG via host.docker.internal - Add 'Start SafeOutputs HTTP server' step (background process on host) - Add 'Start MCP Gateway (MCPG)' step (Docker container on host network) - Add 'Stop MCPG and SafeOutputs' cleanup step (condition: always) - Add --enable-host-access to AWF invocation for container-to-host access - Pre-pull MCPG Docker image alongside AWF images - Update step display names and comments Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add assertions for MCPG Docker image reference in compiled output - Add assertions for host.docker.internal and --enable-host-access - Add assertions verifying no legacy mcp-firewall references - Add template structure checks for mcpg_config, mcpg_image, mcpg_version markers - Verify template no longer contains mcp-firewall-config or MCP_FIREWALL_EOF - Update fixture test to not require built-in MCP assertions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Architecture replacement looks solid overall, but there are a few correctness bugs and security concerns worth addressing before merge. Findings🐛 Bugs / Logic Issues
🔒 Security Concerns
|
- Update architecture file tree (remove mcp_firewall.rs, mcp_metadata.rs, mcp-metadata.json)
- Replace {{ firewall_config }} marker docs with {{ mcpg_config }}
- Add {{ mcpg_version }} and {{ mcpg_image }} marker documentation
- Update {{ agency_params }} to remove MCP-related flags
- Replace mcp-firewall CLI docs with mcp-http subcommand
- Remove 'Built-in MCP Servers' section (no built-in MCPs exist)
- Simplify MCP Configuration to custom servers only
- Add host.docker.internal to allowed domains table
- Replace entire MCP Firewall section with MCP Gateway (MCPG) docs
- Update standalone target description for MCPG
- Update front matter example to remove built-in MCP references
- Add gh-aw-mcpg and gh-aw-firewall to References
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Always call generate_mcpg_config() regardless of mcp_servers being empty — safeoutputs must always be present in the MCPG config - Pre-initialize SafeOutputs outside the StreamableHttpService factory closure to avoid block_on() panic on a Tokio worker thread - Add failure guards to readiness wait loops in base.yml: both SafeOutputs and MCPG now fail the pipeline step explicitly if they don't become ready within 30 seconds Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Good architectural refactoring — needs a couple of security fixes before merge. The MCPG migration is clean and well-motivated. The removal of the custom MCP firewall layer in favour of the established gateway simplifies the stack significantly. The core logic is sound. Findings🔒 Security Concerns
🐛 Bugs / Logic Issues
|
- Move host.docker.internal from CORE_ALLOWED_HOSTS to standalone compiler's generate_allowed_domains — only pipelines using MCPG need host access from the AWF container - Replace weak time-based API key fallback with /dev/urandom (32 bytes); time-based value retained only as last-resort if urandom is unavailable - Remove SAFE_OUTPUTS_API_KEY println to avoid leaking the secret to log files; the pipeline already knows the key it generated - Add security comment explaining why Docker socket mount is required for MCPG (spawns stdio MCP servers as sibling containers) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Extract MCPG_PORT constant alongside MCPG_VERSION/MCPG_IMAGE to avoid hardcoded port 80 in generated config - Propagate MCPG config serialization error with ? instead of silently falling back to broken JSON missing the gateway section - Omit empty args array from MCPG config for cleaner output (consistent with existing env/tools handling) - Add warning in 1ES compiler when non-custom MCPs fall back to convention-based service connection names that may not exist Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Good architectural direction — replacing the in-process MCP firewall with MCPG is the right call. Two security issues need addressing before merge; everything else is clean. Findings🐛 Bugs / Logic Issues
🔒 Security Concerns
|
- Guard reserved 'safeoutputs' name in generate_mcpg_config to prevent user-defined MCPs from overwriting the safe outputs HTTP backend - Log MCPG config template before API key substitution to avoid leaking MCP_GATEWAY_API_KEY to pipeline logs (ADO secret masking only applies in subsequent steps, not the current step's output) - Clarify allowed_hosts.rs comment: host.docker.internal is always added for standalone pipelines (not conditionally) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Good architectural direction — the MCPG swap is clean and well-structured. A few reliability and security issues worth addressing before merge. Findings🐛 Bugs / Logic Issues
🔒 Security Concerns
|
- Use subtle::ConstantTimeEq for API key comparison to prevent timing side-channel attacks from a compromised AWF container - Fail loudly (panic) when /dev/urandom is unavailable instead of silently generating a weak time-based key - Add doc comment on SafeOutputs Clone confirming concurrent safety: only contains immutable PathBuf fields, file I/O opens fresh Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Pre-cleanup stale mcpg container before docker run to prevent retry failures when a previous run was interrupted (OOM/SIGKILL leaves container behind despite --rm) - Differentiate duplicate warning messages for MCPs without commands: options-but-no-command vs boolean-enabled (helps users understand migration path from removed built-in MCPs) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Architecture swap looks solid overall — clean removal of the MCP firewall in favour of MCPG. A few issues worth addressing before merge. Findings🐛 Bugs / Logic Issues
🔒 Security Concerns
|
- Replace panic! with anyhow bail via .context() for /dev/urandom failure — panics in async contexts crash the Tokio task instead of propagating cleanly through the Result chain - Bind to 127.0.0.1 instead of 0.0.0.0 — MCPG runs with --network host so localhost is sufficient, reducing exposure on shared agents Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- SafeOutputs URL in MCPG config changed from host.docker.internal to localhost — MCPG runs with --network host on Linux where host.docker.internal is not auto-injected in host network mode - Gateway domain remains host.docker.internal (used by AWF container which runs in bridge network mode with --enable-host-access) - Add docker rm -f pre-cleanup before MCPG container start to handle interrupted retry scenarios - Differentiate MCP warning messages for options-without-command vs boolean-enabled formats Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Overall a well-structured refactor — removes a significant amount of complexity by delegating MCP routing to MCPG. A few issues worth addressing before merge. Findings🐛 Bugs / Logic Issues
🔒 Security Concerns
|
MCPG enforces authentication on incoming client requests. The agent's mcp-config.json now includes an Authorization header with the gateway API key. To support this, the MCP_GATEWAY_API_KEY is generated in the 'Prepare MCPG config' step (as an ADO secret variable) instead of the 'Start MCP Gateway' step, making it available when writing both the MCPG server config and the agent's client config. Also updates MCPG startup step to reference the ADO variable via $(MCP_GATEWAY_API_KEY) instead of the shell-local variable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace Response::builder().unwrap() with IntoResponse tuple for the 401 response in auth middleware (avoids unwrap on user path) - Case-insensitive safeoutputs name reservation check to prevent collision via 'SafeOutputs' or 'SAFEOUTPUTS' variants - Fix typo: 'required' → 'require' in user-visible warning message Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Solid architectural migration from the custom MCP firewall to MCPG. A few issues worth addressing before merge. Findings🐛 Bugs / Logic Issues
🔒 Security Concerns
|
No description provided.