Token导航 LogoToken导航TokenDH.com
Claude Desktop Config logo
运维云端未说明官方级别未说明来源级核验

Claude Desktop Config

MCP Server

用于管理多个Claude Desktop MCP服务器配置的工具,支持通过启用/禁用标志控制服务器配置生成。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
配置管理开发工具GoClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

damianoneill

提供方

damianoneill

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

claude桌面配置

使用每台服务器的启用/禁用标志管理多个Claude Desktop MCP服务器配置。

克劳德桌面 claude_desktop_config.json 是纯JSON——你不能把东西注释掉。此工具可让您维护 源文件 您可以随意添加多个服务器条目,每个条目都有一个 "_enabled" 标志,并从中生成真正的配置。

安装

go install github.com/damianoneill/claude-desktop-config@latest

或者从以下网址下载二进制文件 发布页面.

macOS注意事项: 从发布页面下载的二进制文件没有经过代码签名或公证。macOS Gatekeeper将在首次运行时阻止二进制文件。要删除隔离属性,请执行以下操作: ``bash xattr -d com.apple.quarantine ./claude-desktop-config ``

快速开始

# 1. Create source file from the committed example
claude-desktop-config init

# 2. Edit it — add your real credentials and set _enabled flags as needed
$EDITOR claude_desktop_config.source.json

# 3. Launch the interactive TUI — toggle servers, then press 'a' to apply
claude-desktop-config

# Or skip the TUI and apply directly:
claude-desktop-config apply

# 4. Restart Claude Desktop

用法

无参数运行以启动交互式TUI:

claude-desktop-config

或者直接使用子命令:

claude-desktop-config [--source PATH] [--keep-backups N] 
命令描述
tui启动交互式TUI(未给出命令时的默认设置)
init从创建源文件 .example (如果已存在,则跳过)
apply从源文件生成并写入Claude Desktop配置
dry-run预览生成的配置,无需写入磁盘
version打印版本

全球旗帜:

--source PATH       Path to source JSON file (default: ./claude_desktop_config.source.json)
--keep-backups N    Number of backup files to retain (default: 3)

交互式TUI

跑步 claude-desktop-config (或 claude-desktop-config tui)打开全屏终端UI:

Claude Desktop MCP Servers  3 enabled / 15 total

────────────────────────────────────────────────────────────────────────
       NAME                                       URL
  ●  local-server-a                               http://localhost:8080/mcp/server-a
  ○  local-server-b                               http://localhost:8080/mcp/server-b
  ○  prod-server-a                                https://api.example.com/mcp/server-a
  ●~ staging-server-a                             https://staging.example.com/mcp/server-a
────────────────────────────────────────────────────────────────────────
↑↓/jk navigate  space toggle  s save  a apply  d dry-run  q quit
符号含义
已启用
残疾人
●~已分段启用(未保存)
○~已分段禁用(未保存)

变化是 分阶段的 直到明确承诺:

  • space --切换所选服务器(已暂存,尚未写入)
  • s --将阶段性更改保存到源文件
  • a --保存阶段性更改并应用于Claude Desktop配置
  • d --当前启用的服务器的模拟运行预览(显示在状态栏中)
  • q --退出(丢弃任何未保存的阶段性更改)

源文件格式

claude_desktop_config.source.json 反映了真实的Claude Desktop配置结构, 每个服务器条目有两个额外字段:

  • "_enabled"true 包括, false 从生成的配置中排除
  • "_comment" --可选的自由形式描述,显示在TUI中并从输出中删除

前缀为的字段 _ 仅限于meta——它们仅存在于源文件中,并且是 从未复制到生成的Claude Desktop配置。

{
  "mcpServers": {
    "local-server-a": {
      "_enabled": true,
      "_comment": "Local dev instance — enabled for day-to-day testing",
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:8080/mcp/server-a",
        "--header",
        "Authorization:Bearer YOUR_API_TOKEN"
      ],
      "env": {
        "NODE_OPTIONS": "--use-system-ca",
        "NODE_TLS_REJECT_UNAUTHORIZED": "0"
      }
    },
    "prod-server-a": {
      "_enabled": false,
      "_comment": "Production — keep disabled unless explicitly testing prod",
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://api.example.com/mcp/server-a",
        "--header",
        "Authorization:Bearer YOUR_PROD_API_TOKEN"
      ],
      "env": {
        "NODE_OPTIONS": "--use-system-ca"
      }
    }
  }
}

claude_desktop_config.source.json被忽视 --它永远不应该被承诺,因为它 包含真实的API令牌。承诺 .example 文件使用占位符值,可以安全共享。

配置文件位置

操作系统会自动检测正确的路径:

操作系统路径
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Linux~/.config/Claude/claude_desktop_config.json
窗户%APPDATA%/Claude/claude_desktop_config.json

应用程序如何工作

  1. 读取源文件
  2. 仅筛选到 "_enabled": true 服务器(不存在 _enabled 被视为已启用)
  3. 全部脱衣 _ 前缀字段(_enabled, _comment)从输出
  4. 使用时间戳后缀备份现有的Claude Desktop配置(.YYYYMMDD-HHMMSS.bak)
  5. 修剪旧备份,保留最新的N(默认值3,可通过配置 --keep-backups)
  6. 合并新 mcpServers 将块插入到现有配置中,保留Claude Desktop可能编写的任何其他顶级密钥
  7. 写入结果

发展

make setup          # install pre-commit hooks
make build          # build ./claude-desktop-config binary
make test           # run all tests
make lint           # run golangci-lint
make fmt            # format source code
make release-dry    # local goreleaser snapshot

目录标签

目录标签

配置管理开发工具GoClaude本地部署服务器管理JSON处理

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明token部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP