
harald
io.github.k0nnect由 GitHub 帳號 k0nnect 發布v0.2.2更新於 Nov 3, 2026
幫助編碼代理分析你所擁有裝置的藍牙低功耗和經典協議。
AI 翻譯由 AI 模型根據下方的原文描述翻譯,可能有誤。
原文描述
helps coding agents work out the bluetooth le and classic protocol of gadgets you own
概覽
harald 的本機 MCP 服務;無需登入;STDIO。
暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 harald,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[harald ハーラル ᚼᛅᚱᛅᛚᛏᚱ. teach your agent to speak bluetooth.]
[pypi] [works with: claude code · codex · cursor] [devices: 1 decoded] [license: mit]
install / how it works / devices / bluetooth classic / add your device
fig. 1 · claude + harald find a sony wh-1000xm5's control channel over bluetooth classic, wait for you to arm it, then turn noise cancelling on. real hardware, sped up.
一 how it works
harald is an mcp server, a cli and a playbook for coding agents. it gives your agent hands and ears for bluetooth le and classic, so it can work out the protocol of a gadget you own. then you control that gadget from your own code instead of the vendor's app.
二 install
you need uv. then:
that puts harald on your path for the commands below. if your shell can't find it,
run uv tool update-shell. to try harald without installing it, run
uvx harald --help: uvx fetches harald and runs it once. tested on mac; linux is
experimental, see below.
the first time harald scans, macos asks whether your terminal app may use bluetooth. allow it. if you missed the prompt, turn it on in system settings › privacy & security › bluetooth.
two optional tools, for the steps that need them:
brew install jadxlets harald read a vendor's android app.brew install libimobiledevicerecords your iphone's bluetooth log from the terminal.
harald also works without an agent:
harald --help lists the rest, and bluetooth classic has
the commands for classic gadgets.
linux (experimental)
harald works on linux too, for bluetooth le and classic, through bluez. you need bluez
5.50 or newer with bluetoothd running, and your user in the bluetooth group: log out
and back in after adding it. harald needs no root, and there is no permission prompt
as on macos, but it can't reach bluetooth from inside a sandbox such as snap or
flatpak. the install above works as it is, on uv's own python too. if harald says
bluetooth is off, run bluetoothctl power on, with rfkill unblock bluetooth first
if it is blocked, and check bluetoothd with systemctl status bluetooth.
pair a classic gadget in your own terminal, in this order:
bluetoothctl pairable on. without it, bluez makes a bond that is gone after the next disconnect.bluetoothctl scan on, until the gadget shows up.bluetoothctl pair <address>.bluetoothctl trust <address>.
if harald says the gadget has forgotten the pairing, run
bluetoothctl remove <address> and pair it again.
linux is experimental: tested against an emulated gadget, not yet on real hardware. if you run it on linux, tell us how it went in an issue.
三 devices
each decoded device lives in
devices/ with its protocol
written up and a standalone driver. harald devices lists them, and
harald drive <slug> <command> runs one, for example harald drive <slug> on.
四 agent setup
add the mcp server to your agent, then install the playbook: the step-by-step method your agent follows to crack a gadget.
claude code, in your project folder:
use --dest ~/.claude/skills/harald to have the skill in every project.
codex
add this to ~/.codex/config.toml, or run codex mcp add harald -- uvx harald mcp:
then, in your project folder:
this writes AGENTS.md. if your project already has one, harald leaves it alone; use
--dest ~/.codex to install it for every project instead.
cursor
add this to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json for every
project:
cursor has no playbook; it uses harald's tools directly.
then ask your agent to work out your gadget with harald. it will ask you for two things only you can do.
record your phone talking to the gadget. a computer cannot overhear phone-to-gadget traffic without extra hardware, so the log comes from your own iphone. a bluetooth classic gadget's log comes from an android phone instead; see bluetooth classic.
- on the iphone, install apple's bluetooth logging profile: "bluetooth for ios/ipados" on apple's profiles and logs page. it is free.
- connect the iphone to your mac by cable. open packetlogger, from apple's
additional tools for xcode, and choose
file › new ios trace. or, from the terminal:
idevicebtlogger capture.pklg, which records until you press ctrl-c. - in the vendor app, do one thing at a time, a few seconds apart, in the order your agent asks for.
- stop the trace, save the
.pklgfile and give your agent its path. to look at it yourself:harald capture open capture.pklg.
if packetlogger records nothing, remove the logging profile and install it again.
get the vendor's android app. if the commands look encrypted, your agent asks for
the apk of the vendor app you already use. you don't need an android phone, and
harald never downloads apps: download it yourself from
apkmirror, which verifies each app's signature, or with
apkeep (apkeep -a <package name> .). the package
name is the id= part of the app's play store address.
五 bluetooth classic
some gadgets, often headphones and speakers, are controlled over bluetooth classic instead of bluetooth le: the vendor app talks to an rfcomm channel, a plain byte stream. harald reaches those too, on a mac or linux; bluetooth le works as before.
pair the gadget first: on a mac in system settings > bluetooth, keeping it connected
there; on linux with bluetoothctl, as in install. harald doesn't
search for or pair classic gadgets, and harald scan only sees bluetooth le. classic
addresses look like aa:bb:cc:11:22:33.
<service> is a service uuid or channel number from harald classic services; add
--refresh there when the list looks out of date. a mac reads that list from its
own cache; on linux harald asks the gadget itself, so the gadget has to be on and in
range. harald classic send takes one or more messages and sends them in order,
listening for replies after each one (--listen s, 2 seconds by default). if the
grant runs out or the link fails partway, it prints what it sent and received, says
why on stderr and exits 1. harald classic listen sends nothing and listens for
--seconds s (5 by default). either listens for at most 30 seconds at a time.
like harald write, harald classic send needs harald arm <address> first, and
every message spends one write from the grant, a query too. harald never opens the
channels of protected profiles such as hands-free or file transfer; see
safety. your agent gets the same four as mcp tools: classic_devices,
classic_services, classic_send and classic_listen. none of them arms.
classic captures come from android. an iphone capture of a classic gadget shows only apple's iap2 wrapper, which harald can't unwrap yet, so record the vendor app from an android phone's bluetooth log:
- turn on developer options (tap the build number seven times in the phone's about screen), then turn on the bluetooth hci snoop log in them, choosing enabled rather than filtered if it asks.
- with the vendor app closed, turn the phone's bluetooth off and on, so the log is running before the app opens its channel.
- in the vendor app, do one thing at a time, a few seconds apart, as your agent asks.
- with usb debugging on, run
adb bugreport. its zip holdsbtsnoop_hci.log; give your agent that file's path, or look at it yourself withharald capture open btsnoop_hci.log.
harald apk flags the rfcomm sockets and uuids in a vendor's android app as well as
its bluetooth le calls.
六 safety
harald is for gadgets you own: interoperability and research. don't use it on anyone else's devices.
-
writes need you. harald refuses every write until you run, in your own terminal:
that grants a budget of n writes for m minutes (50 and 30 if you leave the flags out), and each write spends one. it shows the grant and waits for you to type
arm, and it refuses to run without a terminal.harald statusshows what is armed andharald disarm <address>revokes it. there is no mcp tool that arms. -
the gate has limits.
harald armstops casual or accidental arming by an agent, but it is not a sandbox. grants live in a file,~/.harald/arm.json, and any agent that can run arbitrary commands or write files on your machine could get around the gate. what keeps a cooperative agent out is the playbook's rule: it never runsharald arm,harald write,harald drive,harald classic sendor a driver from its own shell; you do. it sends classic messages only through itsclassic_sendtool. -
firmware updates are blocked. writes to firmware-update (dfu) services stay refused even when a device is armed, so a stray write cannot start a firmware update. only
--allow-dfuonharald armlifts that, and working out a protocol never needs it. harald also blocks the classic firmware-update channels it knows, so far airoha's tooling channel, the same way unless you arm with--allow-dfu. but many classic gadgets take firmware over their normal control channel, where harald can't tell an update from any other message, so your agent must never send a message whose purpose it doesn't know. -
classic channels are fenced. harald never opens a channel whose service record lists hands-free, headset, dial-up networking, obex object push and file transfer, phonebook, messages, sim access or apple iap2. the serial port profile is allowed, since many gadgets' control channels use it. harald also refuses channels missing from the device's service list. with
harald classic send, every message spends one write, a query too. -
library drivers need no arming.
harald driveruns adevices/entry's standalone driver, which you start yourself, so it sits outside the gate. read a driver before you run it, as you would any script. -
only app-wide keys are shared. a
devices/entry may carry a key only if it is the same on every unit and ships inside the vendor app. per-unit keys and pairing keys never go in the library; they stay in your ownharald-work/folder.
七 contributing a device
cracked a gadget? your agent's work is in harald-work/<slug>/. turn it into
devices/<slug>/ with a device.toml, protocol.md and driver.py, then open a pull
request. the
contributing guide
has the details, including the keys rule.
mit license. harald is named after king harald "bluetooth" of denmark, after whom bluetooth is named; ᚼᛅᚱᛅᛚᛏᚱ is his name as it is carved on the jelling stone.
來源:README.md,提交 d43a802
工具
0版本歷史
1- v0.2.2最新Nov 3, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分