claude-config

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Claude Config Management

Claude配置管理

Manages configuration files for Claude Desktop and Claude Code, including MCP server setup, project settings, and developer options.
管理Claude Desktop和Claude Code的配置文件,包括MCP服务器搭建、项目设置和开发者选项。

Configuration File Locations

配置文件位置

Claude Desktop (macOS):
  • Config:
    ~/Library/Application Support/Claude/claude_desktop_config.json
  • Logs:
    ~/Library/Logs/Claude/
  • Developer settings:
    ~/Library/Application Support/Claude/developer_settings.json
Claude Desktop (Windows):
  • Config:
    %APPDATA%\Claude\claude_desktop_config.json
  • Logs:
    %APPDATA%\Claude\Logs\
Claude Code (Project-specific):
  • Settings:
    .claude/settings.json
  • Plugin marketplace:
    .claude-plugin/marketplace.json
Claude Desktop(macOS):
  • 配置文件:
    ~/Library/Application Support/Claude/claude_desktop_config.json
  • 日志:
    ~/Library/Logs/Claude/
  • 开发者设置:
    ~/Library/Application Support/Claude/developer_settings.json
Claude Desktop(Windows):
  • 配置文件:
    %APPDATA%\Claude\claude_desktop_config.json
  • 日志:
    %APPDATA%\Claude\Logs\
Claude Code(项目专属):
  • 设置:
    .claude/settings.json
  • 插件市场:
    .claude-plugin/marketplace.json

Claude Desktop Configuration

Claude Desktop配置

Basic Structure

基本结构

json
{
  "mcpServers": {
    "server-name": {
      "command": "command-to-run",
      "args": ["arg1", "arg2"],
      "env": {
        "VAR_NAME": "value"
      }
    }
  }
}
json
{
  "mcpServers": {
    "server-name": {
      "command": "command-to-run",
      "args": ["arg1", "arg2"],
      "env": {
        "VAR_NAME": "value"
      }
    }
  }
}

Important Notes

重要注意事项

  • Always use absolute paths - Working directory may be undefined
  • Windows paths: Use forward slashes or double backslashes
  • Restart required: Restart Claude Desktop after configuration changes
  • Environment variables: Limited by default (USER, HOME, PATH); set explicitly in
    env
  • 始终使用绝对路径 - 工作目录可能未定义
  • Windows路径:使用正斜杠或双反斜杠
  • 需要重启:修改配置后重启Claude Desktop
  • 环境变量:默认受限制(USER、HOME、PATH);需在
    env
    中显式设置

Claude Code Project Settings

Claude Code项目设置

.claude/settings.json

.claude/settings.json

json
{
  "enabledPlugins": ["plugin-name"],
  "extraKnownMarketplaces": {
    "team-tools": {
      "source": {
        "source": "github",
        "repo": "company/claude-plugins"
      }
    }
  }
}
json
{
  "enabledPlugins": ["plugin-name"],
  "extraKnownMarketplaces": {
    "team-tools": {
      "source": {
        "source": "github",
        "repo": "company/claude-plugins"
      }
    }
  }
}

Team Configuration

团队配置

Automatically install marketplaces when team members trust the folder:
json
{
  "extraKnownMarketplaces": {
    "company-tools": {
      "source": {
        "source": "github",
        "repo": "company/plugins"
      }
    },
    "project-tools": {
      "source": {
        "source": "git",
        "url": "https://git.company.com/project-plugins.git"
      }
    }
  }
}
当团队成员信任文件夹时自动安装市场:
json
{
  "extraKnownMarketplaces": {
    "company-tools": {
      "source": {
        "source": "github",
        "repo": "company/plugins"
      }
    },
    "project-tools": {
      "source": {
        "source": "git",
        "url": "https://git.company.com/project-plugins.git"
      }
    }
  }
}

Quick Validation

快速验证

bash
undefined
bash
undefined

Validate JSON syntax

Validate JSON syntax

jq empty ~/Library/Application\ Support/Claude/claude_desktop_config.json jq empty .claude/settings.json
jq empty ~/Library/Application\ Support/Claude/claude_desktop_config.json jq empty .claude/settings.json

Check server names

Check server names

jq -r '.mcpServers | keys[]' ~/Library/Application\ Support/Claude/claude_desktop_config.json
undefined
jq -r '.mcpServers | keys[]' ~/Library/Application\ Support/Claude/claude_desktop_config.json
undefined

Quick Troubleshooting

快速故障排查

If MCP server not loading:
  1. Validate JSON syntax
  2. Verify command paths are absolute
  3. Check environment variables are set
  4. Review logs:
    ~/Library/Logs/Claude/mcp*.log
  5. Restart Claude Desktop
如果MCP服务器无法加载:
  1. 验证JSON语法
  2. 确认命令路径为绝对路径
  3. 检查环境变量是否已设置
  4. 查看日志:
    ~/Library/Logs/Claude/mcp*.log
  5. 重启Claude Desktop

References

参考资料

Detailed documentation for specific scenarios:
  • MCP Patterns - Server configuration examples (Python, Node.js, environment variables)
  • Troubleshooting - Common issues, log locations, debugging tools
  • Workflows - Step-by-step guides for adding servers, team setup, migration
特定场景的详细文档:
  • MCP Patterns - 服务器配置示例(Python、Node.js、环境变量)
  • Troubleshooting - 常见问题、日志位置、调试工具
  • Workflows - 添加服务器、团队设置、迁移的分步指南

Next Steps

后续步骤

  • See EXAMPLES.md for real-world configuration examples
  • 查看EXAMPLES.md获取真实场景的配置示例