MCP Codex CLI logo

MCP Codex CLI

Community
suwa-sh

OpenAI の Codex CLI のシンプルな MCP サーバーラッパーです。AI アシスタントが Model Context Protocol を通じて Codex の機能を使用できるようにします。

Publishersuwa-sh
Repositorymcp-codex-cli
LanguageTypeScript
Forks
2
Stars
12
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MCP Codex CLI exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    12 stars and 2 forks from the linked repository.

MCP Codex CLI

npm version Publish to npm

OpenAI の Codex CLI のシンプルな MCP サーバーラッパーです。AI アシスタントが Model Context Protocol を通じて Codex の機能を使用できるようにします。

前提条件

  • OpenAI API キーまたは ChatGPT Plus/Pro/Team アカウント
  • Node.js 22+(Codex CLI の要件)
  • --allow-npx オプションで、Codex CLI をローカルにインストールせずに利用できます

🚀 Quick Start with Claude Code

1. Add the MCP server

bash
claude mcp add -s project codex-cli -- npx mcp-codex-cli --allow-npx

🔧 Installation Options

Option 1: NPX with allow-npx flag (推奨)

json
{
  "mcpServers": {
    "mcp-codex-cli": {
      "command": "npx",
      "args": ["mcp-codex-cli", "--allow-npx"]
    }
  }
}

🛠️ Available Tools

chat

あらゆるコーディングタスクを非インタラクティブモードで実行します。

パラメータ:

  • prompt(必須):実行するタスクの説明
  • approvalLevel(オプション):"auto-edit"(ファイル読み取り/書き込み、デフォルト)、"full-auto"(完全自動)
  • model(オプション):使用するモデル(デフォルト:"gpt-5")
  • workingDir(オプション):タスク用の作業ディレクトリ

💡 Example Usage

chat

typescript
// コンポーネントのリファクタリング
chat({ 
  prompt: "UserDashboard コンポーネントをクラスコンポーネントの代わりに React hooks を使うようリファクタリング",
  approvalLevel: "auto-edit",
  workingDir: "./src/components"
});

// コード分析
chat({
  prompt: "./src/utils/auth.ts ファイルで JWT トークンのバリデーションはどのように動作しますか?"
});

// デバッグ
chat({
  prompt: "TypeError: Cannot read property 'length' of undefined というエラーがフォーム送信時のユーザー入力バリデーション関数で発生しています。./src/components/UserForm.tsx を確認してデバッグしてください。"
});

// コード生成
chat({
  prompt: "バリアント(primary、secondary、danger)とサイズ(small、medium、large)を持つ再利用可能な Button コンポーネントを TypeScript + React で ./src/components/Button.tsx に作成してください",
  model: "gpt-5"
});

⚙️ Configuration

Environment Variables

Codex CLI の認証を設定:

bash
# オプション1:OpenAI API キー
export OPENAI_API_KEY=your_api_key_here

# オプション2:ChatGPT アカウントを使用
# --allow-npx使用時は初回実行時に自動でサインインプロンプトが表示されます
# ローカルインストール時は以下を実行:
codex auth login

--allow-npx オプション

--allow-npx フラグを使用すると:

  • Codex CLI をローカルにインストールする必要がありません
  • 自動的に npx @openai/codex を使用して実行します
  • 信頼されていないディレクトリでも動作します(--skip-git-repo-check を自動追加)
  • 常に最新バージョンのCodex CLIを使用できます

Default Model

すべてのツールは gpt-5 をデフォルトモデルとして使用します(Codex CLI の現在のデフォルト)。任意のツール呼び出しで model パラメータを指定してこれを上書きできます:

  • gpt-5(デフォルト)
  • gpt-4.1
  • gpt-4.1-mini
  • o1
  • o1-mini

Approval Levels

  • auto-edit:ファイルの読み取りと書き込み;シェルコマンドには承認が必要(デフォルト)
  • full-auto:完全に自動実行(注意して使用)

🚨 トラブルシューティング

"Not inside a trusted directory" エラー

--allow-npx オプションを使用していればこのエラーは自動的に回避されます。手動で解決する場合:

bash
# 信頼できるディレクトリとしてマーク
codex trust .

# または--skip-git-repo-checkを使用
codex --skip-git-repo-check exec "your task"

認証エラー

bash
# OpenAI API キーを設定
export OPENAI_API_KEY=your_api_key_here

# またはChatGPTアカウントでログイン
codex auth login

🔗 Related Links

Installation

TypingMind
{
  "mcpServers": {
    "mcp-codex-cli": {
      "command": "npx",
      "args": [
        "mcp-codex-cli",
        "--allow-npx"
      ]
    }
  }
}

Use MCP Codex CLI MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCP Codex CLI is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MCP Codex CLI as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MCP Codex CLI MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mcp-codex-cli": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-codex-cli"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCP Codex CLI MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MCP Codex CLI MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCP Codex CLI to help me with this task?
MCP Codex CLI
Sure. I read it.
Here is what I found using MCP Codex CLI.

Frequently asked questions

What is the MCP Codex CLI MCP server used for?

MCP Codex CLI is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MCP Codex CLI MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCP Codex CLI with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MCP Codex CLI MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MCP Codex CLI connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCP Codex CLI MCP to TypingMind?

MCP Codex CLI runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MCP Codex CLI MCP provide in TypingMind?

MCP Codex CLI exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MCP Codex CLI MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCP Codex CLI requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇