/ 目录 / 演练场 / Anthropic DXT
● 官方 anthropics ⚡ 即开即用

Anthropic DXT

作者 anthropics · anthropics/dxt

Desktop Extensions (DXT)——将 MCP server 打包为 Claude Desktop 的一键安装包,附带清单、运行时和签名。

DXT(Desktop Extensions)是 Anthropic 官方的 MCP 非技术用户分发格式。将你的 MCP server、依赖和清单打包成 .dxt 文件,用户在 Claude Desktop 中双击即可安装。作为 skill 资源加载后,能帮助你编写和验证 DXT 包。

为什么要用

核心特性

实时演示

实际使用效果

就绪

安装

选择你的客户端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "anthropic-dxt-skill": {
      "command": "npx",
      "args": [
        "-y",
        "@anthropic-ai/dxt"
      ]
    }
  }
}

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "anthropic-dxt-skill": {
      "command": "npx",
      "args": [
        "-y",
        "@anthropic-ai/dxt"
      ]
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "anthropic-dxt-skill": {
      "command": "npx",
      "args": [
        "-y",
        "@anthropic-ai/dxt"
      ]
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "anthropic-dxt-skill": {
      "command": "npx",
      "args": [
        "-y",
        "@anthropic-ai/dxt"
      ]
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "anthropic-dxt-skill",
      "command": "npx",
      "args": [
        "-y",
        "@anthropic-ai/dxt"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "anthropic-dxt-skill": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@anthropic-ai/dxt"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add anthropic-dxt-skill -- npx -y @anthropic-ai/dxt

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: Anthropic DXT

将你的 MCP 打包为 DXT,面向非技术用户

👤 用户群体超出工程师范围的 MCP 作者 ⏱ ~60 min intermediate

何时使用: 你不想要求用户手动编辑 JSON 配置文件。

前置条件
  • 可运行的 MCP server — 先用 mcp-python-sdk 或 mcp-go 构建
步骤
  1. 初始化清单
    Use DXT skill. Run dxt init in my MCP repo. Walk me through the manifest fields.✓ 已复制
    → manifest.json 已生成脚手架
  2. 声明配置提示
    My MCP needs an API_KEY. Add it as a user-prompt config field in the manifest.✓ 已复制
    → 带描述的用户提示字段
  3. 构建并测试
    Run dxt pack. Install in Claude Desktop. Verify config prompts appear.✓ 已复制
    → .dxt 文件安装干净;提示正常渲染

结果: 任何拥有 Claude Desktop 的人都能通过 2 次点击安装你的 MCP。

注意事项
  • 包体积 > 100MB — 精简依赖;使用 --node-version 避免打包沉重的 node 模块
搭配使用: mcp-python-sdk · mcp-go-mark3labs

在发布或侧载前验证 DXT

👤 检查包完整性的用户和作者 ⏱ ~10 min beginner

何时使用: 你即将安装或分发一个 .dxt,想要安全保证。

步骤
  1. 检查清单
    Run dxt validate path/to/extension.dxt. Show me what permissions it requests.✓ 已复制
    → 权限摘要
  2. 验证签名
    If signed, verify the publisher matches expected.✓ 已复制
    → 签名正常或警告

结果: 对 .dxt 符合其声明内容有充分信心。

在不公开发布的情况下向公司内部分发 DXT

👤 分发内部 MCP 的平台团队 ⏱ ~90 min advanced

何时使用: 内部 MCP 需要全公司推广,但不需要 GitHub 发布。

步骤
  1. 用私有签名构建
    Build the .dxt with our internal CA signature.✓ 已复制
    → 已签名的 .dxt
  2. 通过内部共享分发
    Drop into our SharePoint with install instructions.✓ 已复制
    → 团队可以安装

结果: 内部 MCP 推广,无 DevOps 摩擦。

组合

与其他 MCP 搭配,撬动十倍杠杆

anthropic-dxt-skill + mcp-python-sdk

用 Python SDK 构建,用 DXT 分发

anthropic-dxt-skill + mcp-go-mark3labs

Go 单二进制 MCP 封装在 DXT 中

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
dxt init () 开始一个新的 DXT 0
dxt pack () 构建以供分发 0
dxt validate path 安装前检查 0
dxt sign path, key 发布时 0

成本与限制

运行它的成本

API 配额
不适用——本地
每次调用 Token 数
不适用
费用
免费(MIT 协议)
提示
打包前用 npm prune --production 精简 node_modules

安全

权限、密钥、影响范围

凭据存储: 签名用的 key 存在环境变量中
数据出站: 构建时无

故障排查

常见错误与修复

包体积过大

使用外部化运行时;在清单中将依赖声明为 external

安装失败,提示「invalid signature」

重新签名,或本地测试时使用 --skip-signature

清单验证错误

运行 dxt validate 并修复列出的 schema 问题;常见:缺少 display_name

替代方案

Anthropic DXT 对比其他方案

替代方案何时用它替代权衡
Direct npx config用户是熟悉编辑 JSON 的开发者对技术人员摩擦更低,对普通用户摩擦更高
Smithery installer你想要第三方安装注册表DXT 是上游/原生方案;smithery 是更广泛的生态工具

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills