Skip to main content

Module mcp

Module mcp 

Source
Expand description

MCP (Model Context Protocol) server configuration.

Defines the McpServerConfig type for configuring MCP servers that the Codex CLI can connect to. The configuration is passed to the CLI via command-line flags or config overrides.

§Example

use codex_cli_sdk::mcp::{McpServerConfig, McpServers};

let mut servers = McpServers::new();
servers.insert(
    "filesystem".into(),
    McpServerConfig::new("npx")
        .with_args(["-y", "@modelcontextprotocol/server-filesystem", "/tmp"])
        .with_env("DEBUG", "true"),
);

Structs§

McpServerConfig
Configuration for a single MCP server.

Type Aliases§

McpServers
A map of MCP server name → configuration.