Skip to content
youdede

MCP egress guard

SecurityHookv1.0.0

A deterministic fail-closed pre-tool gate that extracts every URL and host from a Youdede MCP tool call, normalizes it with the WHATWG URL parser, and blocks hosts absent from the egress list generated from the curated server profiles.

Runs on

Scope
$npx @youdede/toolkit add mcp-egress-guard --target claude-code

What it does

Block toolkit MCP tool calls whose arguments name a host outside the server's declared egress.

When it fires

  • implementation
  • maintenance
  • review

How it behaves

Compare every URL and host in a toolkit MCP tool call with the server egress from the generated registry.

It does not accept a lookalike, subdomain, userinfo, IP, or punycode host that differs from an exact declared egress host.

It does not accept a Youdede-named MCP server that is absent from the generated registry.

It does not inspect or restrict MCP servers outside the Youdede namespace.

Configuration

targets/claude-code/mcp-egress-guard.mjsnode · none

Version
1.0.0
Requires
node
Licence
RiskThis automatic gate blocks toolkit MCP tool calls whose arguments name a host outside the declared egress; a false denial can interrupt legitimate work, but it does not execute the blocked action.
Medium
ModeHow it works: fixed rules, model instructions, or both.
Deterministic only
Behaviour
Enforces, blocks on violation
On failure
Denies and blocks
LatencyThe entrypoint handles one intercepted event to block toolkit MCP tool calls that name an undeclared egress host without deferred work.
Immediate
Data retentionWhether data remains after use and who manages its storage.
Not retained
In packs
  • Secure agent boundaries

Often used with

All in Security