mirror of
https://github.com/openai/codex.git
synced 2026-12-03 00:41:03 +00:00
Connect plugin MCP servers over launcher-provided Unix sockets (#64828)
## Why A launcher that already hosts an MCP server needs a way for Codex to use it without starting a separate subprocess for the plugin. ## What changed The stdio app server accepts socket bindings from its immediate parent on Unix. A binding applies to a local plugin's stdio MCP server only when the plugin ID, server name, and binding ID match a single entry. Codex uses the stdio wire protocol over the socket and retains the original declaration for policy checks. Before sending MCP traffic, Codex requires a user-owned socket directory with mode `0700` and verifies the listener's PID and UID. ## Testing Add tests for binding scope and ambiguous matches, and for rejecting unexpected listener PIDs, insecure directory permissions, symlinked socket directories, and relative socket paths. GitOrigin-RevId: 3d669dd59a0812b04727e4a1e458774007f054ba
This commit is contained in:
@@ -94,6 +94,7 @@ use codex_feedback::CodexFeedback;
|
||||
use codex_goal_extension::GoalService;
|
||||
use codex_home::CodexHomeUserInstructionsProvider;
|
||||
use codex_login::AuthManager;
|
||||
use codex_mcp::ParentMcpBindings;
|
||||
use codex_models_manager::manager::ModelCatalogSettings;
|
||||
use codex_otel::auth_storage::AuthStorageOriginator;
|
||||
use codex_protocol::ThreadId;
|
||||
@@ -424,6 +425,12 @@ impl MessageProcessor {
|
||||
None,
|
||||
)
|
||||
.with_guardian_policy_loader(Arc::new(config_manager.clone()));
|
||||
let manager = match rpc_transport {
|
||||
AppServerRpcTransport::Stdio => {
|
||||
manager.with_parent_mcp_bindings(ParentMcpBindings::from_launcher())
|
||||
}
|
||||
AppServerRpcTransport::Websocket | AppServerRpcTransport::InProcess => manager,
|
||||
};
|
||||
match code_mode_session_provider {
|
||||
Some(provider) => manager.with_code_mode_session_provider(provider),
|
||||
None => manager,
|
||||
|
||||
Reference in New Issue
Block a user