mirror of
https://github.com/openai/codex.git
synced 2026-04-28 18:32:04 +03:00
feat: hot reload mcp servers (#8957)
### Summary * Added `mcpServer/refresh` command to inform app servers and active threads to refresh mcpServer on next turn event. * Added `pending_mcp_server_refresh_config` to codex core so that if the value is populated, we reinitialize the mcp server manager on the thread level. * The config is updated on `mcpServer/refresh` command which we iterate through threads and provide with the latest config value after last write.
This commit is contained in:
@@ -60,6 +60,13 @@ pub struct Submission {
|
||||
pub op: Op,
|
||||
}
|
||||
|
||||
/// Config payload for refreshing MCP servers.
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema)]
|
||||
pub struct McpServerRefreshConfig {
|
||||
pub mcp_servers: Value,
|
||||
pub mcp_oauth_credentials_store_mode: Value,
|
||||
}
|
||||
|
||||
/// Submission operation
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema)]
|
||||
#[serde(tag = "type", rename_all = "snake_case")]
|
||||
@@ -186,6 +193,9 @@ pub enum Op {
|
||||
/// Reply is delivered via `EventMsg::McpListToolsResponse`.
|
||||
ListMcpTools,
|
||||
|
||||
/// Request MCP servers to reinitialize and refresh cached tool lists.
|
||||
RefreshMcpServers { config: McpServerRefreshConfig },
|
||||
|
||||
/// Request the list of available custom prompts.
|
||||
ListCustomPrompts,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user