3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Codex on VSCodeが上手く起動しない問題の解消

Posted at

発生事象

開発環境

  • VSCodeのバージョン
    • バージョン: 1.103.2 (Universal)
    • Electron: 37.2.3
    • Node.js: 22.17.0
    • OS: Darwin arm64 24.5.0
  • Codexのバージョン
    • 0.4.6

原因

  • CodexのMCP設定ファイルである config.toml において、他コーディングエージェントで使っていた .mcp.json をそのままコピーして放置していたため
  • これが原因で拡張機能そのものに影響を与えていた

対処法

  • CodexのMCP設定を正しくtoml形式で行う
  • 参考ドキュメントは以下

今回なぜこんなことになったかというと、config.tomlにMCP設定のjsonを置いておき、それをCodex自身に編集させようと思ったんですよね。
そうするとCodexへリクエストが投げられなくなり、挙句の果てにはCodexが起動すらしなくなって途方に暮れていました。

そんな時にGPT-5 Thinkingが解決案の1つとして教えてくれたのが、config.tomlにjsonが入っているとエラーになるケースが有るということでした。

ということでtoml形式に直して設定すると、問題なく使えるようになりましたとさ。

CodexがjsonでMCP設定できるようにしてくれてたらこんなことにはなってねーんだぞ!!

ちなみに当然Issueは上がってるものの、「jsonからtomlには簡単に変えられるよ^^」みたいなリプライがついてたので対応する気無いのかもしれない。しらんけど。

tips: config.tomlの編集を行う

ちなみにconfig.tomlをVSCode上で開きたいけどCodexがそもそも立ち上がってこない場合、以下コマンドでいけます。

ターミナル
$ code ~/.codex/config.toml

Macbookでcodeコマンドが使えない場合は以下記事参照。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?