Add real Codex TOML setup guide to MCP Endpoints page

The Codex tab previously showed "coming soon" for every client except
Claude. Codex uses a simpler config format than Claude's JSON — the API
key goes directly in the URL as a query param under [mcp_servers.<name>]
in ~/.codex/config.toml, no separate headers section. Generates the block
with the logged-in user's real MCP URL and API key, matching the pattern
already used for the Claude tab.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
MOHAN 2026-07-02 00:45:23 +05:30
parent 739740bb4b
commit 91a7c8ee80

View File

@ -39,6 +39,8 @@ export default function Endpoints() {
},
}, null, 2);
const codexToml = `[mcp_servers.odoo-mcp]\nurl = "${MCP_URL}?api_key=${apiKey || 'your-api-key-here'}"\n`;
return (
<div className="max-w-4xl space-y-6">
<div>
@ -110,7 +112,24 @@ export default function Endpoints() {
</p>
</div>
)}
{activeSetup !== 'claude' && (
{activeSetup === 'codex' && (
<div>
<p className="text-xs text-gray-600 mb-3">
Add this to your Codex config (<code className="bg-gray-100 px-1 py-0.5 rounded text-[11px]">~/.codex/config.toml</code>, or a project-level <code className="bg-gray-100 px-1 py-0.5 rounded text-[11px]">.codex/config.toml</code>):
</p>
<div className="relative bg-gray-900 rounded-xl p-4">
<pre className="text-green-400 text-xs overflow-x-auto font-mono">{codexToml}</pre>
<button onClick={() => copy(codexToml, () => {})}
className="absolute top-3 right-3 text-gray-400 hover:text-white p-1">
<Copy size={13} />
</button>
</div>
<p className="text-xs text-gray-500 mt-3">
Each <code className="bg-gray-100 px-1 py-0.5 rounded text-[11px]">[mcp_servers.&lt;name&gt;]</code> block defines one MCP server. Codex accepts the API key directly as a <code className="bg-gray-100 px-1 py-0.5 rounded text-[11px]">?api_key=</code> query param on the URL no separate headers section needed. Restart Codex after saving for it to pick up the new server.
</p>
</div>
)}
{activeSetup !== 'claude' && activeSetup !== 'codex' && (
<div className="bg-gray-50 rounded-xl p-4 text-xs text-gray-500 text-center">
Setup guide for {AI_CLIENTS.find(c => c.setup === activeSetup)?.name} coming soon.
</div>