Connect AlgoVault to Codex
Give Codex a composite trade verdict in one call. Works in the Codex CLI and the IDE extension.
Config verified 2026-10-01 against https://learn.chatgpt.com/docs/extend/mcp.
Setup
Codex reads MCP servers from ~/.codex/config.toml. Add a table for AlgoVault:
[mcp_servers.algovault]
url = "https://api.algovault.com/mcp?src=docs"
bearer_token_env_var = "AV_API_KEY"
[mcp_servers.algovault.http_headers]
"X-AlgoVault-Track-Token" = "int-codex"
Set AV_API_KEY in your shell for paid tier. On free tier, delete the bearer_token_env_var line and keep the rest.
codex mcp add algovault --url "https://api.algovault.com/mcp?src=docs" adds the free tier from the CLI; the paid tier’s bearer_token_env_var is set in config.toml, as above.
IDE extension
Open settings, choose MCP servers, add a server, pick Streamable HTTP, and paste the same URL. The extension and the CLI read separate config, so set up whichever you use.
Example: get a BTC trade call
Run codex in a terminal and ask: “Use AlgoVault to check BTC at 4h.” Codex invokes get_trade_call and returns call, confidence, regime and the drivers behind them.
Chain it into edits: “If BTC 4h is BUY, add a long entry at the current bar in strategy.py.”
Pre-trade gate
The AlgoVault pre-trade gate runs in the Codex CLI through Codex’s hooks. While it is installed, Codex does not send an opening perpetual or futures order through an exchange’s MCP tools until pre_trade_check has recently checked that coin and side, and it blocks the order when the check returns WAIT.
git clone https://github.com/AlgoVaultLabs/algovault-skills.git
node algovault-skills/plugins/pre-trade-gate/scripts/install.mjs codex
Requires Node.js 20+. The gate holds no key and never calls AlgoVault itself: it reads the result of the pre_trade_check your agent runs through the server you connected above. Codex runs a new hook only once you trust it, so trust the gate’s two hooks when Codex next asks.
If the gate itself crashes or times out, Codex lets the order through: no Codex setting makes a failed hook block. The gate blocks an order on every error it can catch, and it never blocks an AlgoVault tool.
The gated order tools, a one-project install and how to remove it are in the README.
Troubleshooting
- AlgoVault tools not listed — restart Codex.
config.tomlis read at startup. 401 unauthorized— check the key shape (av_live_…). To try 20 calls without a key, removebearer_token_env_var.- TOML parse error — header names contain a hyphen, so they must stay quoted inside
[mcp_servers.algovault.http_headers]. - Network timeout — AlgoVault is hosted at
api.algovault.com. Check VPN or firewall rules.
FAQ
Free tier OK? Yes. Drop bearer_token_env_var: 20 calls a month without a key; a free key gives 200 (100/day), every coin and timeframe.
CLI and IDE together? Yes. They keep separate config, so add the block in both if you use both.
Does it need OAuth? No. AlgoVault takes a bearer token, or nothing at all on free tier.
Which tools appear? The same set every client gets, including get_trade_call, scan_funding_arb and get_market_regime.
Next steps
Ask Codex for a verdict before your next entry. Verify the track record on-chain.