Skip to main content
Glama
README.md
<div align="center">

# codex-bridge

**Zero-dependency MCP server & CLI to search, incrementally read, monitor, and hand off local OpenAI Codex sessions across AI agents.**

[![CI](https://github.com/WWandP/codex-bridge/actions/workflows/ci.yml/badge.svg)](https://github.com/WWandP/codex-bridge/actions/workflows/ci.yml)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-3776AB.svg?logo=python&logoColor=white)](https://www.python.org/)
[![Dependencies: Zero](https://img.shields.io/badge/dependencies-zero-10B981.svg)](#)
[![License: MIT](https://img.shields.io/badge/license-MIT-6366F1.svg)](LICENSE)

**English** | [简体中文](README_CN.md)

</div>

<p align="center">
  <img src="docs/images/codex_bridge_hero.jpg" alt="codex-bridge dual-agent workflow" width="100%" />
</p>

## Why

**OpenAI Codex** is great at heavy engineering work, but its **defensive communication** (*"Note: this does not necessarily mean..."*, endless caveats) and huge raw JSONL logs make it tiring to read directly.

**The idea**: let Codex focus on execution, and use **Antigravity (AGY)**, **Claude Code**, or **Cursor** as your straight-talking hub agent. `codex-bridge` connects them locally with zero third-party dependencies.

## Features & How It Works

```mermaid
flowchart LR
    C[OpenAI Codex<br/>Local / Remote SSH] -- "~/.codex/*.jsonl" --> B[codex-bridge<br/>Index · Filter · Compact]
    B -- "MCP (incremental)" --> H[Hub Agent<br/>AGY / Claude / Cursor]
    H -- "handoff (codex queue)" --> C
```

- **Clean & Compact**: Turns noisy Codex logs into token-efficient transcripts with automatic branch, commit, file, and error extraction.
- **Incremental Sync**: Fetches only new turns (`only_new`) and scopes metadata to the requested slice — no re-reading history.
- **Fast Search & Digests**: Local SQLite FTS5 search with optional custom synonyms and persistent session summaries.
- **Live Status & Handoff**: Lightweight `running`/`idle` status checks plus one-step task handoff back to Codex via `codex queue`.

## Quick Start

```bash
git clone https://github.com/WWandP/codex-bridge.git
cd codex-bridge
python3 codex_sessions_mcp.py --status
```

### Connect to Your MCP Client

**Antigravity (`agy`)**
```bash
agy mcp add codex-bridge /usr/bin/python3 /path/to/codex-bridge/codex_sessions_mcp.py
```

**Claude Code**
```bash
claude mcp add codex-bridge -- python3 /path/to/codex-bridge/codex_sessions_mcp.py
```

**Cursor / Windsurf / Generic `mcp_config.json`**
```json
{
  "mcpServers": {
    "codex-bridge": {
      "command": "python3",
      "args": ["/path/to/codex-bridge/codex_sessions_mcp.py"]
    }
  }
}
```

### CLI Shortcuts

```bash
python3 codex_sessions_mcp.py --session-status latest   # Check running/idle & latest commit
python3 codex_sessions_mcp.py --search "keyword"        # Search past sessions
python3 codex_sessions_mcp.py --read latest --last-turns 3
python3 codex_sessions_mcp.py --read latest --export recap.md
```

> Want a ready-to-use agent workflow prompt? See [`examples/skill/SKILL.md`](examples/skill/SKILL.md).

## Contributors

- [@WWandP](https://github.com/WWandP) — Creator & maintainer
- **Antigravity (Google DeepMind)** — Co-developer & design collaborator

## License

MIT © [WWandP](https://github.com/WWandP)