mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
Expose MCP provenance to tool lifecycle extensions (#40976)
## What changed - Add optional `McpToolContext` metadata to `ToolStartInput`, exposing the model-visible MCP tool details and its source classification without exposing the executable client. - Classify MCP calls as connectors, configured servers, plugin servers, executor-selected plugins, or other registrations based on the prepared call. - Prepare each MCP call before notifying tool lifecycle contributors and reuse that same call for execution so the callback describes the call that runs. ## Testing - Cover host-owned connector calls and extension-owned Apps server calls, including their distinct provenance and executed tool names. GitOrigin-RevId: efd23f511b1045ffdd96349d621ad62365569b2b
This commit is contained in:
@@ -236,6 +236,18 @@ impl PreparedMcpCall {
|
||||
&self.server_name
|
||||
}
|
||||
|
||||
/// Returns whether this call is bound to the host-owned Codex Apps server.
|
||||
pub fn is_host_owned_apps(&self) -> bool {
|
||||
self.config
|
||||
.mcp_server_catalog
|
||||
.server(&self.server_name)
|
||||
.is_some_and(|registration| {
|
||||
registration
|
||||
.source()
|
||||
.is_host_owned_apps(&self.server_name, registration.config())
|
||||
})
|
||||
}
|
||||
|
||||
pub fn server_origin(&self) -> Option<&str> {
|
||||
self.server_metadata
|
||||
.origin
|
||||
|
||||
Reference in New Issue
Block a user