feat: add mcp subcommand to CLI to run Codex as an MCP server

This commit is contained in:
Michael Bolin
2025-05-14 12:59:59 -07:00
parent a12e4b0b31
commit 776c86b217
6 changed files with 132 additions and 110 deletions
+6
View File
@@ -33,6 +33,9 @@ enum Subcommand {
#[clap(visible_alias = "e")]
Exec(ExecCli),
/// Experimental: run Codex as an MCP server.
Mcp,
/// Run the Protocol stream via stdin/stdout
#[clap(visible_alias = "p")]
Proto(ProtoCli),
@@ -70,6 +73,9 @@ async fn main() -> anyhow::Result<()> {
Some(Subcommand::Exec(exec_cli)) => {
codex_exec::run_main(exec_cli).await?;
}
Some(Subcommand::Mcp) => {
codex_mcp_server::run_main().await?;
}
Some(Subcommand::Proto(proto_cli)) => {
proto::run_main(proto_cli).await?;
}