Skip to content

Error loading config.toml: invalid type: sequence, expected a string in mcp_servers.perplexity.env.env_vars #7802

@doggy8088

Description

@doggy8088

What version of Codex is running?

codex-cli 0.66.0

What subscription do you have?

ChatGPT Plus

Which model were you using?

gpt-5.1-codex-max

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What issue are you seeing?

I followed this guide to setup my Perplexity MCP: https://github.com/openai/codex/blob/main/docs/config.md#stdio

My ~/.codex/config.toml file:

[mcp_servers.perplexity]
command = "npx"
args = ["-y", "@perplexity-ai/mcp-server"]

[mcp_servers.perplexity.env]
env_vars = [ "PERPLEXITY_API_KEY" ]

When run codex, it will produce:

Error loading config.toml: invalid type: sequence, expected a string
in `mcp_servers.perplexity.env.env_vars`

I believe this is a bug from Codex CLI.

What steps can reproduce the bug?

  1. codex mcp add perplexity -- npx -y '@perplexity-ai/mcp-server'
  2. Configure ~/.codex/config.toml add env_vars to it
  3. Run codex

What is the expected behavior?

This is either document wrong or Codex CLI implementation wrong.

Additional information

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingmcpIssues related to the use of model context protocol (MCP) serversmcp-serverIssues related to the use of the `codex mcp-server` subcommandwindows-osIssues related to Codex on Windows systems

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions