A Telegram bot that calls the McDonald's MCP tools (campaign calendar and coupons) via Streamable HTTP.
campaign-calender) via Telegraph article (with images)available-coupons) via Telegraph article (with images)auto-bind-coupons)my-coupons).env.example to .env and fill in TELEGRAM_BOT_TOKEN.npm install
npm start
/token YOUR_MCP_TOKEN - save your MCP token/account add <name> <token> - add/update an account/account use <name> - switch active account/account list - list accounts/account del <name> - delete an account/calendar [YYYY-MM-DD] - campaign calendar (optional date)/coupons - available coupons/claim - one-click claim all available coupons/mycoupons - my coupons list/autoclaim on|off [name] - enable/disable daily auto-claim per account/autoclaimreport success|fail on|off [name] - enable/disable auto-claim reporting per account/status - show account status/stats - my claim stats/cleartoken - clear all accounts/admin users - admin stats (users/accounts/claim totals)See .env.example for all options. Key variables:
TELEGRAM_BOT_TOKEN (required)MCD_MCP_URL (default: https://mcp.mcd.cn/mcp-servers/mcd-mcp)HTTP_PROXY / HTTPS_PROXY (optional, for users in China or behind proxy)CACHE_TTL_SECONDS (default: 300)CACHEABLE_TOOLS (default: campaign-calender,available-coupons)AUTO_CLAIM_CHECK_MINUTES (default: 10)AUTO_CLAIM_HOUR (default: 9)AUTO_CLAIM_TIMEZONE (default: Asia/Shanghai)AUTO_CLAIM_SPREAD_MINUTES (default: 600)AUTO_CLAIM_MAX_PER_SWEEP (default: 10)AUTO_CLAIM_REQUEST_GAP_MS (default: 1500)GLOBAL_BURST_WINDOW_MINUTES (default: 30)GLOBAL_BURST_CHECK_SECONDS (default: 60)ADMIN_TELEGRAM_IDS (comma-separated Telegram user IDs for whitelist mode)
data/telegraph.json.sudo apt update
sudo apt install -y git curl
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
Verify:
node -v
npm -v
git clone https://github.com/ButaiKirin/MaiMaiBot.git
cd MaiMaiBot
cp .env.example .env
Edit .env and set:
TELEGRAM_BOT_TOKENMCD_MCP_URL (optional)Install dependencies:
npm install
Run once to verify:
npm start
Create a service file:
sudo tee /etc/systemd/system/maimai-bot.service > /dev/null <<'SERVICE'
[Unit]
Description=MaiMai Telegram Bot
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/MaiMaiBot
EnvironmentFile=/opt/MaiMaiBot/.env
ExecStart=/usr/bin/node /opt/MaiMaiBot/src/index.js
Restart=always
RestartSec=5
User=ubuntu
Group=ubuntu
[Install]
WantedBy=multi-user.target
SERVICE
Adjust paths and user:
sudo mkdir -p /opt
sudo mv ~/MaiMaiBot /opt/MaiMaiBot
sudo chown -R ubuntu:ubuntu /opt/MaiMaiBot
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable --now maimai-bot
View logs:
journalctl -u maimai-bot -f
cd /opt/MaiMaiBot
git pull
npm install
sudo systemctl restart maimai-bot
# 创建目录
mkdir -p maimai-bot && cd maimai-bot
# 创建 .env 文件
cat > .env << 'EOF'
TELEGRAM_BOT_TOKEN=your_token_here
MCD_MCP_URL=https://mcp.mcd.cn/mcp-servers/mcd-mcp
MCP_PROTOCOL_VERSION=2025-06-18
CACHE_TTL_SECONDS=300
AUTO_CLAIM_HOUR=9
AUTO_CLAIM_TIMEZONE=Asia/Shanghai
# 代理设置(国内用户可选)
# HTTP_PROXY=http://your-proxy:port
# HTTPS_PROXY=http://your-proxy:port
EOF
# 创建数据目录
mkdir -p data
# 启动容器
docker run -d --name maimai-bot \
--env-file .env \
-v ./data:/app/data \
--restart unless-stopped \
qc0624/maimai-bot:latest
# docker-compose.yml
services:
maimai-bot:
image: qc0624/maimai-bot:latest
container_name: maimai-bot
restart: unless-stopped
env_file:
- .env
volumes:
- ./data:/app/data
# 如需使用代理,取消注释并配置
# environment:
# HTTP_PROXY: http://your-proxy:port
# HTTPS_PROXY: http://your-proxy:port
# 启动
docker compose up -d
# 查看日志
docker logs -f maimai-bot
# 停止
docker compose down
git clone https://github.com/ButaiKirin/MaiMaiBot.git
cd MaiMaiBot
cp .env.example .env
# 编辑 .env 填入 TELEGRAM_BOT_TOKEN 和代理配置(如需要)
docker compose up -d --build
注意事项:
./data 目录,容器会自动处理权限HTTP_PROXY 和 HTTPS_PROXY 环境变量http://host:port 或 socks5://host:portContent type
Image
Digest
sha256:037894152…
Size
47.1 MB
Last updated
8 months ago
docker pull qc0624/maimai-bot