Skip to content

Per-project MCP server configuration in .codex/config.toml or mcp.json (avoid wrapper scripts) #13056

@wachterjohannes

Description

@wachterjohannes

What variant of Codex are you using?

Codex CLI (with project-level .codex/config.toml)

What feature would you like to see?

I’d like first-class support for configuring MCP servers per project/directory, either in .codex/config.toml and/or via mcp.json.

Today, the current config level is not enough for workflows where MCP servers need to be started with directory-specific context. Tools like ai-mate use a per-directory MCP server model, but in Codex this is hard to express cleanly.

Current workaround: wrapper scripts that inject the project path or dynamic context before launching the MCP server. This works, but it adds setup complexity and is not a great UX.

A concrete example is this Symfony AI integration PR, which needed a wrapper-based approach:
symfony/ai#1682

Requested outcome:

  1. Allow native per-project/directory MCP server configuration.
  2. Support this cleanly through .codex/config.toml and/or mcp.json.
  3. Remove the need for wrapper scripts in common integrations.
  4. Make MCP behavior more predictable and ergonomic across projects.

This came up in the PR discussion here (which was closed):
#12718
I understand why that PR was closed, but I think this use case still needs a proper configuration-level solution.

Additional information

If helpful, I can propose concrete config shape options (for example, project-scoped server entries, per-workspace overrides, or variable interpolation for the current directory) and help test them against real integrations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmcpIssues related to the use of model context protocol (MCP) servers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions