Skip to content
youdede

MCP capability drift guard

SecurityHookv1.0.0

A deterministic fail-closed pre-tool gate that accepts only curated Youdede MCP server and tool identities from a generated pin registry and rejects unknown or description-drifted capabilities.

Runs on

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

What it does

Block toolkit MCP calls whose server or tool name is not pinned, or whose supplied description differs from the pin.

When it fires

  • implementation
  • maintenance
  • review

How it behaves

Compare a toolkit MCP tool call and any observed inventory with the generated capability pin registry.

It does not trust MCP annotations, server names, or tool descriptions that are absent from the generated pin registry.

It does not silently accept added, removed, or renamed tools from curated servers, or description-drifted tools when the client supplies the description.

It does not widen egress, secret, filesystem, subprocess, or mutation authority for an MCP server.

Configuration

targets/claude-code/mcp-capability-drift-guard.mjsnode · none

Version
1.0.0
Requires
node
Licence
RiskThis automatic gate blocks toolkit MCP tool calls when the server or tool name is not pinned, or when the client supplies a description that differs from the pin; 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 when the server or tool name is not pinned, or when a supplied description differs from the pin, without deferred work.
Immediate
Data retentionWhether data remains after use and who manages its storage.
Not retained
In packs
  • MCP baseline
  • Secure agent boundaries

Often used with

All in Security