一行要約

MCP サーバの導入が「開発者ツール + 手動の設定ファイル編集 + 依存関係の解決」を要していた問題を、依存関係ごと1つの ZIP(.mcpb)に固めてダブルクリックで入る形に変えた。

要点

何を解いたか

Installation was too complex. Users needed developer tools, had to manually edit configuration files, and often got stuck on dependency issues. インストールが複雑すぎた。ユーザーは開発者向けツールを必要とし、設定ファイルを手で編集しなければならず、依存関係の問題でつまずくことも多かった。

手順
Beforenpm install -g @example/mcp-server~/.claude/claude_desktop_config.json を手で編集 → Claude Desktop を再起動 → 動くことを祈る
After.mcpb をダウンロード → ダブルクリック → Install

仕組み

  • .mcpb は ZIP アーカイブで、MCP サーバと全依存関係を同梱する
  • Claude Desktop に Node.js ランタイムが組み込まれているので外部依存が要らない
  • 機微なデータは OS の keychain に保存される
  • 自動更新が有効

Package once, run anywhere that supports MCPB. 一度パッケージすれば、MCPB に対応するどこででも動く。

サーバ種別: node / python / binary

使えるテンプレートリテラル:

変数内容
${__dirname}拡張のインストール先ディレクトリ
${user_config.<key>}ユーザーが入力した設定値
${HOME} / ${TEMP} / ${TMPDIR}システム環境変数

エンタープライズ機能

  • Group Policy(Windows)と MDM(macOS)
  • 承認済み拡張の事前インストール
  • 拡張 / 発行者のブロックリスト
  • 拡張ディレクトリの無効化
  • プライベートな拡張ディレクトリ

そのまま使える具体例

ディレクトリ構造:

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

最小の manifest.json:

{
  "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"]
    }
  }
}

ユーザー設定を宣言するsensitive: true は keychain に入る):

"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
  }
}

ユーザー設定を環境変数として渡す:

"server": {
  "type": "node",
  "entry_point": "server/index.js",
  "mcp_config": {
    "command": "node",
    "args": ["${__dirname}/server/index.js"],
    "env": {
      "API_KEY": "${user_config.api_key}"
    }
  }
}

プラットフォーム別の差分:

"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}"}
      }
    }
  }
}

互換性の宣言:

"compatibility": {
  "claude_desktop": ">=1.0.0",
  "platforms": ["darwin", "win32", "linux"],
  "runtimes": {"node": ">=16.0.0"}
}

作り始める:

npm install -g @anthropic-ai/mcpb
mcpb init
mcpb pack

原典で言及されている関連文書

未取得の派生リンク