@bearst/lucky-mcp-server
Provides read-only visibility into Cloudflared tunnel instances managed by a Lucky instance.
Provides read-only tools for listing Docker containers, images, volumes, and Compose projects via a Lucky instance.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@bearst/lucky-mcp-serverList all reverse proxy rules and check the server status"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@bearst/lucky-mcp-server
中文 | English
Lucky 的 MCP Server。通过 OpenToken 调用 Lucky 3.0 HTTP API,以 stdio 提供反向代理、证书、端口转发、DDNS 及相关模块的工具。
要求
Node.js 20 或更高
已启用 OpenToken 的 Lucky 实例(管理端口默认
16601)
认证请求头为 openToken。不使用账号密码,也不维持登录会话。
Related MCP server: OPNsense MCP Server
安装
npx -y @bearst/lucky-mcp-serverMCP 客户端配置:
{
"mcpServers": {
"lucky": {
"command": "npx",
"args": ["-y", "@bearst/lucky-mcp-server"],
"env": {
"LUCKY_BASE_URL": "http://127.0.0.1:16601",
"LUCKY_OPEN_TOKEN": "<open-token>"
}
}
}
}从本地构建运行时,将 command 设为 node,args 设为 ["/path/to/lucky-mcp-server/dist/cli.js"]。
环境变量
变量 | 必填 | 默认值 | 说明 |
| 是 | — | Lucky 管理端根 URL |
| 是 | — | OpenToken |
| 否 |
| 校验 Lucky HTTPS 证书。自签证书设为 |
| 否 |
| 请求超时(毫秒) |
| 否 | — |
|
| 否 | — |
|
| 否 | — | 允许写入的域名后缀,逗号分隔 |
| 否 | — | 向 stderr 输出请求路径,不输出 token |
OpenToken 在 Lucky 设置中签发。请遵守 Lucky 对 OpenToken 的使用条款。
工具
列表类工具返回压缩后的字段,不返回 Lucky 原生完整对象。密钥类字段在响应中脱敏。
反向代理
工具 | 说明 |
| 连通性、版本、模块与当前 MCP 配置 |
| Web 监听及其子规则(端口、TLS、域名、后端) |
| 按 key 读取一条监听 |
| 按域名将后端挂到已有监听;已存在则更新后端 |
| 按域名删除子规则,不删除监听 |
| 启用或停用指定域名的子规则 |
| 反代访问日志 |
lucky_expose_service 选择监听的顺序:rule_key → listen_port → LUCKY_DEFAULT_RULE_KEY → LUCKY_DEFAULT_LISTEN_PORT → 已启用的 TLS 监听(优先端口 443)。不会创建新的监听端口。
新增子规则时复制同一监听上已有的反向代理规则,并改写域名与后端。目标监听没有任何反向代理子规则时,提交 PascalCase 最小对象。
证书
工具 | 说明 |
| 证书元数据(不含私钥与 PEM) |
| 按 key 读取证书元数据 |
| 将已有证书绑定到 Web 监听并启用 TLS |
| 上传自定义 PEM |
| 触发指定证书的 ACME / 手动同步 |
端口转发
工具 | 说明 |
| 端口转发列表 |
| 按监听端口与协议创建或更新 |
| 按 key 删除 |
| 启用或停用 |
| 日志 |
DDNS
工具 | 说明 |
| 任务列表(提供商、域名、最近 IP) |
| 按 key 读取任务 |
| 启用或停用 |
| 立即同步 |
| 日志 |
创建新任务需要提供商专用字段,请使用 lucky_api_call。
STUN / WOL / 设置
工具 | 说明 |
| STUN 规则 |
| 启用或停用 STUN 规则 |
| STUN 日志 |
| WOL 设备 |
| 按 key、名称或 MAC 发送魔术包 |
| 添加设备 |
| 读取基础设置(密钥脱敏) |
计划任务
工具 | 说明 |
| 任务列表 |
| 按名称(或 key)创建或更新 |
| 按 key 删除 |
| 启用或停用 |
| 立即执行 |
| 日志 |
FTP / WebDAV
工具 | 说明 |
| 配置与运行状态 |
| 合并写入配置 |
| 日志 |
Docker
工具 | 说明 |
| 容器、镜像、卷、Compose 项目(只读) |
IP 过滤
工具 | 说明 |
| 过滤规则 |
| 按 key 读取规则 |
| 端口诱捕已封禁 IP |
| 解除封禁 |
| 日志 |
安全组
工具 | 说明 |
| 安全组、授权与用户(只读) |
| 第三方认证配置(只读) |
日志、存储、主机
工具 | 说明 |
| 日志中心统计、位置与数据流 |
| 查询日志中心 |
| 存储挂载 |
| 启用或停用挂载 |
| 浏览 Lucky 可见的本地路径 |
| 主机与模块状态 |
| Cloudflared 与 Coraza 实例 |
| IP 库查询 |
Web 终端
工具 | 说明 |
| SSH 连接与会话(不含 SFTP) |
| 按名称创建或更新连接 |
通用 API
工具 | 说明 |
| 允许调用的 API 前缀 |
| 调用前缀白名单内的 Lucky API |
lucky_api_call 拒绝以下路径:登录、登出、管理员密码、OpenToken、2FA、配置恢复、进程重启、OAuth 登录、终止主机进程。基础设置仅允许读取。
开发
npm install
npm run typecheck
npm test
npm run lint
npm run buildLUCKY_BASE_URL="http://127.0.0.1:16601" \
LUCKY_OPEN_TOKEN="<open-token>" \
npm run dev发布
版本记录见 CHANGELOG.md。
创建 GitHub Release 会触发 Publish workflow。仓库 Secrets 需配置 NPM_TOKEN(npm granular token,具备 @bearst/lucky-mcp-server 发布权限)。Release tag 须与 package.json 的 version 一致,例如 v0.1.2。
Publish 只在 Release 或手动 workflow_dispatch 时运行,不会在 push 时发版。
License
MIT
English
MCP server for Lucky. It authenticates with OpenToken and exposes stdio tools for reverse proxy, certificates, port forwarding, DDNS, and related Lucky 3.0 modules.
Requirements
Node.js 20+
A Lucky instance with OpenToken enabled (admin port defaults to
16601)
The client sends the token in the openToken header. It does not log in with a password or keep a session cookie.
Install
npx -y @bearst/lucky-mcp-server{
"mcpServers": {
"lucky": {
"command": "npx",
"args": ["-y", "@bearst/lucky-mcp-server"],
"env": {
"LUCKY_BASE_URL": "http://127.0.0.1:16601",
"LUCKY_OPEN_TOKEN": "<open-token>"
}
}
}
}To run a local build, set command to node and args to ["/path/to/lucky-mcp-server/dist/cli.js"].
Environment
Variable | Required | Default | Description |
| yes | — | Lucky admin base URL |
| yes | — | OpenToken |
| no |
| Verify Lucky's TLS certificate. Set |
| no |
| Request timeout in milliseconds |
| no | — | Default web listener key for |
| no | — | Default web listener port for |
| no | — | Comma-separated suffixes allowed for writes |
| no | — | Log request paths to stderr; tokens are not logged |
Issue the token in Lucky settings. Follow Lucky's terms for OpenToken.
Tools
List tools return compact records, not Lucky's full native objects. Secret fields are redacted.
lucky_expose_service selects a listener in this order: rule_key → listen_port → LUCKY_DEFAULT_RULE_KEY → LUCKY_DEFAULT_LISTEN_PORT → an enabled TLS listener (port 443 preferred). It does not create a new listen port. New reverse-proxy routes are cloned from an existing route on the same listener.
lucky_api_call is restricted to allowlisted path prefixes. It rejects login, logout, admin password, OpenToken, 2FA, config restore, process reboot, OAuth login, and host process kill. Base settings are read-only.
See the Chinese section above for the full tool table.
Development
npm install
npm run typecheck
npm test
npm run lint
npm run buildPublish
See CHANGELOG.md. A GitHub Release runs the Publish workflow. Add an NPM_TOKEN repository secret with publish access to @bearst/lucky-mcp-server. The release tag must match package.json version (for example v0.1.2). Publish does not run on push.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Hosted AgentLux MCP server for marketplace, identity, creator, services, and social flows.
MCP Server for agents to onboard, pay, and provision services autonomously with InFlow
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceSecure MCP protocol proxy with OAuth2 + Dynamic Client Registration (DCR), JWT auth, RBAC, rate limiting, multi-server aggregation, and a monitoring/admin dashboard.11MIT
- AlicenseAqualityBmaintenanceA secure MCP server for managing OPNsense firewalls through AI assistants. Provides 81 tools across system, firewall, network, DNS, DHCP, VPN, HAProxy, services, diagnostics, and security domains.8112MIT
- FlicenseNot gradedqualityBmaintenanceAn MCP server with HTTP/stdio support, a web admin panel for managing services, capabilities, and user permissions with Bearer token authentication, enabling relay and access control for MCP tools.
- AlicenseNot gradedqualityCmaintenanceAuthenticating reverse proxy for MCP servers providing credential isolation, OAuth2 token management, and composite tool aggregation.BSD Zero Clause
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/BearstOzawa/lucky-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server