MCP 安装教程

Codex MCP 配置路径指南

了解 Codex MCP 全局和项目级 config.toml 配置路径。

适合谁?

适合需要在全局和项目级 Codex 配置之间选择的用户。

配置路径和示例

~/.codex/config.toml or .codex/config.toml

[mcp_servers."filesystem"]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "./"]

安装步骤

1

Use global config for everyday tools

Put broadly useful MCP servers in ~/.codex/config.toml.

2

Use project config for repo-specific tools

Put project-only servers in .codex/config.toml.

3

Generate TOML

Use quoted table names and args arrays.

[mcp_servers."filesystem"]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "./"]
4

Restart Codex

Reload after changing config.toml.

常见问题

Wrong scope

A project-level config only works when that project is open.

FAQ

Does Codex use JSON?

No. Codex MCP config uses TOML.