You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Packaging, automation and deployment (ex: pypi, docker, quay.io, kubernetes, terraform)
Other (please describe below)
🧭 Epic
Title: Preserve plugin cross-hook context on Rust-owned /mcp tool calls Goal: Make the Rust MCP runtime preserve the same plugin state continuity that the Python streamable HTTP path is adding in PR #3915. Why now: The Python fix allows data written during HTTP_PRE_REQUEST to be available during TOOL_PRE_INVOKE on /mcp. The Rust runtime currently preserves auth context, but not plugin_context_table or plugin_global_context, so behavior diverges between Python-owned and Rust-owned MCP paths.
🧑🏻💻 User Story 1
As a: plugin author I want: state written in HTTP_PRE_REQUEST to be available in TOOL_PRE_INVOKE for Rust-owned /mcp requests So that: plugins behave the same on Python and Rust MCP runtimes
✅ Acceptance Criteria
Scenario: Rust /mcp request preserves plugin context into tool pre-invoke hooksGiven a plugin stores data in plugin-local or global context during HTTP_PRE_REQUEST
When a client sends a tools/call request through the Rust-owned /mcp runtime
Then TOOL_PRE_INVOKE can read the same context values
And the tool execution sees the same plugin-modified behavior as the Python path
Scenario: Rust resolve and fallback paths share the same plugin contextGiven the Rust runtime resolves a tools/call plan through Python
When the request falls back to Python execution after resolve
Then TOOL_PRE_INVOKE is not re-run with missing or inconsistent context
And plugin-visible behavior remains consistent with the direct Python /mcp path
🧑🏻💻 User Story 2
As a: platform maintainer I want: Rust internal MCP forwarding to preserve plugin request lifecycle state safely So that: enabling the Rust MCP runtime does not break plugins that rely on cross-hook context sharing
✅ Acceptance Criteria
Scenario: Rust runtime transports only trusted plugin lifecycle contextGiven a public MCP request enters through the Rust runtime
When Python performs HTTP_PRE_REQUEST processing and authentication
Then any context forwarded back into later trusted internal Rust-to-Python calls is derived from server-side state
And clients cannot inject or spoof that context through public request headers
Scenario: Regression coverage exists for Python/Rust parityGiven automated tests for the Rust MCP runtime and trusted internal MCP endpoints
When plugin context sharing behavior changes
Then tests fail if Rust-owned /mcp diverges from Python-owned /mcp for HTTP_PRE_REQUEST to TOOL_PRE_INVOKE continuity
📐 Design Sketch (optional)
flowchart TD
A[Client POST /mcp] --> B[Rust MCP runtime]
B --> C[Python internal authenticate]
C --> D[HTTP_PRE_REQUEST hooks]
D --> E[Trusted internal context handoff]
E --> F[Python tools/call resolve or execute]
F --> G[TOOL_PRE_INVOKE hooks]
No breaking changes to existing MCP-compliant integrations
If deviations exist, please describe them below:
🔄 Alternatives Considered
Leave the gap as-is and accept different plugin behavior between Python and Rust /mcp paths. Rejected because it makes Rust enablement behaviorally unsafe for plugins that depend on cross-hook state.
Re-run hook logic independently in the Rust path without shared context. Rejected because it does not preserve plugin-local state and risks double-running hook side effects.
Limit support to auth-context reuse only. Rejected because PR fix/3879-mcp-plugin-context-sharing #3915 shows plugin context continuity is required beyond auth data.
Local analysis on main found that Python internal MCP endpoints already accept plugin_context_table and plugin_global_context, but the Rust runtime only carries auth context today.
🧭 Type of Feature
Please select the most appropriate category:
🧭 Epic
Title: Preserve plugin cross-hook context on Rust-owned
/mcptool callsGoal: Make the Rust MCP runtime preserve the same plugin state continuity that the Python streamable HTTP path is adding in PR #3915.
Why now: The Python fix allows data written during
HTTP_PRE_REQUESTto be available duringTOOL_PRE_INVOKEon/mcp. The Rust runtime currently preserves auth context, but notplugin_context_tableorplugin_global_context, so behavior diverges between Python-owned and Rust-owned MCP paths.🧑🏻💻 User Story 1
As a: plugin author
I want: state written in
HTTP_PRE_REQUESTto be available inTOOL_PRE_INVOKEfor Rust-owned/mcprequestsSo that: plugins behave the same on Python and Rust MCP runtimes
✅ Acceptance Criteria
🧑🏻💻 User Story 2
As a: platform maintainer
I want: Rust internal MCP forwarding to preserve plugin request lifecycle state safely
So that: enabling the Rust MCP runtime does not break plugins that rely on cross-hook context sharing
✅ Acceptance Criteria
📐 Design Sketch (optional)
flowchart TD A[Client POST /mcp] --> B[Rust MCP runtime] B --> C[Python internal authenticate] C --> D[HTTP_PRE_REQUEST hooks] D --> E[Trusted internal context handoff] E --> F[Python tools/call resolve or execute] F --> G[TOOL_PRE_INVOKE hooks]🔗 MCP Standards Check
🔄 Alternatives Considered
/mcppaths. Rejected because it makes Rust enablement behaviorally unsafe for plugins that depend on cross-hook state.📓 Additional Context
mainfound that Python internal MCP endpoints already acceptplugin_context_tableandplugin_global_context, but the Rust runtime only carries auth context today.