Skip to content

Add MCP management wizard UX and harden Seatbelt symlink policies#3805

Closed
AmirTlinov wants to merge 10 commits intoopenai:mainfrom
AmirTlinov:main
Closed

Add MCP management wizard UX and harden Seatbelt symlink policies#3805
AmirTlinov wants to merge 10 commits intoopenai:mainfrom
AmirTlinov:main

Conversation

@AmirTlinov
Copy link
Copy Markdown

@AmirTlinov AmirTlinov commented Sep 17, 2025

  • Delivered MCP management overhaul (Phase 3): TUI manager & wizard (codex-rs/tui/src/mcp/...,
    codex-rs/tui/src/app.rs:444) plus matching CLI wizard (codex-rs/cli/src/mcp/..., codex-rs/cli/src/
    mcp_cmd.rs:289) in line with RFC 0001.

    • Hardened MCP registry for atomic rename/update (codex-rs/core/src/mcp/registry.rs:49) and added
      a health stub; ensured CRLF-safe patch handling (codex-rs/apply-patch/src/lib.rs:640).
    • Enhanced Seatbelt symlink policy generation via SeatbeltPathExpr and SBPL escaping (codex-rs/
      core/src/seatbelt.rs:11).
    • Documented the release in CHANGES.md and synced metadata in docs/rfcs/0001-mcp-management-
      overhaul.md.

    Test plan

    • cargo clippy --workspace --all-targets -- -D warnings
    • cargo test --all-features
    • cargo test -p codex-tui
    • cargo test -p codex-cli
    • cargo test -p codex-core --lib -- mcp
    • cargo test -p codex-exec --test all suite::apply_patch::test_apply_patch_freeform_tool
{D90FEEA8-B966-4E05-9C4A-8C8883EFB3BC} {A8238100-44FD-4D0E-AFD6-EE914D5AEE23} {7210F014-1432-4B34-935D-12275FA66576}

AmirTlinov and others added 6 commits September 17, 2025 11:45
# MCP Management Overhaul – September 2025 (Phase 3 Delivery)

## Highlights
- Added a fully interactive MCP manager + wizard to the TUI, covering the user-facing pieces of RFC “MCP Management Overhaul” Section 6 (Unified UX). Manager views surface templates/servers with health placeholders, and wizard flows provide multi-step validation with snapshot coverage.
- Extended the CLI with a production-ready `codex mcp wizard`, supporting both interactive and non-interactive usage, JSON summaries, and direct persistence. This aligns the CLI experience with the TUI (RFC Section 6.7) while remaining fully scriptable.
- Hardened the registry layer (RFC Section 7.3) so MCP server rename/update operations are atomic and cannot lose existing configurations even if persistence fails mid-flight.
- Enhanced Seatbelt sandbox symlink support by introducing `SeatbeltPathExpr` and SBPL string escaping so lexical symlink paths are whitelisted alongside canonical ones, eliminating duplicate `-D` arguments while preserving security.
- Ensured CRLF-aware patch application by preserving original line endings in `apply_patch`, maintaining correctness for Windows-authored files.
- Updated documentation artifacts (`todo.machine.md`, plan.md excerpts, thought logs) to reflect the wizard/manager architecture and progress tracking, keeping the repo consistent with MCP-MANAGEMENT.md.

## Details
- Introduced `tui/src/mcp/` modules (`types`, `manager_view`, `wizard_view`) with unit and snapshot tests (`mcp_manager_*`, `mcp_wizard_*`) to verify layout and interactions.
- Wired new `AppEvent` variants and handlers in `tui/src/app.rs` and `chatwidget.rs`, enabling live config edits (create, edit, delete, reload) and feature-flag based fallbacks.
- Added `core/src/mcp/health.rs` and expanded `McpRegistry` (upsert/remove/load, health stubs, validation). Added regression tests ensuring rename safety.
- Implemented CLI wizard helpers under `cli/src/mcp/` with shared argument parsing, English-language prompts, validation, and JSON rendering; integrated with existing CLI command surface.
- Hardened `apply-patch`’s CRLF handling, updated integration test `suite::apply_patch::test_apply_patch_freeform_tool`, and added non-interactive JSON path tests for the wizard to guarantee cross-platform stability.
- Added `create_seatbelt_args_with_symlink_root_includes_lexical_paths` (Seatbelt tests) to ensure policies include both canonical and lexical paths when the workspace root is a symlink.
- Ran full QA suite (`cargo test --all-features`, focused crate tests, clippy `-D warnings`) to provide audited evidence of quality.

## Testing
- `cargo clippy --workspace --all-targets -- -D warnings`
- `cargo test --all-features`
- `cargo test -p codex-tui`
- `cargo test -p codex-cli`
- `cargo test -p codex-core --lib -- mcp`
- `cargo test -p codex-exec --test all suite::apply_patch::test_apply_patch_freeform_tool`
@AmirTlinov AmirTlinov closed this Sep 21, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant