Claude Code和Codex的设置
[TOC]
Claude Code
MCP
在~/.claud.json里按如下格式添加即可。
"mcpServers": {
"context7": {
"args": [
"-y",
"@upstash/context7-mcp"
],
"command": "npx",
"type": "stdio"
},
"fetch": {
"args": [
"mcp-server-fetch"
],
"command": "uvx",
"type": "stdio"
},
"memory": {
"args": [
"-y",
"@modelcontextprotocol/server-memory"
],
"command": "npx",
"type": "stdio"
},
"sequential-thinking": {
"args": [
"-y",
"@modelcontextprotocol/server-sequential-thinking"
],
"command": "npx",
"type": "stdio"
},
"heroui-react": {
"command": "npx",
"args": ["-y", "@heroui/react-mcp@latest"]
},
"time": {
"args": [
"-y",
"@modelcontextprotocol/server-time"
],
"command": "npx",
"type": "stdio"
}
}
自定义Key
都是在~/.claude/settings.json里设置
DeepSeek
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "<key>",
"ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "DeepSeek-V3.2-Exp",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "DeepSeek-V3.2-Exp",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "DeepSeek-V3.2-Exp",
"ANTHROPIC_MODEL": "DeepSeek-V3.2-Exp"
}
}
MiniMax
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.minimaxi.com/anthropic",
"ANTHROPIC_AUTH_TOKEN": "<MINIMAX_API_KEY>",
"API_TIMEOUT_MS": "3000000",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1,
"ANTHROPIC_MODEL": "MiniMax-M2",
"ANTHROPIC_SMALL_FAST_MODEL": "MiniMax-M2",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "MiniMax-M2",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "MiniMax-M2",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMax-M2"
}
}
用哪个,启用哪个即可
权限
在配置文件~/.claude/settings.json内添加如下内容
"permissions": {
"defaultMode": "bypassPermissions"
}
Codex
MCP
在~/.codex/config.toml下添加即可
[mcp_servers]
[mcp_servers.context7]
type = "stdio"
command = "npx"
args = ["-y", "@upstash/context7-mcp"]
[mcp_servers.fetch]
type = "stdio"
command = "uvx"
args = ["mcp-server-fetch"]
[mcp_servers.memory]
type = "stdio"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-memory"]
[mcp_servers.sequential-thinking]
type = "stdio"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-sequential-thinking"]
[mcp_servers.time]
type = "stdio"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-time"]
Yolo权限
在~/.codex/config.toml里添加如下内容:
偷懒行为
# 默认审批与沙箱策略(等价于 CLI: -a on-failure --sandbox workspace-write)
approval_policy = "never"
sandbox = "workspace-write"
自定义KEY
在~/.codex/config.toml中
model_provider = "azure" # 使用哪个服务商
model = "gpt-5-codex" # 使用的模型
model_reasoning_effort = "high" #推理强度
disable_response_storage = true # 是否禁用响应存储
服务商配置
Azure OpenAI
[model_providers.azure]
name = "Azure OpenAI"
base_url = "https://openal-east-us-2-ins.openai.azure.com"
env_key = "OPENAI_API_KEY"
query_params = { "api-version" = "2025-04-01-preview" }
wire_api = "responses"
requires_openai_auth = true
MiniMax
[model_providers.minimax]
name = "MiniMax Chat Completions API"
base_url = "https://api.minimaxi.com/v1"
env_key = "MINIMAX_API_KEY"
wire_api = "chat"
requires_openai_auth = false
request_max_retries = 4
stream_max_retries = 10
stream_idle_timeout_ms = 300000