Recognize MCP tool hook configurations (#37363)

## What changed

- Parse `mcp_tool` hook handlers with a server, tool, JSON input, and optional timeout and status message.
- Return managed MCP tool hooks from `configRequirements/read` and include the handler in the generated protocol schemas.
- Skip MCP tool hooks during discovery with an explicit warning until execution is supported.

## Testing

- Cover MCP tool hook deserialization, including nested and null JSON input values.
- Extend the config requirements RPC test to verify the new handler shape.

GitOrigin-RevId: ff7e2d12b75b486c54d63469af547a29f9b31418
This commit is contained in:
Abhinav authored and copyberry committed 2026-08-07 03:30:29 +00:00
1 parent 5bdc889708
commit 81b9bc2109
14 files changed
+278 -10

No files matched your search

@@ -519,6 +519,19 @@ pub enum ConfiguredHookHandler {
#[ts(rename = "additionalContextLimit")]
additional_context_limit: Option<usize>,
},
#[serde(rename = "mcp_tool")]
#[ts(rename = "mcp_tool")]
McpTool {
server: String,
tool: String,
input: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "timeoutSec")]
#[ts(rename = "timeoutSec")]
timeout_sec: Option<u64>,
#[serde(rename = "statusMessage")]
#[ts(rename = "statusMessage")]
status_message: Option<String>,
},
#[serde(rename = "prompt")]
#[ts(rename = "prompt")]
Prompt {},