バージョン: 0.47.0-alpha.1
最終更新: 2025年10月10日
zapabob/codexをCursor IDEで使用するための完全なガイドや!
MCPサーバー経由でサブエージェント、カスタムコマンド、Hookシステムが使えるで〜💪
# 既にインストール済みの場合はスキップ
npm install -g @openai/codex
# または
.\global-install.ps1 # Windows PowerShellcodex --version
# => codex-cli 0.0.0
codex mcp-server --help
# => MCPサーバーのヘルプ表示{
"mcpServers": {
"codex": {
"command": "codex",
"args": ["mcp-server"],
"env": {},
"description": "Codex MCP Server with SubAgent, CustomCommand, and Hook support",
"disabled": false
}
}
}設定ファイルを作成したら、Cursorを再起動してや!
// 使用例
{
"tool": "codex",
"arguments": {
"prompt": "Implement a binary search function in Rust"
}
}{
"tool": "codex-supervisor",
"arguments": {
"goal": "Build a REST API with authentication",
"agents": ["CodeExpert", "SecurityExpert", "TestingExpert"],
"strategy": "parallel",
"format": "markdown"
}
}{
"tool": "codex-deep-research",
"arguments": {
"query": "Rust async runtime comparison",
"depth": 5,
"max_sources": 30,
"strategy": "comprehensive",
"format": "detailed"
}
}// タスクを開始
{
"tool": "codex-subagent",
"arguments": {
"action": "start_task",
"agent_type": "CodeExpert",
"task": "Analyze this code for potential bugs"
}
}
// 自動ディスパッチ(推奨)
{
"tool": "codex-subagent",
"arguments": {
"action": "auto_dispatch",
"task": "Review code for security vulnerabilities"
}
}
// 受信トレイチェック
{
"tool": "codex-subagent",
"arguments": {
"action": "check_inbox"
}
}
// 状態確認
{
"tool": "codex-subagent",
"arguments": {
"action": "get_status"
}
}
// 思考プロセス確認
{
"tool": "codex-subagent",
"arguments": {
"action": "get_thinking"
}
}
// トークンレポート
{
"tool": "codex-subagent",
"arguments": {
"action": "get_token_report"
}
}// コマンド一覧
{
"tool": "codex-custom-command",
"arguments": {
"action": "list"
}
}
// コマンド実行
{
"tool": "codex-custom-command",
"arguments": {
"action": "execute",
"command_name": "analyze_code",
"context": "fn main() { unsafe { ... } }"
}
}
// コマンド詳細
{
"tool": "codex-custom-command",
"arguments": {
"action": "info",
"command_name": "security_review"
}
}{
"tool": "codex-hook",
"arguments": {
"event": "on_task_complete",
"context": "Task finished successfully"
}
}{
"tool": "codex-reply",
"arguments": {
"conversation_id": "...",
"input": "Continue with the implementation"
}
}You: このコードをanalze_codeコマンドで分析して
Cursor (codex-custom-commandツールを呼び出し):
{
"tool": "codex-custom-command",
"arguments": {
"action": "execute",
"command_name": "analyze_code",
"context": "fn main() { ... }"
}
}
Result:
[CustomCommand] Executing: analyze_code
Dispatching to subagent: CodeExpert
...
The CodeExpert subagent will process this request asynchronously.
You: セキュリティレビューをしてほしい
Cursor (codex-custom-commandツールを呼び出し):
{
"tool": "codex-custom-command",
"arguments": {
"action": "execute",
"command_name": "security_review",
"context": "let password = user_input;"
}
}
Result:
[CustomCommand] Executing: security_review
Dispatching to subagent: SecurityExpert
...
You: データベースのパフォーマンスを最適化して
Cursor (codex-subagentツールを呼び出し):
{
"tool": "codex-subagent",
"arguments": {
"action": "auto_dispatch",
"task": "Optimize database query performance"
}
}
Result:
Auto-dispatching task...
Based on keyword analysis, this will be dispatched to the most appropriate subagent.
→ PerformanceExpertに自動ディスパッチ
# MCPサーバーを直接起動してテスト
codex mcp-server
# エラーログを確認
codex mcp-server --log-level debug- Cursorを再起動
.cursor/mcp.jsonの場所を確認(プロジェクトルート)- JSON構文エラーがないか確認
# サブエージェント状態を確認
{
"tool": "codex-subagent",
"arguments": {
"action": "get_status"
}
}| コマンド名 | サブエージェント | 説明 |
|---|---|---|
analyze_code |
CodeExpert | コード分析・改善提案 |
security_review |
SecurityExpert | セキュリティレビュー |
generate_tests |
TestingExpert | テストスイート生成 |
deep_research |
DeepResearcher | 深層研究 |
debug_issue |
DebugExpert | デバッグ・修正 |
optimize_performance |
PerformanceExpert | パフォーマンス最適化 |
generate_docs |
DocsExpert | ドキュメント生成 |
{
"tool": "codex-custom-command",
"arguments": {
"action": "list"
}
}{
"tool": "codex-custom-command",
"arguments": {
"action": "execute",
"command_name": "analyze_code",
"context": "your code here"
}
}{
"tool": "codex-subagent",
"arguments": {
"action": "check_inbox"
}
}codex-subagentツールで管理- 非ブロッキング処理
- 受信トレイパターン
codex-custom-commandツールで実行- ワンコマンドでサブエージェント呼び出し
- Pre/Post-hookサポート
codex-hookツールで実行- ライフサイクルイベント
- 自動通知
codex-deep-researchツールで実行- 多層リサーチ(1-10レベル)
- 3種類の戦略
codex-supervisorツールで実行- 複数エージェント並行処理
- 結果の自動マージ
Cursor IDEでzapabob/codexの全機能が使えるようになったで〜!🎉
✅ codex - 基本Codex
✅ codex-supervisor - マルチエージェント
✅ codex-deep-research - 深層研究
✅ codex-subagent ⭐ - サブエージェント管理
✅ codex-custom-command ⭐ - カスタムコマンド
✅ codex-hook ⭐ - Hookシステム
✅ codex-reply - セッション返信
Cursorでなんでもできるようになったで〜!💪✨