将你的 MCP 打包为 DXT,面向非技术用户
何时使用: 你不想要求用户手动编辑 JSON 配置文件。
前置条件
- 可运行的 MCP server — 先用 mcp-python-sdk 或 mcp-go 构建
步骤
-
初始化清单Use DXT skill. Run
dxt initin my MCP repo. Walk me through the manifest fields.✓ 已复制→ manifest.json 已生成脚手架 -
声明配置提示My MCP needs an API_KEY. Add it as a user-prompt config field in the manifest.✓ 已复制→ 带描述的用户提示字段
-
构建并测试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