portainer mcp——npx的npm包装器
部署 便携式mcp 通过 新巴拿马型船舶 --无需手动下载,无需PM2,只需跨平台运行。
此软件包也是一个包装器,在安装时自动下载适用于您的平台(Linux、macOS、Windows)的正确二进制文件。
______________________________________________________________________
🚀 通过npx使用(推荐)
选项1:直接npx(无需安装)
npx @lauredmarin/portainer-mcp -server https://portainer.example.com -token YOUR_TOKEN选项2:MCP客户端配置(如Claude、Cursor等)
{
"mcpServers": {
"portainer": {
"type": "stdio",
"command": "npx",
"args": [
"--package=@lauredmarin/portainer-mcp",
"portainer-mcp",
"-server", "https://portainer.example.com",
"-token", "YOUR_TOKEN"
]
}
}
}选项3:全局安装
npm install -g @lauredmarin/portainer-mcp
portainer-mcp -server https://portainer.example.com -token YOUR_TOKEN______________________________________________________________________
🐳 传统:通过mcp代理+PM2进行服务器部署
在VPS上作为HTTP端点公开:
需求
- Linux x86-64(amd64)
curl,tar- Node.js+npm(适用于PM2)
uv(由自动安装install.sh如果缺失)
快速开始
git clone https://github.com/Lauredmarin/portainer-mcp-amd64.git
cd portainer-mcp-amd64
bash install.sh
cp .env.example .env # fill in your values
pm2 start ecosystem.config.js
pm2 save && pm2 startup配置(.env)
| 变量 | 必填 | 默认 | 描述 |
|---|---|---|---|
PORTAINER_SERVER | ✅ | — | 门户URL(例如。 https://portainer.example.com) |
PORTAINER_TOKEN | ✅ | — | Portainer API令牌 |
MCP_PORT | ❌ | 8749 | mcp代理暴露的端口 |
PORTAINER_MCP_BIN | ❌ | ~/portainer-mcp/portainer-mcp | 二进制路径 |
TOOLS_YAML | ❌ | — | 用于限制工具的tools.yaml路径 |
MCP端点(HTTP模式)
运行后,服务器可在以下位置使用:
http://:/mcpMCP客户端配置:
{
"mcpServers": {
"portainer": {
"type": "http",
"url": "http://:8749/mcp"
}
}
}______________________________________________________________________
📦 支持平台
| 平台 | 架构 | 状态 |
|---|---|---|
| Linux | amd64、arm64、arm | ✅ |
| macOS | amd64(英特尔),arm64(苹果硅) | ✅ |
| Windows | amd64、arm64 | ✅ |
______________________________________________________________________
🛠️ 发展
git clone https://github.com/Lauredmarin/portainer-mcp-amd64.git
cd portainer-mcp-amd64
npm install
npm run postinstall # Downloads binary
node run.js -help______________________________________________________________________
🔗 链接
- 原装门机mcp:https://github.com/portainer/portainer-mcp
- NPM包:https://www.npmjs.com/package/@lauredmarin/portainer mcp(出版时)
- 问题:https://github.com/Lauredmarin/portainer-mcp-amd64/issues
______________________________________________________________________
📄 许可证
麻省理工学院
