{"_id":"@cynosure-mcp/codex-terminal","_rev":"3-b7395203bee493ef418b2b1795c68460","name":"@cynosure-mcp/codex-terminal","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@cynosure-mcp/codex-terminal","version":"1.0.0","keywords":["mcp","model-context-protocol","codex","openai","terminal","coding-agent"],"_id":"@cynosure-mcp/codex-terminal@1.0.0","maintainers":[{"name":"andjhagen","email":"voidvalkon@gmail.com"}],"bin":{"codex-terminal":"dist/index.js"},"dist":{"shasum":"151ba25f6c190e1838f25352ed14bb851a078477","tarball":"https://registry.npmjs.org/@cynosure-mcp/codex-terminal/-/codex-terminal-1.0.0.tgz","fileCount":7,"integrity":"sha512-bfyRltSx0hUd1sLIo4l87AvjIs9/fHSQYCu6QKB0uOlv+FJSkGJW6QJ0LVy7b4rmt4TwxkqXh9ToSHn8eri4Nw==","signatures":[{"sig":"MEUCIQCky8ATweHblnWra/zov+z7d2V2fUi2MNIeK4/Tm9UBKgIgE6H+N0BKGRQaojFaO38Sr1JE0ZQUIYefkVm1TlU+wNo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":82867},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"5f4ffc273f485708ad79df3ae5405ed39789bd57","mcpName":"io.github.andreasjhagen/codex-terminal","scripts":{"dev":"tsx src/index.ts","build":"tsc","start":"node dist/index.js"},"_npmUser":{"name":"andjhagen","email":"voidvalkon@gmail.com"},"_npmVersion":"11.12.1","description":"MCP server for starting and controlling Codex CLI coding sessions","directories":{},"_nodeVersion":"24.15.0","dependencies":{"zod":"^3.24.0","node-pty":"^1.1.0","@modelcontextprotocol/sdk":"^1.27.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/codex-terminal_1.0.0_1782056230493_0.3001265905562609","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@cynosure-mcp/codex-terminal","version":"1.0.1","keywords":["mcp","model-context-protocol","codex","openai","terminal","coding-agent"],"_id":"@cynosure-mcp/codex-terminal@1.0.1","maintainers":[{"name":"andjhagen","email":"voidvalkon@gmail.com"}],"bin":{"codex-terminal":"dist/index.js"},"dist":{"shasum":"6439c38f5959f79ea14725defadbb769b31a9fe6","tarball":"https://registry.npmjs.org/@cynosure-mcp/codex-terminal/-/codex-terminal-1.0.1.tgz","fileCount":7,"integrity":"sha512-8fLHbrlWDgLPoTRvXVdFzI/gWbU/0ztxavV53eZ91fDcC7PFLpT2UWS+0TyuWhGS7nTJeWvlVTL2CeF1exxBGg==","signatures":[{"sig":"MEQCIB3rsW/NvjMw6tPcB7WMzZGvjfgMV2VUy5EqDvfcQqHIAiBnCowxlcs/E5E7kLH0J8iQ3gcojWA13YsUQ2/1RYTPrA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84271},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"a114eae53425d9d6ffe88b883a04b2ccabac7e7d","mcpName":"io.github.andreasjhagen/codex-terminal","scripts":{"dev":"tsx src/index.ts","build":"tsc","start":"node dist/index.js"},"_npmUser":{"name":"andjhagen","email":"voidvalkon@gmail.com"},"_npmVersion":"10.9.2","description":"MCP server for starting and controlling Codex CLI coding sessions","directories":{},"_nodeVersion":"22.17.1","dependencies":{"zod":"^3.24.0","node-pty":"^1.1.0","@modelcontextprotocol/sdk":"^1.27.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/codex-terminal_1.0.1_1786486028268_0.6447960470637377","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"_id":"@cynosure-mcp/codex-terminal@1.1.1","bin":{"codex-terminal":"dist/index.js"},"bugs":{"url":"https://github.com/Cynosure-MCP-Collection/mcp-codex-terminal/issues"},"dist":{"shasum":"274e49efcf33c061355d1d6a0d6267cdb563af36","tarball":"https://registry.npmjs.org/@cynosure-mcp/codex-terminal/-/codex-terminal-1.1.1.tgz","fileCount":7,"integrity":"sha512-eV0b+OP2+gQj1+UK0UtCJ5CGCvAF53nR7CH/VK2tyqsa0xkGzGdP+5Y4g8sSqt0iZVlbQcKP3QVbcC3G2ixihg==","signatures":[{"sig":"MEUCIQClfIwiW+z0RoiPL6Ik1Ty49GDLUviRANqSN1OLlhZbngIgW9QCePQakJxBcgXNonkxGajVUoOqZXBRAPxZjoP4yhI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDV7HGOSL8YmbMrAI6tt4QQxSKgauo93voNLq7k4wLbWQIhAOI5OADmzl9tS+/LfyAqDGI/AuGH+FA+AekjpSs4sfKl"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cynosure-mcp%2fcodex-terminal@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":327857},"main":"dist/index.js","name":"@cynosure-mcp/codex-terminal","type":"module","types":"./dist/index.d.ts","gitHead":"902798f210cd56613a773719e9aebbf5184c60b2","mcpName":"io.github.andreasjhagen/codex-terminal","scripts":{"dev":"tsx src/index.ts","test":"npm run build && node --test test/*.test.mjs","build":"tsc","start":"node dist/index.js","version":"node scripts/sync-version.mjs && git add server.json","release:check":"node scripts/sync-version.mjs --check"},"version":"1.1.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"bb10500b-8b67-4aa1-b561-9b2c9716e491"}},"homepage":"https://github.com/Cynosure-MCP-Collection/mcp-codex-terminal#readme","keywords":["mcp","model-context-protocol","codex","openai","terminal","coding-agent"],"repository":{"url":"git+https://github.com/Cynosure-MCP-Collection/mcp-codex-terminal.git","type":"git"},"_npmVersion":"11.19.0","description":"MCP server for starting and controlling Codex CLI coding sessions","directories":{},"maintainers":[{"name":"andjhagen","email":"voidvalkon@gmail.com"}],"_nodeVersion":"24.21.0","dependencies":{"zod":"^3.24.0","node-pty":"^1.1.0","@modelcontextprotocol/sdk":"^1.27.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/codex-terminal_1.1.1_1791041549557_0.6144597988619318"}}},"time":{"created":"2026-06-21T15:37:10.334Z","modified":"2026-10-03T15:32:29.993Z","1.0.0":"2026-06-21T15:37:10.648Z","1.0.1":"2026-08-11T22:07:08.391Z","1.1.1":"2026-10-03T15:32:29.662Z"},"keywords":["mcp","model-context-protocol","codex","openai","terminal","coding-agent"],"description":"MCP server for starting and controlling Codex CLI coding sessions","maintainers":[{"name":"andjhagen","email":"voidvalkon@gmail.com"}],"readme":"# @cynosure-mcp/codex-terminal\n\nMCP server for starting and controlling OpenAI Codex CLI coding sessions from another agent.\n\nIt exposes both documented Codex CLI workflows:\n\n- Interactive terminal mode with `codex`, backed by a PTY so the agent can read output and send follow-up input.\n- Non-interactive automation mode with `codex exec`, useful for one-shot coding tasks and summaries.\n\n## Installation\n\n```bash\nnpx @cynosure-mcp/codex-terminal\n```\n\nOr install globally:\n\n```bash\nnpm install -g @cynosure-mcp/codex-terminal\ncodex-terminal\n```\n\n## Tools\n\n| Tool | Description |\n| ---- | ----------- |\n| `check_codex_cli` | Check whether the Codex CLI is available and report its version |\n| `codex_exec` | Run `codex exec` non-interactively and return stdout/stderr |\n| `start_codex_job` | Start `codex exec --json` in the background and return a job ID |\n| `resume_codex_job` | Resume a persisted Codex thread as another background job |\n| `read_codex_job` | Poll a background job, optionally from a previous output offset |\n| `stop_codex_job` | Gracefully stop a background job, escalating after five seconds |\n| `list_codex_jobs` | List background jobs retained by this MCP process |\n| `start_codex_session` | Start an interactive `codex` terminal session in a PTY |\n| `read_codex_session` | Read buffered output from an interactive session |\n| `send_codex_input` | Send text or control keys to an interactive session |\n| `stop_codex_session` | Stop one interactive session |\n| `list_codex_sessions` | List currently running interactive sessions |\n\n## Recommended agent workflow\n\nUse `start_codex_job` for coding tasks that may take more than a single MCP request timeout. It returns immediately with `jobId`, `running`, and `nextOffset`. Poll with `read_codex_job`, passing the last `nextOffset` as `since_offset` so only new JSONL events are returned. Continue until `running` is false, then inspect `exitCode` and the final events. Save the returned `threadId`; `resume_codex_job` can send follow-up work to that Codex thread, including after the MCP process restarts.\n\nJobs default to a two-hour hard timeout and may be configured up to 24 hours. On timeout or an explicit stop, the server sends SIGTERM and escalates to SIGKILL after five seconds. Finished jobs remain readable for 24 hours. In-memory job metadata and interactive PTYs end with the MCP server process; persisted Codex threads can still be continued afterward with `resume_codex_job` when the caller retained the `threadId`.\n\nUse `codex_exec` only for short one-shot tasks where blocking the MCP call is acceptable. Use an interactive session when Codex needs follow-up prompts or TUI commands.\n\n## Notes\n\nThe interactive session uses `--no-alt-screen` by default so terminal output is easier for MCP clients to capture. Use `send_codex_input` with `submit=true` to send a prompt to the Codex composer, or send control keys such as Ctrl+C. The default short delay between writing text and Enter avoids a Codex TUI paste/submit race.\n\nInteractive reads return `output_mode: \"clean\"` by default. This strips ANSI/control sequences, collapses adjacent duplicate lines, and limits cleaned output by both `max_lines` and `max_chars` so calling LLMs get the readable tail of the session instead of raw terminal redraw noise. Pass `output_mode: \"raw\"` to `start_codex_session`, `read_codex_session`, or `send_codex_input` when you need exact PTY bytes for debugging.\n\nBoth session reads and sends return `nextOffset`. Pass it back as `since_offset` on the next call to avoid repeating previously observed output. If the bounded 250,000-character buffer rolled over before a read, `droppedChars` reports the amount no longer available.\n\nCodex authentication is handled by your existing Codex CLI install. Run `codex login` outside this MCP if the CLI is not authenticated.\n\n## MCP Config\n\n```json\n{\n  \"mcpServers\": {\n    \"codex-terminal\": {\n      \"command\": \"npx\",\n      \"args\": [\"@cynosure-mcp/codex-terminal\"]\n    }\n  }\n}\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","homepage":"https://github.com/Cynosure-MCP-Collection/mcp-codex-terminal#readme","repository":{"url":"git+https://github.com/Cynosure-MCP-Collection/mcp-codex-terminal.git","type":"git"},"bugs":{"url":"https://github.com/Cynosure-MCP-Collection/mcp-codex-terminal/issues"}}