PacketStream integration
Add PacketStream web search to Codex CLI
Connect Codex CLI to PacketStream's remote MCP server with a bearer-token variable, then check the tools, approvals, and your API key.
Give Codex CLI live Google results and readable web pages through PacketStream’s remote MCP server. Codex reads your API key from an environment variable and sends it as the bearer token. The MCP server is in early beta.
Configure
Create an API key on the MCP page of the dashboard, then set the variable to the bare key and register the server:
export PACKETSTREAM_API_KEY="YOUR_API_KEY"
codex mcp add packetstream --url https://api.packetstream.io/v1/mcp \
--bearer-token-env-var PACKETSTREAM_API_KEY
The command writes this table to ~/.codex/config.toml, which you can also edit by hand:
[mcp_servers.packetstream]
url = "https://api.packetstream.io/v1/mcp"
bearer_token_env_var = "PACKETSTREAM_API_KEY"
Add the export line to your shell profile. While the variable is unset where Codex starts, Codex does not start the server, so your agent has no PacketStream tools and no error that explains why.
Check it works
- Run
codex mcp list. It shows the savedpacketstreamentry but does not test the connection. - Start
codexand run/mcp, which shows your active MCP servers.packetstreamshould be among them. - Check the key on its own with the free key check:
curl -sS https://api.packetstream.io/v1/account \
-H "Authorization: Bearer $PACKETSTREAM_API_KEY"
A working key returns your balance as JSON. A missing or wrong key returns HTTP 401 with the code unauthorized.
Then ask Codex to search for something current. It should call packetstream_search.
Tool approvals
Codex asks before it runs an MCP tool. With approval_policy = "never" it cannot ask, so it refuses every PacketStream call with MCP tool call requires approval, but approval policy is never. That refusal happens inside Codex, so the call never reaches PacketStream and is not billed.
To let the tools run without asking, add this line to the [mcp_servers.packetstream] table. Every successful call is billed:
default_tools_approval_mode = "approve"
To approve one tool only, give it its own table instead:
[mcp_servers.packetstream.tools.packetstream_search]
approval_mode = "approve"
Troubleshooting
- The tool result says
missing_api_key. The MCP server does not answer a missing key with HTTP 401. The tool call returns an error result that the agent reads and passes on. SetPACKETSTREAM_API_KEYwhere Codex starts and restart Codex. invalid_api_key. The variable holds something other than a PacketStream key, such as theYOUR_API_KEYplaceholder or a value withBearerin front. Set it to the bare key; Codex addsBeareritself.unauthorized. The key was revoked or replaced on the dashboard. Create a new key and update the variable.- Codex shows no PacketStream tools. The variable named in
bearer_token_env_varis not set where Codex starts. Apps that read the sameconfig.toml, such as the ChatGPT desktop app, see it only if it is in their own launch environment. - Tool filters stopped matching after an update. Version 1.3.0 renamed
web_searchandweb_fetchtopacketstream_searchandpacketstream_fetch. Update anyenabled_tools,disabled_tools, or per-tool approval entry that names the old tools.
See MCP client troubleshooting for the other error results.