mcpField
C
Codex MCP Wrapper

Codex MCP Wrapper

Local
teabranch.github.ioDeveloper Tools45Updated 70w ago

About Codex MCP Wrapper

Codex MCP Wrapper exposes the OpenAI Codex CLI as an MCP server, reached through the open-responses-server middleware. It targets developers who want Codex to run repository tasks in a controlled way.

Key features

  1. 01Clone repository and run Codex
  2. 02Optional branch and folder selection
  3. 03Prompt and model read from .agent directory
  4. 04Stdio and SSE transport support
  5. 05Docker-based startup option

Use cases

  1. 01Asking Codex to review a repository and suggest improvements
  2. 02Running coding tasks on a specific branch or subfolder
  3. 03Setting a shared model and system prompt through .agent files

MCP support

The server exposes the run_codex and clone_and_write_prompt tools so MCP clients can run Codex CLI against repository requests.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

image

Agentic Developer MCP

This project wraps OpenAI's Codex CLI as an MCP (Model Context Protocol) server, making it accessible through the TeaBranch/open-responses-server middleware.
This engine may be replaced with OpenCode or Amazon Strands

Requirements

  • Node 22 (nvm install 22.15.1 | nvm use 22.15.1) required for Codex

Overview

The setup consists of three main components:

  1. Codex CLI: OpenAI's command-line interface for interacting with Codex.
  2. MCP Wrapper Server: A Node.js Express server that forwards MCP requests to Codex CLI and formats responses as MCP.
  3. open-responses-server: A middleware service that provides Responses API compatibility and MCP support.

Installation

Using Docker (Recommended)
# Clone this repository
git clone https://github.com/yourusername/codex-mcp-wrapper.git
cd codex-mcp-wrapper

# Start the services
./start.sh

This will start:

  • Codex MCP wrapper on port 8080
  • open-responses-server on port 3000
Manual Installation
# Install dependencies
npm install

# Install Codex CLI globally
npm install -g @openai/codex

# Start the MCP server
node mcp-server.js
# Install the package in development mode
pip install -e .

Usage

You can run the MCP server using either stdio or SSE transport:

# Using stdio (default)
python -m mcp_server

# Using SSE on a specific port
python -m mcp_server --transport sse --port 8000

Tool Documentation

run_codex

Clones a repository, checks out a specific branch (optional), navigates to a specific folder (optional), and runs Codex with the given request.

Parameters
  • repository (required): Git repository URL
  • branch (optional): Git branch to checkout
  • folder (optional): Folder within the repository to focus on
  • request (required): Codex request/prompt to run
Example
{
  "repository": "https://github.com/username/repo.git",
  "branch": "main",
  "folder": "src",
  "request": "Analyze this code and suggest improvements"
}
clone_and_write_prompt

Clones a repository, reads the system prompt from .agent/system.md, parses modelId from .agent/agent.json, writes the request to a .prompt file, and invokes the Codex CLI with the extracted model.

Parameters
  • repository (required): Git repository URL
  • request (required): Prompt text to run through Codex
  • folder (optional, default /): Subfolder within the repository to operate in
Example
{
  "repository": "https://github.com/username/repo.git",
  "folder": "src",
  "request": "Analyze this code and suggest improvements"
}
MCPS Configuration

Place a mcps.json file under the .agent/ directory to register available MCP tools. Codex will load this configuration automatically.

Example .agent/mcps.json:

{
  "mcpServers": {
    "agentic-developer-mcp": {
      "url": "..."
    }
  }
}

Development

This project uses the MCP Python SDK to implement an MCP server. The primary implementation is in mcp_server/server.py.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.