Skip to content

Add MCP tool handler support to the hooks engine - #38705

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/295b845471fe92bd7ad7cd272fbcd2c3713912e0
Aug 15, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/295b845471fe92bd7ad7cd272fbcd2c3713912e0

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 15, 2026 •

Copy link
Copy Markdown

Add MCP tool handler support to the hooks engine

What changed

  • Discover synchronous mcp_tool hook handlers and invoke their configured MCP server and tool through a supplied executor.
  • Expand nested hook-event placeholders in MCP tool inputs while preserving JSON types, and process tool output through the existing hook output contract.
  • Represent hook details as handler-specific metadata in hooks/list, including MCP server and tool fields, and show those details in the TUI hooks browser.
  • Skip unsupported SessionEnd MCP hooks and runtimes without MCP invocation support with startup warnings.

Testing

  • Cover argument expansion, missing placeholders, MCP invocation and hook decisions, discovery warnings, hooks/list metadata, and TUI rendering.

## What changed

- Discover synchronous `mcp_tool` hook handlers and invoke their configured MCP server and tool through a supplied executor.
- Expand nested hook-event placeholders in MCP tool inputs while preserving JSON types, and process tool output through the existing hook output contract.
- Represent hook details as handler-specific metadata in `hooks/list`, including MCP server and tool fields, and show those details in the TUI hooks browser.
- Skip unsupported `SessionEnd` MCP hooks and runtimes without MCP invocation support with startup warnings.

## Testing

- Cover argument expansion, missing placeholders, MCP invocation and hook decisions, discovery warnings, `hooks/list` metadata, and TUI rendering.

GitOrigin-RevId: 295b845471fe92bd7ad7cd272fbcd2c3713912e0
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/295b845471fe92bd7ad7cd272fbcd2c3713912e0 branch from 1959100 to 85fc4de Compare August 15, 2026 05:54
@copyberry
copyberry Bot merged commit 85fc4de into main Aug 15, 2026
28 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/295b845471fe92bd7ad7cd272fbcd2c3713912e0 branch August 15, 2026 05:55
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 15, 2026

This branch was previously deployed

1 inactive deployment
issue-triage — 85fc4def Deployed Aug 15, 2026 by JDR432 via Identify potential duplicates (open issues fallback) #37964
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.