Status: Experimental. This repository provides a multi-language reference implementation of the proposed interceptor extension for the Model Context Protocol (MCP), as described in SEP-2624.
by modelcontextprotocolC#
Last 12 weeks · 8 commits
5 of 6 standards met
Introduce InterceptorOverrides in the chain execution model to separate interceptor capability (server-declared) from execution policy (invoker-declared). Why The SEP currently locks all execution policy (failOpen, priorityHint, mode) into the interceptor's own definition. This means: If an interceptor declares but is known to be flaky in your deployment, you can't make it fail-open without changing the server If you want the same interceptor in audit mode in staging but active in production, there's no mechanism If you want to restrict an interceptor to only even though it declares support for + , you have to invoke it and hope the chain filters correctly Priority is fixed by the author, so platform teams can't reorder interceptors for their deployment topology In short: the chain interface had no policy layer, making it impractical for real-world multi-environment deployments. Changes 1. New "Capability vs Policy" subsection explaining the two-layer model 2. New interface (failOpen, priorityHint, mode, timeoutMs, hooks) 3. ChainEntry gains 4. updated to check overrides first 5. Orchestration steps updated — new step 2 "Resolve Policy" 6. New example showing overrides in action (priority override, mode promotion, fail-open for fragile interceptor) 7. New rationale entry (Design Decision 4) explaining why both layers exist
Adds a third interceptor type — * — to the working copy of the SEP (). What A sink is a non-blocking, non-mutating interceptor that reacts to a context operation without affecting the interaction. It MUST NOT block execution and MUST NOT modify the payload — it exists to drive concurrent UX, workflow state, or downstream pipelines based on what the agent is doing. Use cases: avatar/character animation from conversation mood, voice-mode / TTS switching, real-time UI affordances, background context indexing, secondary-agent triggers. The C# reference impl already demonstrates the avatar case end-to-end in . Changes to : Type union extended to (all sites incl. / ) New Sink section parallel to Validator / Mutator, with Execution model: sink as a third stage (parallel, fire-and-forget) on each phase; Type Behaviors table updated example reframed as a sink; new sink example added Rationale restructured: separation of the three types, why sink vs , and why "sink" and not "observability" (avoids implying OpenTelemetry overlap) Sinks are additive to the validator/mutator split and : audit mode disables enforcement while preserving a validator/mutator's interface; sinks are structurally* non-enforcing and cannot be promoted to affect the interaction. Implementations MUST reject sinks declared with . Why here This re-homes the proposal from — which targeted the SEP author's personal fork — onto this repo's working copy of the SEP. #21 established as where the WG maintains and reviews the SEP, so the sink proposal belongs here. Once the WG agrees, it folds upstream into SEP-2624 along with the rest of . 🤖 Generated with Claude Code
Adds a link to the Interceptors Working Group charter near the top of the README, following the convention used across MCP experimental extension repos (e.g. experimental-ext-skills). The charter page documents the working group's mission, scope, leadership, and active work items — useful context for anyone landing on this repo. 🤖 Generated with Claude Code
Repository: modelcontextprotocol/experimental-ext-interceptors. Description: Status: Experimental. This repository provides a multi-language reference implementation of the proposed interceptor extension for the Model Context Protocol (MCP), as described in SEP-2624. Stars: 17, Forks: 9. Primary language: C#. Languages: C# (71.8%), Go (27.6%), TypeScript (0.2%), Python (0.2%), Shell (0.1%). License: Apache-2.0. Topics: experimental, extension. Open PRs: 8, open issues: 4. Last activity: 1w ago. Community health: 87%. Top contributors: sambhav, jeongukjae, Degiorgio, PederHP.