Codex supports Streamable HTTP MCP servers with bearer authentication. TokConnect uses that transport at https://mcp.tokconnect.com/mcp. Get your key from TokConnect, then place it in the environment that starts Codex.

Add a Codex server

OpenAI documents MCP server tables in ~/.codex/config.toml. Add this entry to make TokConnect available across your local Codex clients.

[mcp_servers.tokconnect]
url = "https://mcp.tokconnect.com/mcp"
bearer_token_env_var = "TOKCONNECT_TOKEN"
enabled = true

Set TOKCONNECT_TOKEN before you launch Codex. A shell export is suitable for a one-session check:

export TOKCONNECT_TOKEN="YOUR_TOKCONNECT_KEY"
codex

Codex sends the value from bearer_token_env_var as a bearer token in the Authorization header. Keep the secret out of config.toml, prompts, and shared project files. A project-specific .codex/config.toml can also define an MCP server, but OpenAI limits that configuration to trusted projects.

Choose the configuration boundary

FileScopeUse it for
~/.codex/config.tomlYour machineA personal TokConnect entry used across trusted workspaces.
.codex/config.tomlOne projectA team-shared server definition that uses bearer_token_env_var, never a literal key.

Do not create both entries while diagnosing a first connection. Codex needs to read the intended table, and two entries with the same name make it harder to identify which one supplied the URL. Start with the user file, verify the server, then add a project file only if the repository needs a documented shared definition.

The shared MCP connection sequence. Client-specific steps and verification notes follow.
The shared MCP connection sequence. Client-specific steps and verification notes follow.

Use the environment that runs Codex

OpenAI documents a shared MCP configuration across the desktop app, Codex CLI, and the IDE extension, though each surface can need a restart before it discovers a new server. The token variable must exist in the process environment of the client you open. For the first check, launch the CLI from the shell where you exported it. For Desktop or an IDE, configure the variable through the operating system or secret-management path used by that client, then restart that surface. The documentation specifies the environment-variable reference but does not prescribe one cross-platform persistence command.

Confirm the connection

In Codex CLI, run codex mcp list, or type /mcp in an interactive session. In the desktop app or IDE extension, open the MCP server settings and verify that tokconnect is enabled. You should see tool names such as keyword_research, search_topics, search_videos, and video_comments.

Call search_topics with keyword “walking pad,” language “en,” and limit 3. Return queryText, queryId, popularity, searchVolume, videoCount, hasMore, and nextOffset.

The editorial MCP environment returned three records, hasMore: true, and nextOffset: 3. Its first record was “what is a walking pad,” query ID 10526826. See the protocol fixture. This output came from a configured MCP tool, not Codex.

The second record in that response had query text “walking pad and walking reviews,” popularity 85, search volume 2,485,656, and video count 704. Those values are an example of the response shape, not a recommendation to pursue that phrase. If you need more rows, call the same tool with the returned nextOffset. Keep the original keyword and language fixed while paginating so the offsets describe one result set.

Diagnose the result

ResultMeaningAction
Server absent from /mcpCodex did not read the intended configuration.Check the table name, restart the client, and use codex mcp list.
401 responseTokConnect received no usable bearer token.Check the variable name, copy a fresh key, then relaunch the same Codex client.
Tools appear, request returns no dataConnection and discovery completed.Refine the query or language. Treat it as a research result, not a connection failure.
Codex asks for tool approvalThe client is applying its tool-approval policy.Review the requested input and approve the read-only research call if it matches your intent.

Edit or remove the server deliberately

Close Codex, edit the one TOML table that supplied the server, and reopen the same surface. To disable access temporarily, remove or comment out the table rather than replacing the token value with a placeholder that can later be mistaken for a real credential. After reopening, use codex mcp list or /mcp to confirm that tokconnect is absent. If you maintain a project configuration, remove its table as well before assuming the server was removed.

A tool approval is a client decision, separate from TokConnect authentication. Read its parameters before you authorize the call. The first topic request should contain only the keyword, language, and a small limit. Once it completes, send the selected query ID into the relevant content-calendar workflow rather than repeating discovery calls in an attempt to generate a plan.

OpenAI's official MCP documentation covers the configuration fields and client surfaces. Use TokConnect troubleshooting if the first call produces an error or an empty result.

The TikTok MCP guide maps the available research tools. Use the results in a content-calendar workflow after you select a topic.

Sources and further reading