guides/agents-sdk.md +3 −5
1# Use Codex with the Agents SDK1# Use Codex with the Agents SDK
2 2
3Invoke Codex as an MCP server to build multi-agent development workflows
4
5# Running Codex as an MCP server3# Running Codex as an MCP server
6 4
75You can run Codex as an MCP server and connect it from other MCP clients (for example, an agent built with the [OpenAI Agents SDK](https://openai.github.io/openai-agents-js/guides/mcp/)).You can run Codex as an MCP server and connect it from other MCP clients (for example, an agent built with the [OpenAI Agents SDK MCP integration](https://developers.openai.com/api/docs/guides/agents/integrations-observability#mcp)).
8 6
9To start Codex as an MCP server, you can use the following command:7To start Codex as an MCP server, you can use the following command:
10 8
23**`codex`**: Run a Codex session. Accepts configuration parameters that match the Codex `Config` struct. The `codex` tool takes these properties:21**`codex`**: Run a Codex session. Accepts configuration parameters that match the Codex `Config` struct. The `codex` tool takes these properties:
24 22
25| Property | Type | Description |23| Property | Type | Description |
2624| --- | --- | --- || ----------------------- | --------- | -------------------------------------------------------------------------------------------------------- |
27| **`prompt`** (required) | `string` | The initial user prompt to start the Codex conversation. |25| **`prompt`** (required) | `string` | The initial user prompt to start the Codex conversation. |
28| `approval-policy` | `string` | Approval policy for shell commands generated by the model: `untrusted`, `on-request`, and `never`. |26| `approval-policy` | `string` | Approval policy for shell commands generated by the model: `untrusted`, `on-request`, and `never`. |
29| `base-instructions` | `string` | The set of instructions to use instead of the default ones. |27| `base-instructions` | `string` | The set of instructions to use instead of the default ones. |
37**`codex-reply`**: Continue a Codex session by providing the thread ID and prompt. The `codex-reply` tool takes these properties:35**`codex-reply`**: Continue a Codex session by providing the thread ID and prompt. The `codex-reply` tool takes these properties:
38 36
39| Property | Type | Description |37| Property | Type | Description |
4038| --- | --- | --- || ----------------------------- | ------ | --------------------------------------------------------- |
41| **`prompt`** (required) | string | The next user prompt to continue the Codex conversation. |39| **`prompt`** (required) | string | The next user prompt to continue the Codex conversation. |
42| **`threadId`** (required) | string | The ID of the thread to continue. |40| **`threadId`** (required) | string | The ID of the thread to continue. |
43| `conversationId` (deprecated) | string | Deprecated alias for `threadId` (kept for compatibility). |41| `conversationId` (deprecated) | string | Deprecated alias for `threadId` (kept for compatibility). |