lucky-mcp
Provides integration with Cloudflare through Lucky's Cloudflared module, enabling management of Cloudflare tunnel functionality.
Allows management of Docker-related features exposed through the Lucky web interface, supporting operations on Docker resources in a Lucky instance.
Click on "Deploy 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., "@lucky-mcp List all port forwarding rules in Lucky."
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.
lucky-mcp
通过 MCP 和 Lucky OpenToken,让 AI 用自然语言管理 Lucky。
当前适配并完成静态接口清点的版本:Lucky 3.0.0。接口目录包含反向代理、端口转发、DDNS、STUN、证书、计划任务、网络唤醒、Web 终端、网络存储、IP 过滤、安全组、日志中心、Docker、Cloudflared 等网页模块。
Lucky 3.0.0 的 OpenToken 页面声明 OpenToken 仅限个人学习、研究和调试,不得用于商业用途。使用者应自行阅读并遵守自己所用 Lucky 版本展示的条款。
安全边界
lucky-mcp 对一般 Lucky 功能不设置额外限制,包括创建、修改、启停、删除和执行操作;但代码永久禁止修改:
Lucky 管理员账号;
Lucky 管理员密码;
OpenToken 的值、开关和确认状态。
这不是提示词约束。业务工具、通用目录接口和设置合并逻辑都会经过代码检查。API 返回中的密码、Token、密钥、Cookie 等字段会自动脱敏。
Related MCP server: Traefik MCP Server
快速开始
要求 Node.js 20 或更高版本。用户只需要 Lucky 地址和 OpenToken:
{
"mcpServers": {
"lucky": {
"command": "npx",
"args": ["-y", "lucky-mcp"],
"env": {
"LUCKY_BASE_URL": "https://lucky.example.com:16601",
"LUCKY_OPEN_TOKEN": "填写自己的32位OpenToken"
}
}
}
}源码运行:
npm install
$env:LUCKY_BASE_URL="https://lucky.example.com:16601"
$env:LUCKY_OPEN_TOKEN="填写自己的OpenToken"
npm run build
npm start自签名证书实例可以设置 LUCKY_TLS_VERIFY=false。除非明确了解风险,否则不要关闭证书校验。
主要工具
lucky_status:版本、系统信息和模块状态。lucky_api_catalog:按模块和副作用查询接口。lucky_api_describe:查看单个接口的版本及请求信息。lucky_api_call:调用目录中任意非 multipart 接口,不能调用目录外地址。端口转发、Web 服务、DDNS、证书、STUN 的增删改查工具。
lucky_get_settings/lucky_update_settings:脱敏读取和安全合并设置。
一句话示例
“列出 Lucky 中所有端口转发规则。”
“创建一个 TCP4 和 UDP4 的端口转发,名称为 home-ssh。”
“检查所有反向代理的后端地址和证书有效期。”
“立即执行指定 DDNS 任务并返回最近日志。”
“查询今天 Web 服务中被 WAF 阻止的来源 IP 排名。”
删除、重启、升级、导入配置等操作能造成明显影响。MCP 客户端可能仍会按自身策略要求确认。
开发与验证
npm run check.capture/ 只用于本地分析对应版本的公开网页前端,不进入 Git。重新提取接口目录的方法见 升级接口目录。
非官方声明
本项目不是 Lucky 官方项目,也不包含 Lucky 源码、前端文件、账号、OpenToken 或用户配置。Lucky 更新可能改变未公开接口,使用前请先备份配置。
Available Tools
26 toolslucky_api_callCall cataloged Lucky APIADestructive
Call any API present in the versioned catalog. Arbitrary URLs are rejected. Account, password, and OpenToken mutations are blocked in code; all other Lucky functions are available.
Inputs: path (required), method (required), body, query, +1 more.
lucky_api_catalogLucky API catalogARead-onlyIdempotent
List APIs discovered from the Lucky 3.0.0 web frontend. Filter by module or side-effect level before using lucky_api_call.
Inputs: limit, module, sideEffect.
lucky_api_describeDescribe Lucky APIARead-onlyIdempotent
Describe one cataloged Lucky endpoint by catalog id.
Inputs: id (required).
lucky_create_certificateB
Create a Lucky certificate using the native Lucky JSON object.
Inputs: value (required).
lucky_create_ddnsC
Create a Lucky ddns using the native Lucky JSON object.
Inputs: value (required).
lucky_create_port_forwardC
Create a Lucky port forward using the native Lucky JSON object.
Inputs: value (required).
lucky_create_stun_ruleC
Create a Lucky stun rule using the native Lucky JSON object.
Inputs: value (required).
lucky_create_web_serviceC
Create a Lucky web service using the native Lucky JSON object.
Inputs: value (required).
lucky_delete_certificateBDestructiveIdempotent
Delete a Lucky certificate by key.
Inputs: key (required).
lucky_delete_ddnsBDestructiveIdempotent
Delete a Lucky ddns by key.
Inputs: key (required).
lucky_delete_port_forwardBDestructiveIdempotent
Delete a Lucky port forward by key.
Inputs: key (required).
lucky_delete_stun_ruleBDestructiveIdempotent
Delete a Lucky stun rule by key.
Inputs: key (required).
lucky_delete_web_serviceADestructiveIdempotent
Delete a Lucky web service by key.
Inputs: key (required).
lucky_get_settingsGet Lucky settingsARead-onlyIdempotent
Read Lucky base settings. Secret values are always redacted.
Inputs: no named parameters.
lucky_list_certificatesARead-onlyIdempotent
List Lucky certificate objects.
Inputs: no named parameters.
lucky_list_ddnssARead-onlyIdempotent
List Lucky ddns objects.
Inputs: no named parameters.
lucky_list_port_forwardsARead-onlyIdempotent
List Lucky port forward objects.
Inputs: no named parameters.
lucky_list_stun_rulesARead-onlyIdempotent
List Lucky stun rule objects.
Inputs: no named parameters.
lucky_list_web_servicesARead-onlyIdempotent
List Lucky web service objects.
Inputs: no named parameters.
lucky_statusLucky statusARead-onlyIdempotent
Read the Lucky version, system information, and enabled module list.
Inputs: no named parameters.
lucky_update_certificateBIdempotent
Update a Lucky certificate using its key and complete native Lucky JSON object.
Inputs: key (required), value (required).
lucky_update_ddnsAIdempotent
Update a Lucky ddns using its key and complete native Lucky JSON object.
Inputs: key (required), value (required).
lucky_update_port_forwardBIdempotent
Update a Lucky port forward using its key and complete native Lucky JSON object.
Inputs: key (required), value (required).
lucky_update_settingsSafely update Lucky settingsAIdempotent
Merge a partial patch into Lucky base settings while preserving and prohibiting changes to the admin account, admin password, and OpenToken fields.
Inputs: patch (required).
lucky_update_stun_ruleCIdempotent
Update a Lucky stun rule using its key and complete native Lucky JSON object.
Inputs: key (required), value (required).
lucky_update_web_serviceBIdempotent
Update a Lucky web service using its key and complete native Lucky JSON object.
Inputs: key (required), value (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 26 tools
Each resource type has a clearly separated CRUD set, and settings/status/API catalog tools serve distinct purposes. The main ambiguity is lucky_api_call, which can theoretically overlap with the explicit CRUD tools, but it is framed as a generic catalog-driven escape hatch.
The lucky_ prefix and snake_case convention are consistent, and most tools follow a verb_noun pattern like list/create/update/delete. Minor deviations exist: lucky_status uses a bare noun instead of get_status, and api_catalog/api_describe are not perfectly parallel with list/describe verbs.
At 26 tools this is heavier than the typical well-scoped server, but the count is justified by applying the same CRUD pattern across five resource types plus settings, status, and API discovery tools. The tools are not redundant or padded; the breadth comes from the domain.
The server provides full list/create/update/delete coverage for certificates, stun rules, port forwards, web services, and DDNS, plus settings read/update, status, and an API catalog escape hatch. This covers the apparent Lucky management lifecycle without obvious dead ends.
Maintenance
Related MCP Connectors
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Manage hosts, redirects, SSL, and traffic analytics from Claude and other AI assistants.
Deploy and manage your apps, databases, storage, and scheduled jobs from your AI agent
Connect your AI agent to 300+ methods and 100+ live tools
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Coolify infrastructure including servers, applications, databases, deployments, and 80+ one-click services through 98 comprehensive tools for both cloud and self-hosted instances.MIT
- FlicenseBqualityDmaintenanceEnables AI assistants to query and manage Traefik reverse proxy configurations, including routers, services, and middlewares, through natural language. It supports monitoring service health, viewing statistics, and performing administrative tasks across various providers like Docker.66-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Nginx Proxy Manager instances through natural language, covering 28 tools for proxy hosts, certificates, streams, and more.MIT
- AlicenseBqualityCmaintenanceEnables AI agents to manage Nginx Proxy Manager (reverse proxies, streams, redirects, and Let's Encrypt certificates) through natural language commands.3023 npmMIT