Anthropic 推出 Desktop Extensions,讓 Claude Desktop 一鍵安裝 MCP 伺服器
Desktop Extensions: One-click MCP server installation for Claude Desktop
Anthropic 推出 Desktop Extensions,將本機 MCP 伺服器及其依賴項封裝為 .mcpb 檔案,讓用戶可在 Claude Desktop 一鍵安裝,毋須手動編輯設定檔。
把本機 MCP 伺服器連同依賴項封裝,再以 manifest.json 管理設定與敏感資料,展示了降低桌面工具安裝門檻的一套具體做法。
檔案副檔名更新
2025年9月11日
Claude Desktop Extensions 現在使用 .mcpb(MCP Bundle)檔案副檔名,而非 .dxt。現有的 .dxt 擴充功能仍可繼續使用,但我們建議開發者日後開發新擴充功能時使用 .mcpb。所有功能維持不變,這純粹是命名慣例更新。
—
去年推出 Model Context Protocol (MCP) 時,我們看到開發者建立了出色的本機伺服器,讓 Claude 可以存取各種資源,從檔案系統到資料庫都有。但我們不斷收到相同的意見:安裝程序過於複雜。用戶需要開發者工具、必須手動編輯設定檔,而且經常卡在相依項目問題上。
今天,我們推出 Desktop Extensions——一種全新的打包格式,讓安裝 MCP 伺服器變得像按一下按鈕般簡單。
解決 MCP 安裝問題
本機 MCP 伺服器為 Claude Desktop 用戶帶來強大功能。它們可以與本機應用程式互動、存取私密資料,以及整合開發工具,同時將數據保留在用戶的電腦上。然而,現時的安裝程序造成不少障礙:
- 需要開發者工具:用戶需要安裝 Node.js、Python 或其他執行環境
- 手動設定:每個伺服器都需要編輯 JSON 設定檔
- 管理相依項目:用戶必須解決套件衝突和版本不符的問題
- 缺乏探索機制:要找到實用的 MCP 伺服器,必須搜尋 GitHub
- 更新繁複:要讓伺服器保持最新,必須手動重新安裝
這些使用障礙令非技術用戶大多無法使用 MCP 伺服器,儘管它們功能強大。
推出 Desktop Extensions
Desktop Extensions(.mcpb 檔案)解決了這些問題:它會將整個 MCP 伺服器(包括所有相依項目)打包成單一可安裝套件。用戶的使用方式如下:
之前:
# Install Node.js first
npm install -g @example/mcp-server
# Edit ~/.claude/claude_desktop_config.json manually
# Restart Claude Desktop
# Hope it works之後:
- 下載
.mcpb檔案 - 按兩下以使用 Claude Desktop 開啟
- 按一下「安裝」
就是這麼簡單。不用使用終端機、不用編輯設定檔,也不會遇上相依項目衝突。
架構概覽
Desktop Extension 是一個 zip 壓縮檔,內含本機 MCP 伺服器及 manifest.json,當中説明 Claude Desktop 和其他支援桌面擴充功能的應用程式所需知道的一切。
extension.mcpb (ZIP archive)
├── manifest.json # Extension metadata and configuration
├── server/ # MCP server implementation
│ └── [server files]
├── dependencies/ # All required packages/libraries
└── icon.png # Optional: Extension icon
# Example: Node.js Extension
extension.mcpb
├── manifest.json # Required: Extension metadata and configuration
├── server/ # Server files
│ └── index.js # Main entry point
├── node_modules/ # Bundled dependencies
├── package.json # Optional: NPM package definition
└── icon.png # Optional: Extension icon
# Example: Python Extension
extension.mcpb (ZIP file)
├── manifest.json # Required: Extension metadata and configuration
├── server/ # Server files
│ ├── main.py # Main entry point
│ └── utils.py # Additional modules
├── lib/ # Bundled Python packages
├── requirements.txt # Optional: Python dependencies list
└── icon.png # Optional: Extension iconDesktop Extension 唯一必需的檔案是 manifest.json。Claude Desktop 會處理所有複雜工作:
- 內置執行環境:我們隨 Claude Desktop 提供 Node.js,免除外部相依項目
- 自動更新:有新版本推出時,擴充功能會自動更新
- 安全儲存機密資料:API 金鑰等敏感設定會儲存在作業系統鑰匙圈
manifest 包含人類可讀的資訊(例如名稱、描述或作者)、功能宣告(工具、提示詞)、用戶設定及執行環境需求。大部分欄位都是選填,因此最精簡的版本相當短;不過,我們預期實際上所有三種受支援的擴充功能類型(Node.js、Python 及傳統二進制檔/可執行檔)都會包含檔案:
{
"mcpb_version": "0.1", // MCPB spec version this manifest conforms to
"name": "my-extension", // Machine-readable name (used for CLI, APIs)
"version": "1.0.0", // Semantic version of your extension
"description": "A simple MCP extension", // Brief description of what the extension does
"author": { // Author information (required)
"name": "Extension Author" // Author's name (required field)
},
"server": { // Server configuration (required)
"type": "node", // Server type: "node", "python", or "binary"
"entry_point": "server/index.js", // Path to the main server file
"mcp_config": { // MCP server configuration
"command": "node", // Command to run the server
"args": [ // Arguments passed to the command
"${__dirname}/server/index.js" // ${__dirname} is replaced with the extension's directory
]
}
}
}
manifest 規格中提供了多種便利選項,旨在簡化本機 MCP 伺服器的安裝和設定。伺服器設定物件可以這樣定義,既支援以樣板字串形式加入用戶自訂設定,也容許按平台覆寫設定。擴充功能開發者可以詳細指定希望向用戶收集哪些設定。
看看 manifest 如何協助設定的具體例子。在以下 manifest 中,開發者宣告用戶必須提供 api_key。用戶提供該值之前,Claude 不會啟用擴充功能;Claude 會自動將該值儲存在作業系統的安全保管庫中,並在啟動伺服器時,以用戶提供的值取代 ${user_config.api_key}。同樣,${__dirname} 會替換為擴充功能解壓縮後目錄的完整路徑。
{
"mcpb_version": "0.1",
"name": "my-extension",
"version": "1.0.0",
"description": "A simple MCP extension",
"author": {
"name": "Extension Author"
},
"server": {
"type": "node",
"entry_point": "server/index.js",
"mcp_config": {
"command": "node",
"args": ["${__dirname}/server/index.js"],
"env": {
"API_KEY": "${user_config.api_key}"
}
}
},
"user_config": {
"api_key": {
"type": "string",
"title": "API Key",
"description": "Your API key for authentication",
"sensitive": true,
"required": true
}
}
}包含大部分選填欄位的完整 manifest.json 可能如下所示:
{
"mcpb_version": "0.1",
"name": "My MCP Extension",
"display_name": "My Awesome MCP Extension",
"version": "1.0.0",
"description": "A brief description of what this extension does",
"long_description": "A detailed description that can include multiple paragraphs explaining the extension's functionality, use cases, and features. It supports basic markdown.",
"author": {
"name": "Your Name",
"email": "yourname@example.com",
"url": "https://your-website.com"
},
"repository": {
"type": "git",
"url": "https://github.com/your-username/my-mcp-extension"
},
"homepage": "https://example.com/my-extension",
"documentation": "https://docs.example.com/my-extension",
"support": "https://github.com/your-username/my-extension/issues",
"icon": "icon.png",
"screenshots": [
"assets/screenshots/screenshot1.png",
"assets/screenshots/screenshot2.png"
],
"server": {
"type": "node",
"entry_point": "server/index.js",
"mcp_config": {
"command": "node",
"args": ["${__dirname}/server/index.js"],
"env": {
"ALLOWED_DIRECTORIES": "${user_config.allowed_directories}"
}
}
},
"tools": [
{
"name": "search_files",
"description": "Search for files in a directory"
}
],
"prompts": [
{
"name": "poetry",
"description": "Have the LLM write poetry",
"arguments": ["topic"],
"text": "Write a creative poem about the following topic: ${arguments.topic}"
}
],
"tools_generated": true,
"keywords": ["api", "automation", "productivity"],
"license": "MIT",
"compatibility": {
"claude_desktop": ">=1.0.0",
"platforms": ["darwin", "win32", "linux"],
"runtimes": {
"node": ">=16.0.0"
}
},
"user_config": {
"allowed_directories": {
"type": "directory",
"title": "Allowed Directories",
"description": "Directories the server can access",
"multiple": true,
"required": true,
"default": ["${HOME}/Desktop"]
},
"api_key": {
"type": "string",
"title": "API Key",
"description": "Your API key for authentication",
"sensitive": true,
"required": false
},
"max_file_size": {
"type": "number",
"title": "Maximum File Size (MB)",
"description": "Maximum file size to process",
"default": 10,
"min": 1,
"max": 100
}
}
}如要查看擴充功能及 manifest,請參閲MCPB 儲存庫中的範例。
manifest.json 中所有必填及選填欄位的完整規格,可在我們的開源工具鏈中找到。
建立你的第一個擴充功能
接下來會示範如何將現有的 MCP 伺服器封裝為桌面擴充功能。我們會以簡單的檔案系統伺服器為例。
步驟 1:建立 manifest
首先,為你的伺服器初始化 manifest:
npx @anthropic-ai/mcpb init這個互動式工具會詢問有關伺服器的問題,並產生完整的 manifest.json。如果想快速產生最基本的 manifest.json,可以在指令中加入 --yes 參數。
步驟 2:處理用戶設定
如果伺服器需要用戶輸入資料(例如 API 金鑰或允許存取的目錄),請在 manifest 中宣告:
"user_config": {
"allowed_directories": {
"type": "directory",
"title": "Allowed Directories",
"description": "Directories the server can access",
"multiple": true,
"required": true,
"default": ["${HOME}/Documents"]
}
}Claude Desktop 將會:
- 顯示方便用戶使用的設定介面
- 在啟用擴充功能前驗證輸入內容
- 安全地儲存敏感值
- 根據開發者的設定,以引數或環境變數將設定傳遞給伺服器
在以下範例中,我們透過環境變數傳遞用戶設定,但亦可以使用引數。
"server": {
"type": "node",
"entry_point": "server/index.js",
"mcp_config": {
"command": "node",
"args": ["${__dirname}/server/index.js"],
"env": {
"ALLOWED_DIRECTORIES": "${user_config.allowed_directories}"
}
}
}步驟 3:封裝擴充功能
將所有內容打包成 .mcpb 檔案:
npx @anthropic-ai/mcpb pack此指令會:
- 驗證 manifest
- 產生
.mcpb封存檔
步驟 4:在本機測試
將你的 .mcpb 檔案拖放到 Claude Desktop 的設定視窗。你會看到:
- 易於閲讀的擴充功能資訊
- 所需權限及設定
- 簡單的「安裝」按鈕
進階功能
跨平台支援
擴充功能可因應不同作業系統作出調整:
"server": {
"type": "node",
"entry_point": "server/index.js",
"mcp_config": {
"command": "node",
"args": ["${__dirname}/server/index.js"],
"platforms": {
"win32": {
"command": "node.exe",
"env": {
"TEMP_DIR": "${TEMP}"
}
},
"darwin": {
"env": {
"TEMP_DIR": "${TMPDIR}"
}
}
}
}
}動態設定
使用樣板字串表示執行時的值:
${__dirname}:擴充功能的安裝目錄${user_config.key}:用戶提供的設定${HOME}, ${TEMP}:系統環境變數
功能宣告
預先協助用戶瞭解功能:
"tools": [
{
"name": "read_file",
"description": "Read contents of a file"
}
],
"prompts": [
{
"name": "code_review",
"description": "Review code for best practices",
"arguments": ["file_path"]
}
]擴充功能目錄
我們推出時會在 Claude Desktop 內置一個精選擴充功能目錄。用戶可以瀏覽、搜尋並一鍵安裝,無須在 GitHub 搜尋或審查程式碼。
我們預期,Desktop Extension 規格以及 Claude 在 macOS 和 Windows 上的實作都會隨時間演進;我們期待看到擴充功能如何以各種創意方式擴展 Claude 的能力。
如要提交擴充功能:
- 確保擴充功能符合提交表格中的指引
- 在 Windows 和 macOS 上測試
- 提交擴充功能
- 我們的團隊會審查擴充功能的質素及安全性
建立開放的生態系統
我們致力支持圍繞 MCP 伺服器的開放生態系統,並相信多個應用程式和服務均可普遍採用這個生態系統,令社羣受惠。為實踐這項承諾,我們將 Desktop Extension 規格、工具鏈,以及 Claude 在 macOS 和 Windows 上用來自行實作 Desktop Extensions 支援的結構描述和關鍵功能開源。我們希望 MCPB 格式不只令本機 MCP 伺服器更容易移植至 Claude,也能讓其他 AI 桌面應用程式受惠。
我們將以下項目開源:
- 完整的 MCPB 規格
- 封裝和驗證工具
- 參考實作程式碼
- TypeScript 型別和結構描述
這代表:
- 對 MCP 伺服器開發人員而言:封裝一次,即可在任何支援 MCPB 的地方執行
- 對應用程式開發人員而言:無需從頭開始構建,即可加入擴充功能支援
- 對用戶而言:在所有支援 MCP 的應用程式中享有一致的體驗
這份規格和工具鏈刻意定為 0.1 版,因為我們期待與更廣大的社羣合作,持續改進和調整這個格式。我們期待聽到你的意見。
安全和企業考量
我們明白擴充功能會帶來新的安全考量,尤其是對企業而言。我們在 Desktop Extensions 預覽版中加入了多項保障措施:
對用戶而言
- 敏感資料會保留在作業系統的鑰匙圈中
- 自動更新
- 可稽核已安裝的擴充功能
適用於企業
- 支援羣組原則(Windows)和 MDM(macOS)
- 可預先安裝已核准的擴充功能
- 封鎖特定擴充功能或發佈者
- 完全停用擴充功能目錄
- 部署私人擴充功能目錄
如要進一步瞭解如何在機構內管理擴充功能,請參閲我們的説明文件。
開始使用
準備好建立自己的擴充功能?以下是開始方法:
適用於 MCP 伺服器開發者:請參閲我們的開發者説明文件,或直接在本機 MCP 伺服器的目錄中執行以下命令:
npm install -g @anthropic-ai/mcpb
mcpb init
mcpb pack適用於 Claude Desktop 用戶:更新至最新版本,並在「設定」中尋找「擴充功能」部分
適用於企業:請參閲我們的企業説明文件,瞭解部署選項
使用 Claude Code 建置
Anthropic 內部發現,Claude 很擅長在無需太多介入的情況下建置擴充功能。如果你也想使用 Claude Code,我們建議你先簡單説明希望擴充功能做到甚麼,然後在提示詞中加入以下背景資料:
I want to build this as a Desktop Extension, abbreviated as "MCPB". Please follow these steps:
1. **Read the specifications thoroughly:**
- https://github.com/anthropics/mcpb/blob/main/README.md - MCPB architecture overview, capabilities, and integration patterns
- https://github.com/anthropics/mcpb/blob/main/MANIFEST.md - Complete extension manifest structure and field definitions
- https://github.com/anthropics/mcpb/tree/main/examples - Reference implementations including a "Hello World" example
2. **Create a proper extension structure:**
- Generate a valid manifest.json following the MANIFEST.md spec
- Implement an MCP server using @modelcontextprotocol/sdk with proper tool definitions
- Include proper error handling and timeout management
3. **Follow best development practices:**
- Implement proper MCP protocol communication via stdio transport
- Structure tools with clear schemas, validation, and consistent JSON responses
- Make use of the fact that this extension will be running locally
- Add appropriate logging and debugging capabilities
- Include proper documentation and setup instructions
4. **Test considerations:**
- Validate that all tool calls return properly structured responses
- Verify manifest loads correctly and host integration works
Generate complete, production-ready code that can be immediately tested. Focus on defensive programming, clear error messages, and following the exact
MCPB specifications to ensure compatibility with the ecosystem.結論
桌面擴充功能從根本上改變了用戶與本機 AI 工具互動的方式。透過消除安裝障礙,我們讓所有人都能使用功能強大的 MCP 伺服器,而不只是開發者。
在內部,我們正使用桌面擴充功能分享實驗性極高的 MCP 伺服器,有些好玩,有些實用。一個團隊進行實驗,測試我們的模型直接連接 GameBoy 後能做到甚麼程度,這與我們的「Claude 玩 Pokémon」研究類似。我們使用 Desktop Extensions 將一個擴充功能打包,讓 Claude 可以啟動熱門的 PyBoy GameBoy 模擬器並控制它。我們相信,有無數機會可以將模型的能力連接到用戶本機上已有的工具、資料和應用程式。

我們非常期待看到你打造的作品。創造出數以千計 MCP 伺服器的同一份創意,現在只需按一下,就能觸及數以百萬計的用戶。準備好分享你的 MCP 伺服器了嗎?提交你的擴充功能以供審核。
來源:Anthropic:Engineering · anthropic.com