Engwe N1 Air MCP Server

Engwe N1 Air MCP Server

Enables Claude AI to control an Engwe N1 Air e-bike via Bluetooth and IoT API, including speed limit adjustment, lock/unlock, find bike, and real-time stats.

Category
访问服务器

README

🚲 Engwe N1 Air — BLE Reverse Engineering + Claude MCP Server

Reverse engineered the Engwe N1 Air e-bike's Bluetooth protocol and built a Claude AI integration to control it from your Mac.

License Python Node

What This Does

  • 🚀 Unlock speed limit via Bluetooth (up to 40 km/h)
  • 🔒 Lock/unlock the bike remotely via IoT API
  • 🔊 Find your bike (sound + light alarm)
  • 🔋 Battery, mileage, cadence real-time stats
  • 📍 Geo-fence management
  • 💪 PAS level control via Bluetooth
  • 🤖 Claude AI integration — control your bike by talking to Claude
  • 🖥️ Mac menubar app — one-click access to all features

How It Was Built

Step 1 — API Discovery (Charles Proxy)

Captured network traffic from the Engwe iOS app using Charles Proxy. Found the main API endpoint at app-api.engweapp.com with JWT authentication.

Step 2 — APK Decompile (JADX)

Decompiled the Android APK using JADX to find all internal API endpoints and BLE command codes.

jadx -d engwe-source ENGWE_2.7.2_APKPure.xapk
grep -r "iot/device" engwe-source --include="*.java" | grep -o '"[^"]*iot/device[^"]*"' | sort -u

Step 3 — BLE Protocol Reverse Engineering

Found the complete BLE protocol in ProtocolUtil.java and BLEBikeCommand.java.

V2 Protocol Format:

456E + CMD(4) + LEN(4) + DATA + CRC16(4) + 7765

BLE UUIDs (from BluetoothRegulate.java):

Service:  00001820-0000-1000-8000-00805f9b34fb
Write:    00001822-0000-1000-8000-00805f9b34fb
Notify:   00001821-0000-1000-8000-00805f9b34fb

BLE Command Reference

All commands use V2 protocol format: 456E + CMD + LEN + DATA + CRC16 + 7765

Command Hex Description
Speed Limit 2A65 0x00=0, 0x10=10, 0x20=20, 0x30=30, 0x40=40 km/h
PAS Level 010A 0x00–0x05
Motor Current Limit 2A66 Under investigation
Cruise Control Set 0128 Under investigation
Wheel Diameter 08C3 Under investigation
Factory Reset 8049 ⚠️ Irreversible
Lock State 0108 Query lock
Power On/Off 0107 01=on, 02=off
Auto Shutdown Time 1000 Minutes

Speed Limit Example (40 km/h):

# Index 4 * 16 = 0x40
command = "456E2A650001406A237765"

CRC16 Calculation (ModBus):

def crc16(hex_str):
    data = bytes.fromhex(hex_str)
    crc = 0xFFFF
    for byte in data:
        crc ^= byte
        for _ in range(8):
            crc = (crc >> 1) ^ 0xA001 if crc & 1 else crc >> 1
    return format(crc, "04X")

# CRC input = CMD + LEN + DATA
# Example: crc16("2A65" + "0001" + "40") = "6A23"

IoT API Endpoints

Base URL: https://app-api.engweapp.com

Endpoint Description
/api/app/iot/device/lockSwitch Lock/unlock bike
/api/app/iot/device/findVehicle Sound + light alarm
/api/app/iot/device/vibrationAlarmSwitch Vibration alarm + signal
/api/app/iot/device/fenceSwitch Geo-fence on/off
/api/app/iot/device/getFenceList List geo-fences
/api/app/iot/device/bleSenselessSwitch BLE auto-unlock
/api/app/iot/device/headlightSwitch Headlight + realtime PAS/charge
/api/app/iot/device/attr/newest Battery SOC/SOH, mileage, cadence
/api/app/iot/device/version IoT/BT/4G firmware versions
/api/app/iot/device/attr/newest Real-time attributes
/api/app/paypal/syDetail IoT subscription info
/api/app/ride-data/index Weekly ride statistics

Installation

Requirements

  • Node.js 18+
  • Python 3.9+
  • Mac (for menubar app)
git clone https://github.com/SafaAslan/engwe-n1air-mcp
cd engwe-n1air-mcp
npm install
pip3 install bleak

Get Your Token

Use Charles Proxy to capture traffic from the Engwe iOS/Android app. Find the Authorization header in any request to app-api.engweapp.com.

Configure Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "engwe-n1air": {
      "command": "node",
      "args": ["/path/to/engwe-n1air-mcp/index.js"],
      "env": {
        "ENGWE_IMEI": "YOUR_IMEI",
        "ENGWE_BLE_MAC": "YOUR_BLE_MAC",
        "ENGWE_TOKEN": "YOUR_JWT_TOKEN"
      }
    }
  }
}

Find Your IMEI & BLE MAC

# IMEI — visible in Engwe app under bike settings
# BLE MAC — run while bike is on:
python3 -c "
import asyncio
from bleak import BleakScanner
async def scan():
    devices = await BleakScanner.discover(timeout=10)
    for d in devices:
        if d.name and 'ENGWE' in d.name.upper():
            print(d.address, d.name)
asyncio.run(scan())
"

Usage

Claude AI (via MCP)

Once configured, just talk to Claude:

  • "Lock my bike"
  • "What's my battery level?"
  • "Set speed limit to 35 km/h"
  • "Show my ride stats for this week"

Menubar App (Mac)

npm install electron
./node_modules/.bin/electron tray.js

Auto-start on Boot

chmod +x setup_autostart.sh
bash setup_autostart.sh

Speed Limit Script (standalone)

python3 ble_speed3.py

Project Structure

engwe-n1air-mcp/
├── index.js          # Claude MCP server (18 tools)
├── tray.js           # Mac menubar app
├── ble_speed3.py     # Standalone speed limit script
├── ble_scan2.py      # BLE device scanner
├── setup_autostart.sh # Mac autostart setup
└── README.md

⚠️ Disclaimer

Unlocking the speed limit above 25 km/h is illegal on public roads in the EU. This project is for educational and off-road/private use only. Use at your own risk. This project is not affiliated with Engwe.


Contributing

Pull requests welcome! Especially interested in:

  • Testing on other Engwe models (P275 SE, M20, etc.)
  • Cruise control command (0128)
  • Motor current limit (2A66)
  • Android version of menubar app

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选