[CF-DATAPLANE][CPEX] Run resource hooks for resource reads - #128
Open
lucarlig wants to merge 3 commits into
Open
[CF-DATAPLANE][CPEX] Run resource hooks for resource reads#128lucarlig wants to merge 3 commits into
lucarlig wants to merge 3 commits into
Conversation
Signed-off-by: lucarlig <luca.carlig@ibm.com>
lucarlig
force-pushed
the
user/luca/issue-6253-cpex-typed-extensions
branch
from
September 3, 2026 09:52
34a2c5b to
e4193e9
Compare
lucarlig
marked this pull request as ready for review
September 3, 2026 09:59
Signed-off-by: lucarlig <luca.carlig@ibm.com>
lucarlig
marked this pull request as draft
September 3, 2026 10:23
lucarlig
marked this pull request as ready for review
September 3, 2026 10:27
Signed-off-by: lucarlig <luca.carlig@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this accomplishes
This PR lets the external dataplane apply CPEX policy to the complete
resources/readlifecycle.Before a backend resource is fetched, plugins receive its canonical backend-local URI and can allow or deny the request. After the backend responds, plugins can inspect, redact, or transform both text and binary resource content before it reaches the MCP client. Context created by the pre-fetch hook is preserved for the matching post-fetch hook, even if the configured runtime is reloaded while the backend call is in flight.
The result is that resource reads receive the same policy-enforcement boundary already available to tool and prompt calls. The bundled secrets-detection plugin demonstrates this by redacting a password resource for both direct and namespaced resource URIs.
Safety behavior
Scope
This keeps the existing global CPEX configuration version and request-local
PluginContextTablebehavior. Scoped plugin bindings, trusted typed extensions, catalogs, caches, and runtime revisions are intentionally excluded pending the producer contract in IBM/mcp-context-forge#6252.Part of IBM/mcp-context-forge#6253.
Protocol-specific coverage for MCP
2026-07-28and2025-11-25is isolated in stacked PR #129.Verification
cargo nextest run --locked --workspace --all-featurescargo clippy --locked --workspace --all-targets -- -D warningscargo fmt --all -- --checkcargo deny check advisories bans licensescargo shear --check-test-targets --deny-warnings --locked