Skip to content

Commit 7aefd9f

Browse files
committed
feat(mcp): validate tool args with jsonschema
- validate cached MCP tool input schemas with jsonschema - cache compiled validators with tool listings to avoid per-call builds - surface disabled client-side validation in /mcp server output - keep structured invalid-arguments payloads and focused integration tests - raise the Rust floor to 1.83 for the validator dependency
1 parent c9f7a0d commit 7aefd9f

File tree

10 files changed

+1147
-21
lines changed

10 files changed

+1147
-21
lines changed

ARCHITECTURE.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ HTTP auth tokens are stored via `McpTokenStore` in `src/core/mcp_auth.rs`.
6060
## MCP client subsystem
6161
The MCP client implementation is now organized under `src/mcp/client/`:
6262

63-
- `src/mcp/client/mod.rs``McpClientManager`, per-server runtime state, and
64-
connect/refresh orchestration.
63+
- `src/mcp/client/mod.rs``McpClientManager`, per-server runtime state,
64+
connect/refresh orchestration, and cached compiled JSON Schema validators for
65+
MCP tool input schemas.
6566
- `src/mcp/client/operations.rs` – protocol-level operations such as
6667
`execute_tool_call`, `execute_resource_read`, `execute_prompt`, and helpers for
6768
client result/error responses.
@@ -139,8 +140,9 @@ Key modules and responsibilities:
139140
- `src/core/app/actions/mod.rs` — root action and command contracts, plus
140141
top-level reducer fan-out (`apply_action`, `apply_actions`).
141142
- `src/core/app/actions/streaming.rs` — stream-side reducer entrypoint for
142-
stream chunk handling, MCP callbacks, tool permission flow, and command
143-
emission for async MCP/tool/sampling work.
143+
stream chunk handling, MCP callbacks, tool permission flow, client-side MCP
144+
tool argument validation against cached `input_schema` via precompiled
145+
validators, and command emission for async MCP/tool/sampling work.
144146
- `src/core/app/actions/picker.rs` — reducer for picker navigation/filter/apply
145147
flows and provider→model transition command dispatch.
146148
- `src/core/app/actions/input/inspect.rs` — reducer for tool inspect overlay

0 commit comments

Comments
 (0)