Skip to content

Implement the decided MCP URL policy #112

Closed

Description

@tonibergholm

Question

Apply whatever the "Decide the MCP URL policy" ticket settles (HTTPS rules, allowlist shape) to the MCP fingerprinting config path in crates/agenticd/src/mcp.rs and its config surface. If the decision calls for an ADR, write and land the ADR first, then implement.

Scope:

  • Enforce the decided policy at config-load and/or request time, with typed errors.
  • Regression tests: disallowed scheme rejected, non-allowlisted URL rejected (per the decided policy), loopback exception honored if decided.
  • Ensure the demo's local MCP fingerprinting still works under the new policy.

Blocked by the URL-policy decision ticket.

Resolution records: PR link (and ADR link if one was written), test names.

Activity

  1. added
    ready-for-agentScoped and unambiguous enough for an agent to pick up
    wayfinder:taskWayfinder ticket: work that unblocks a decision or lands a fix
    on Jul 9, 2026
  2. tonibergholm commented on Jul 9, 2026

    @tonibergholm
    MemberAuthor

    Scope from the resolved decision ticket (#108): implement the three-part policy — (1) startup rejection of non-loopback http:// MCP URLs, typed error, no escape hatch; (2) reqwest::redirect::Policy::none() on the daemon client, redirect → per-server error naming the Location target, comment pinning the shared-client contract; (3) no allowlist. Draft ADR-0016 (one-pager, ADR-0001 format) first, recording all three plus the allowlist-by-construction reasoning. Tests: non-loopback http rejected at startup, loopback http accepted, redirect response rejected with Location in the error.

  3. self-assigned this
    on Jul 10, 2026
  4. tonibergholm commented on Jul 10, 2026

    @tonibergholm
    MemberAuthor

    Resolution

    Shipped as PR #122 (pending review/merge). ADR-0016 written and marked Accepted, recording all three decisions.

    What landed: (1) validate_mcp_url enforcing HTTPS-except-loopback at startup via parse_mcp_spec — typed McpUrlError, no escape hatch; (2) reqwest::redirect::Policy::none() on the shared daemon client with fingerprint_one rejecting a 3xx and naming the Location (the SSRF-closing half), plus a comment pinning the shared-client contract; (3) no allowlist, by construction, with the reasoning in the ADR.

    Tests: https + four loopback-http forms accepted; non-loopback http / public-IP http / non-http(s) schemes rejected with the right variant; startup abort through parse_mcp_spec; redirect-to-metadata-address rejected with Location surfaced. Workspace tests + clippy + fmt green. Demo confirmed unaffected (no --mcp in run-demo.sh).

    Fact for later: ADR-0016 governs the daemon's MCP config surface; the url crate is now a direct agenticd dep.

  5. added a commit that references this issue on Jul 10, 2026
    3946dc0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready-for-agentScoped and unambiguous enough for an agent to pick upwayfinder:taskWayfinder ticket: work that unblocks a decision or lands a fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions