AgentAvow·DocsCheck a tool

Codex MCP setup: codex mcp add, config.toml, and checking a server first

AgentAvow Docs · agentavow.com

Codex connects to MCP servers you add with codex mcp add or list in ~/.codex/config.toml. A server you add can read what Codex sends it and run with your permissions, so check it before you add it. This page covers both: the commands, and how to check a server first.

Check the server first

Before you run codex mcp add, look the server up. You get Safe to connect, Review before you connect or Do not connect, with the reason and a signed 0-100 trust score. No account needed.

into agentavow.com/check.

npx agentavow-trust scan npm:@upstash/context7-mcp
npx agentavow-trust scan owner/repo

"Is the npm package @upstash/context7-mcp safe to connect?"

a codex mcp add that Codex runs for you is checked first and stopped when the answer is Do not connect.

Add a local server (stdio)

A local server is a command Codex starts. Put the command after --:

codex mcp add context7 -- npx -y @upstash/context7-mcp

Pass environment variables with --env. You can repeat it:

codex mcp add myserver --env API_KEY=your-key --env REGION=eu -- npx -y some-mcp-server

Add a remote server (URL)

A remote server is a streamable HTTP URL:

codex mcp add agentavow --url https://agentavow.com/mcp

If the server wants a bearer token, keep the token in an environment variable and name the variable, not the token:

codex mcp add myserver --url https://mcp.example.com/mcp --bearer-token-env-var MY_SERVER_TOKEN

If the server signs you in with OAuth, run codex mcp login myserver after you add it. codex mcp logout myserver removes the stored sign-in.

The same thing in config.toml

codex mcp add writes to ~/.codex/config.toml. You can edit that file yourself. Each server is a [mcp_servers.<name>] table.

A local server:

[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]

A remote server:

[mcp_servers.agentavow]
url = "https://agentavow.com/mcp"

Other keys you may want:

KeyWhat it does
envEnvironment variables for a local server
bearer_token_env_varThe variable that holds a remote server's bearer token
enabledSet to false to turn a server off without deleting it
enabled_tools, disabled_toolsOnly allow some tools, or block some
startup_timeout_sec, tool_timeout_secTimeouts (defaults 10 and 60 seconds)

To use a server in one project only, put the table in that project's .codex/config.toml. Codex reads it only in trusted projects. The Codex CLI, the IDE extension and the ChatGPT desktop app share this configuration.

See what's connected

codex mcp list
codex mcp get context7

Inside Codex, type /mcp to see the active servers. To remove one:

codex mcp remove context7

Check servers you already have

A server can change after you add it: a new release, or new tool descriptions. Run codex mcp list, then check each one the same way as above. The AgentAvow plugin for Codex does this each time a Codex CLI session starts. Use AgentAvow in Codex covers the connector, the skill and the plugin.

Commands on this page follow OpenAI's Codex docs as of December 2026. Run codex mcp --help to see the options in your version.

← Back to AgentAvow