semvec/pypi-packages huggingface dataset:
codex-mcp-agent 0.1.0
MCP server that provides agent capability backing by codex CLI
Requires Python: >=3.11
Keywords: agent, codex, mcp

# codex-mcp-agent

[中文版](./README.zh-CN.md)

Note: This project is a fork of the current Git remote:

- origin: https://github.com/1WorldCapture/codex-as-mcp

Enable Claude Code, Cursor and other AI tools to call Codex for task execution. Plus/Pro/Team subscribers can maximize GPT-5 usage without additional costs.

## Setup

### 1. Install Codex CLI
```bash
npm install -g @openai/codex
codex login
```

### 2. Configure MCP

Add to your `.mcp.json`:
**Safe Mode (Default):**
```json
{
  "mcpServers": {
    "codex": {
      "type": "stdio",
      "command": "uvx",
      "args": ["codex-mcp-agent@latest"]
    }
  }
}
```

**Writable Mode:**
```json
{
  "mcpServers": {
    "codex": {
      "type": "stdio",
      "command": "uvx",
      "args": ["codex-mcp-agent@latest", "--yolo"]
    }
  }
}
```

Or use Claude Code commands:
```bash
# Safe mode (default)
claude mcp add codex-mcp-agent -- uvx codex-mcp-agent@latest

# Writable mode
claude mcp add codex-mcp-agent -- uvx codex-mcp-agent@latest --yolo
```

## Tools

The MCP server exposes two tools:
- `codex_execute(prompt, work_dir)` - General purpose codex execution
- `codex_review(review_type, work_dir, target?, prompt?)` - Specialized code review

If you have any other use case requirements, feel free to open issue.

## HTTP/SSE Mode (Optional)

For local personal use, you can run the server over HTTP with Server-Sent Events (SSE) and connect via `type: "sse"`.

Start the server in SSE mode:
```bash
uvx codex-mcp-agent@latest --sse            # safe mode, localhost:8822
uvx codex-mcp-agent@latest --sse --yolo     # writable mode

# Options
#   --host  (default: 127.0.0.1)
#   --port  (default: 8822)
```

Configure your client `.mcp.json`:
```json
{
  "mcpServers": {
    "codex": {
      "type": "sse",
      "url": "http://127.0.0.1:8822"
    }
  }
}
```

Notes:
- SSE mode keeps the same Safe/Writable behavior controlled by `--yolo`.
- SSE server binds to `127.0.0.1` by default and has no auth/CORS for simplicity.
- Stdio mode remains the default; use `--sse` only if you prefer HTTP.

Optional: Streamable HTTP transport (if your client supports it):
```bash
uvx codex-mcp-agent@latest --http           # safe mode streamable-http transport
```

## Safety

- **Safe Mode**: Default read-only operations protect your environment
- **Writable Mode**: Use `--yolo` flag when you need full codex capabilities
- **Sequential Execution**: Prevents conflicts from parallel agent operations
scoped-context 0.0.1
Use contexts (`with` statements) to manage scopes.
Requires Python: >=3.9

# scoped-context

[![PyPI](https://img.shields.io/pypi/v/scoped-context)](https://pypi.org/project/scoped-context/)
![PyPI - License](https://img.shields.io/pypi/l/scoped-context)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/scoped-context)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
![PyPI - Downloads](https://img.shields.io/pypi/dm/scoped-context)

`scoped-context` helps manage scopes using context managers in Python.

## Installation

```bash
pip install scoped-context
```

or

```bash
uv add scoped-context
```

## Usage

Get the context stack and current context of a specific class:

```python
from scoped_context import ScopedContext

class A(ScopedContext):
    pass

with A() as a1:
    print(A.context_stack())  # -> `[a1]`
    print(A.current())  # -> `a1`

    with A() as a2:
        print(A.context_stack())  # -> `[a1, a2]`
        print(A.current())  # -> `a2`

    print(A.context_stack())  # -> `[a1]`
    print(A.current())  # -> `a1`

print(A.context_stack())  # -> `[]`
print(A.current())  # -> raises scoped_context.NoContextError
```

You can mix different subclasses of `ScopedContext`, and access the class-wide context:

```python
from scoped_context import ScopedContext, get_current_context, get_context_stack

class A(ScopedContext):
    pass

class B(ScopedContext):
    pass

class C(ScopedContext):
    pass

with A() as a1:
    with B() as b1:
        with C() as c1:
            # class-wide context
            print(get_context_stack())  # -> `[a1, b1, c1]`
            print(get_current_context())  # -> `c1`

            # You can specify classes (recommended)
            print(get_context_stack((A, B)))  # -> `[a1, b1]`
            print(get_current_context((A, B)))  # -> `b1`

            # class-specific context
            print(A.context_stack())  # -> `[a1]`
            print(A.current())  # -> `a1`
            print(B.context_stack())  # -> `[b1]`
            print(B.current())  # -> `b1`
            print(C.context_stack())  # -> `[c1]`
            print(C.current())  # -> `c1`
```