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

  1. Run codex mcp list. It shows the saved packetstream entry but does not test the connection.
  2. Start codex and run /mcp, which shows your active MCP servers. packetstream should be among them.
  3. 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. Set PACKETSTREAM_API_KEY where Codex starts and restart Codex.
  • invalid_api_key. The variable holds something other than a PacketStream key, such as the YOUR_API_KEY placeholder or a value with Bearer in front. Set it to the bare key; Codex adds Bearer itself.
  • 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_var is not set where Codex starts. Apps that read the same config.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_search and web_fetch to packetstream_search and packetstream_fetch. Update any enabled_tools, disabled_tools, or per-tool approval entry that names the old tools.

See MCP client troubleshooting for the other error results.

Ready to give Codex live web results? Create an account, add funds, and create the API key on the MCP page of the dashboard.
Create account