This folder is safe to publish separately from the private app repo. It contains the portable Codex skill package plus MCP setup snippets for other clients.
Important
The llm-cost-optimizer-mcp folder is a Codex skill. Cursor, Claude, Antigravity, and most other MCP clients do not install Codex skills directly. They connect to the MCP server over HTTP instead.
skill.json: repo-level metadata for the public skill packagellm-cost-optimizer-mcp/: the Codex skill folder that users install
The MCP endpoint is already fixed to the deployed production server. Users only need a bearer token.
- Required from user:
PROMPT_OPTIMIZER_MCP_API_KEY - Fixed server endpoint used by all examples:
https://llmcostoptimizer.com/api/mcp
Check whether Codex CLI is already installed:
command -v codex
codex --helpGet-Command codex -ErrorAction SilentlyContinue
codex --helpIf codex is not found, install it first.
npm install -g @openai/codex
command -v codex
codex --helpnpm install -g @openai/codex
Get-Command codex -ErrorAction SilentlyContinue
codex --helpManual install on Windows PowerShell:
$repoUrl = "https://github.com/<owner>/<repo>.git"
$tmpDir = Join-Path $env:TEMP "llm-cost-optimizer-mcp-skill"
if (Test-Path $tmpDir) { Remove-Item -LiteralPath $tmpDir -Recurse -Force }
git clone $repoUrl $tmpDir
New-Item -ItemType Directory -Force (Join-Path $HOME ".codex\skills") | Out-Null
Copy-Item -LiteralPath (Join-Path $tmpDir "llm-cost-optimizer-mcp") -Destination (Join-Path $HOME ".codex\skills\llm-cost-optimizer-mcp") -Recurse -ForceRegister the MCP server in Codex:
export PROMPT_OPTIMIZER_MCP_API_KEY="your_bearer_token_here"
codex mcp add llm-cost-optimizer --url https://llmcostoptimizer.com/api/mcp --bearer-token-env-var PROMPT_OPTIMIZER_MCP_API_KEY$env:PROMPT_OPTIMIZER_MCP_API_KEY = "your_bearer_token_here"
codex mcp add llm-cost-optimizer --url https://llmcostoptimizer.com/api/mcp --bearer-token-env-var PROMPT_OPTIMIZER_MCP_API_KEYFor new VS Code or Codex sessions on Windows, persist the token at user scope and restart the app after setting it:
[Environment]::SetEnvironmentVariable("PROMPT_OPTIMIZER_MCP_API_KEY", "your_bearer_token_here", "User")set PROMPT_OPTIMIZER_MCP_API_KEY=your_bearer_token_here
codex mcp add llm-cost-optimizer --url https://llmcostoptimizer.com/api/mcp --bearer-token-env-var PROMPT_OPTIMIZER_MCP_API_KEYIf npm install -g @openai/codex succeeds but codex is still not found, restart the terminal or add your npm global bin directory to PATH.
codex mcp add llm-cost-optimizer --url https://llmcostoptimizer.com/api/mcp --bearer-token-env-var PROMPT_OPTIMIZER_MCP_API_KEYAdd this to ~/.cursor/mcp.json or your project .cursor/mcp.json:
{
"mcpServers": {
"llm-cost-optimizer": {
"url": "https://llmcostoptimizer.com/api/mcp",
"headers": {
"Authorization": "Bearer ${env:PROMPT_OPTIMIZER_MCP_API_KEY}"
}
}
}
}Optional verification:
cursor-agent mcp listRegister the remote MCP server:
claude mcp add --transport http --scope user --header "Authorization: Bearer ${PROMPT_OPTIMIZER_MCP_API_KEY}" llm-cost-optimizer https://llmcostoptimizer.com/api/mcpProject-scoped alternative in .mcp.json:
{
"mcpServers": {
"llm-cost-optimizer": {
"type": "http",
"url": "https://llmcostoptimizer.com/api/mcp",
"headers": {
"Authorization": "Bearer ${PROMPT_OPTIMIZER_MCP_API_KEY}"
}
}
}
}Edit the raw MCP config file:
- macOS/Linux:
~/.gemini/antigravity/mcp_config.json - Windows:
C:\\Users\\<USERNAME>\\.gemini\\antigravity\\mcp_config.json
{
"mcpServers": {
"llm-cost-optimizer": {
"serverUrl": "https://llmcostoptimizer.com/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_PROMPT_OPTIMIZER_MCP_API_KEY"
}
}
}
}Any client that supports remote streamable HTTP MCP can reuse the same production endpoint and bearer token. Configure:
- URL:
https://llmcostoptimizer.com/api/mcp - Header:
Authorization: Bearer <token>