Commit Graph

1797 Commits

Author SHA1 Message Date
Michael Bolin
6f15edfc61 feat: show MCP tool calls in TUI 2025-05-06 14:07:26 -07:00
Michael Bolin
5ff4707b71 feat: support mcp_servers in config.toml 2025-05-06 14:07:26 -07:00
Michael Bolin
a885ccc005 merge commit for archive created by Sapling 2025-05-06 14:06:19 -07:00
Michael Bolin
bf7421637f feat: show MCP tool calls in TUI 2025-05-06 14:06:08 -07:00
Michael Bolin
69edf7a34e feat: support mcp_servers in config.toml 2025-05-06 12:38:30 -07:00
Michael Bolin
2456db8c12 merge commit for archive created by Sapling 2025-05-06 12:37:04 -07:00
Michael Bolin
f92ffdc74f feat: support mcp_servers in config.toml 2025-05-06 12:36:57 -07:00
Michael Bolin
1c2cd732d1 Merge 63552c01d8 into sapling-pr-archive-bolinfest 2025-05-06 12:03:00 -07:00
Michael Bolin
63552c01d8 feat: support mcp_servers in config.toml 2025-05-06 12:02:54 -07:00
Michael Bolin
49d040215a fix: build all crates individually as part of CI (#833)
I discovered that `cargo build` worked for the entire workspace, but not
for the `mcp-client` or `core` crates.

* `mcp-client` failed to build because it underspecified the set of
features it needed from `tokio`.
* `core` failed to build because it was using a "feature" of its own
crate in the default, no-feature version.
 
This PR fixes the builds and adds a check in CI to defend against this
sort of thing going forward.
2025-05-06 12:02:49 -07:00
Michael Bolin
3379d6a909 Merge 3ffa707253 into sapling-pr-archive-bolinfest 2025-05-06 11:58:32 -07:00
Michael Bolin
3ffa707253 fix: ensure mcp-client crate builds on its own 2025-05-06 11:58:28 -07:00
Michael Bolin
bcda2b2840 Merge de72183b62 into sapling-pr-archive-bolinfest 2025-05-06 11:56:55 -07:00
Michael Bolin
de72183b62 fix: ensure mcp-client crate builds on its own 2025-05-06 11:56:50 -07:00
Michael Bolin
01e9cce0e6 merge commit for archive created by Sapling 2025-05-06 11:55:44 -07:00
Michael Bolin
600ec9caac fix: ensure mcp-client crate builds on its own 2025-05-06 11:55:38 -07:00
Michael Bolin
ff09c48dad Merge 5d2c7bd372 into sapling-pr-archive-bolinfest 2025-05-06 11:50:08 -07:00
Michael Bolin
5d2c7bd372 fix: ensure mcp-client crate builds on its own 2025-05-06 11:50:00 -07:00
Michael Bolin
54470ea84d Merge b0907b655c into sapling-pr-archive-bolinfest 2025-05-06 11:16:51 -07:00
Michael Bolin
b0907b655c feat: support mcp_servers in config.toml 2025-05-06 11:15:15 -07:00
Michael Bolin
5f1b8f707c feat: update McpClient::new_stdio_client() to accept an env (#831)
Cleans up the signature for `new_stdio_client()` to more closely mirror
how MCP servers are declared in config files (`command`, `args`, `env`).
Also takes a cue from Claude Code where the MCP server is launched with
a restricted `env` so that it only includes "safe" things like `USER`
and `PATH` (see the `create_env_for_mcp_server()` function introduced in
this PR for details) by default, as it is common for developers to have
sensitive API keys present in their environment that should only be
forwarded to the MCP server when the user has explicitly configured it
to do so.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/831).
* #829
* __->__ #831
2025-05-06 11:14:47 -07:00
Michael Bolin
34042cb735 merge commit for archive created by Sapling 2025-05-06 11:02:41 -07:00
Michael Bolin
fdf282ce83 feat: support mcp_servers in config.toml 2025-05-06 11:02:33 -07:00
Michael Bolin
b4edb124db feat: update McpClient::new_stdio_client() to accept an env 2025-05-06 11:02:33 -07:00
Michael Bolin
019f0d42a6 merge commit for archive created by Sapling 2025-05-06 10:54:28 -07:00
Michael Bolin
a4a1ad8b65 feat: support mcp_servers in config.toml 2025-05-06 10:53:32 -07:00
Michael Bolin
706808db98 feat: update McpClient::new_stdio_client() to accept an env 2025-05-06 10:53:32 -07:00
Michael Bolin
f30edcb689 Merge fd429c488c into sapling-pr-archive-bolinfest 2025-05-05 16:51:20 -07:00
Michael Bolin
fd429c488c feat: support mcp_servers in config.toml 2025-05-05 16:51:14 -07:00
Michael Bolin
952ac6870d merge commit for archive created by Sapling 2025-05-05 16:44:59 -07:00
Michael Bolin
72a5da99d2 feat: support mcp_servers in config.toml 2025-05-05 16:44:51 -07:00
Michael Bolin
11c5958966 merge commit for archive created by Sapling 2025-05-05 16:33:19 -07:00
Michael Bolin
1b9245bce7 feat: support mcp_servers in config.toml 2025-05-05 16:33:00 -07:00
Michael Bolin
ea338dabb8 merge commit for archive created by Sapling 2025-05-05 16:25:36 -07:00
Michael Bolin
67dfca74b9 feat: support mcp_servers in config.toml 2025-05-05 16:25:25 -07:00
Michael Bolin
2cf7aeeeb6 feat: initial McpClient for Rust (#822)
This PR introduces an initial `McpClient` that we will use to give Codex
itself programmatic access to foreign MCPs. This does not wire it up in
Codex itself yet, but the new `mcp-client` crate includes a `main.rs`
for basic testing for now.

Manually tested by sending a `tools/list` request to Codex's own MCP
server:

```
codex-rs$ cargo build
codex-rs$ cargo run --bin codex-mcp-client ./target/debug/codex-mcp-server
{
  "tools": [
    {
      "description": "Run a Codex session. Accepts configuration parameters matching the Codex Config struct.",
      "inputSchema": {
        "properties": {
          "approval-policy": {
            "description": "Execution approval policy expressed as the kebab-case variant name (`unless-allow-listed`, `auto-edit`, `on-failure`, `never`).",
            "enum": [
              "auto-edit",
              "unless-allow-listed",
              "on-failure",
              "never"
            ],
            "type": "string"
          },
          "cwd": {
            "description": "Working directory for the session. If relative, it is resolved against the server process's current working directory.",
            "type": "string"
          },
          "disable-response-storage": {
            "description": "Disable server-side response storage.",
            "type": "boolean"
          },
          "model": {
            "description": "Optional override for the model name (e.g. \"o3\", \"o4-mini\")",
            "type": "string"
          },
          "prompt": {
            "description": "The *initial user prompt* to start the Codex conversation.",
            "type": "string"
          },
          "sandbox-permissions": {
            "description": "Sandbox permissions using the same string values accepted by the CLI (e.g. \"disk-write-cwd\", \"network-full-access\").",
            "items": {
              "enum": [
                "disk-full-read-access",
                "disk-write-cwd",
                "disk-write-platform-user-temp-folder",
                "disk-write-platform-global-temp-folder",
                "disk-full-write-access",
                "network-full-access"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "prompt"
        ],
        "type": "object"
      },
      "name": "codex"
    }
  ]
}
```
2025-05-05 12:52:55 -07:00
Michael Bolin
29097728f0 merge commit for archive created by Sapling 2025-05-05 11:56:55 -07:00
Michael Bolin
e013db7ab9 feat: mcp-client 2025-05-05 11:56:45 -07:00
Michael Bolin
8368e177dc merge commit for archive created by Sapling 2025-05-05 10:52:34 -07:00
Michael Bolin
2a0b44c73e feat: mcp-client 2025-05-05 10:52:29 -07:00
Michael Bolin
fed1586cf7 merge commit for archive created by Sapling 2025-05-05 10:48:14 -07:00
Michael Bolin
db5cf3d288 feat: mcp-client 2025-05-05 10:48:09 -07:00
Anil Karaka
76a979007e fix: increase output limits for truncating collector (#575)
This Pull Request addresses an issue where the output of commands
executed in the raw-exec utility was being truncated due to restrictive
limits on the number of lines and bytes collected. The truncation caused
the message [Output truncated: too many lines or bytes] to appear when
processing large outputs, which could hinder the functionality of the
CLI.

Changes Made

Increased the maximum output limits in the
[createTruncatingCollector](https://github.com/openai/codex/pull/575)
utility:
Bytes: Increased from 10 KB to 100 KB.
Lines: Increased from 256 lines to 1024 lines.
Installed the @types/node package to resolve missing type definitions
for [NodeJS](https://github.com/openai/codex/pull/575) and
[Buffer](https://github.com/openai/codex/pull/575).
Verified and fixed any related errors in the
[createTruncatingCollector](https://github.com/openai/codex/pull/575)
implementation.

Issue Solved: 

This PR ensures that larger outputs can be processed without truncation,
improving the usability of the CLI for commands that generate extensive
output. https://github.com/openai/codex/issues/509

---------

Co-authored-by: Michael Bolin <bolinfest@gmail.com>
2025-05-05 10:26:55 -07:00
Michael Bolin
211f7609a3 merge commit for archive created by Sapling 2025-05-05 10:22:05 -07:00
Michael Bolin
2499a60f8a feat: mcp-client 2025-05-05 10:22:00 -07:00
Michael Bolin
96d7f812ff merge commit for archive created by Sapling 2025-05-05 10:20:38 -07:00
Michael Bolin
f9e4b00693 feat: mcp-client 2025-05-05 10:20:30 -07:00
Michael Bolin
8fc0d3f963 merge commit for archive created by Sapling 2025-05-05 10:16:02 -07:00
Michael Bolin
706364cc83 feat: mcp-client 2025-05-05 10:15:56 -07:00
Michael Bolin
ab1ea9f5d9 Merge 306d0b5618 into sapling-pr-archive-bolinfest 2025-05-05 09:57:45 -07:00