/ 目錄 / 演練場 / Anthropic DXT
● 官方 anthropics ⚡ 即開即用

Anthropic DXT

作者 anthropics · anthropics/dxt

Desktop Extensions(DXT)——將 MCP 伺服器封裝為 Claude Desktop 的一鍵安裝程式,包含清單、執行期和簽署。

DXT(Desktop Extensions)是 Anthropic 官方的 MCP 發布格式,適合非技術用戶。將你的 MCP 伺服器、依賴和清單捆綁成一個 .dxt 檔案,讓用戶在 Claude Desktop 中雙擊即可安裝。作為技能資源載入,它給予 Claude 知識以幫助你撰寫和驗證 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 伺服器 — 先使用 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 檔案安裝順利;提示正確渲染

結果: 你的 MCP 可以讓任何有 Claude Desktop 的人兩次點擊即可安裝。

注意事項
  • 捆綁大小超過 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.✓ 已複製
    → 團隊可以安裝

結果: 無 DevOps 摩擦的內部 MCP 推廣。

組合

與其他 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

安全

權限、密鑰、影響範圍

憑證儲存: 簽署金鑰存於環境變數
資料出站: 建置時無

故障排查

常見錯誤與修復

捆綁太大

使用外部化執行期;在清單中盡可能將依賴宣告為 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