[mcp] Support MCP Apps part 3 - Add mcp tool call support. (#17364)

- [x] Add a new app-server method so that MCP Apps can call their own
MCP server directly.
This commit is contained in:
Matthew Zeng authored and GitHub committed 2026-04-11 04:39:19 +00:00
1 parent f8bb088617
commit b7139a7e8f
112 files changed
+871 -238

No files matched your search

+14
View File
@@ -9,6 +9,7 @@ use codex_protocol::config_types::Personality;
use codex_protocol::config_types::ServiceTier;
use codex_protocol::error::CodexErr;
use codex_protocol::error::Result as CodexResult;
use codex_protocol::mcp::CallToolResult;
use codex_protocol::models::ContentItem;
use codex_protocol::models::ResponseInputItem;
use codex_protocol::models::ResponseItem;
@@ -224,6 +225,19 @@ impl CodexThread {
Ok(serde_json::to_value(result)?)
}
pub async fn call_mcp_tool(
&self,
server: &str,
tool: &str,
arguments: Option<serde_json::Value>,
meta: Option<serde_json::Value>,
) -> anyhow::Result<CallToolResult> {
self.codex
.session
.call_tool(server, tool, arguments, meta)
.await
}
pub fn enabled(&self, feature: Feature) -> bool {
self.codex.enabled(feature)
}