服务端需先填写 config.yml 的域名和 .env 的 AUTH_ALLOWED_PRINCIPALS 允许登录名单;docker-compose.yml 默认接入已有的 traefik 网络,需自备反向代理;新设备若未先配对需用 mg pair 与已有设备配对才能解密历史。
midgard
changkunGPL-3.0活跃维护跨设备同步剪贴板及历史记录的自托管方案,包含 Mac 菜单栏应用、Linux/Windows 守护进程和 iPhone 快捷指令,中继服务器不保存任何副本。
⛰️ Your clipboard and its history on all your devices: a Mac menu-bar app, a daemon for Linux and Windows, iPhone Shortcuts, and a self-hosted relay that keeps no copies
cp config.example.yml config.yml && cp .env.template .env && make build && make up
mg login && mg daemon install && mg daemon startREADME 未说明具体硬件或显存要求;服务端需一台有公网地址的机器,客户端支持 macOS、Linux、Windows,手机通过网页访问。
自托管的端到端加密剪贴板同步工具,让多设备共享复制历史,服务器只转发不保存
跨设备同步剪贴板及历史记录的自托管方案,包含 Mac 菜单栏应用、Linux/Windows 守护进程和 iPhone 快捷指令,中继服务器不保存任何副本。
核心能力
- 每台设备本地保存完整剪贴板历史,顺序一致
- 服务器仅在内存中暂存密文,设备全部收到后即丢弃
- 设备间共享密钥加密,通过配对码或二维码分发
- Mac 菜单栏应用支持 Ctrl+Option+S 把剪贴板或文件变成分享链接
- 提供 mg 命令行守护进程,覆盖 Linux、Windows 和 macOS
容易踩的坑
- v0.4.0最新正式版2026-09-27 · 2026-09-27 13:53 UTC
The Mac app keeps itself up to date, and what a new user ran into setting it up is fixed.
What's new
- The Mac app updates itself. It looks for a new release once a day and asks before it installs one. Check for Updates… is in its gear menu and in Settings › About. It takes only updates signed with the project's key and with the same Developer ID, from these releases, whichever server you use. This is the last version you download by hand.
- An email on the allowlist admits your devices. A device signs in with a token that names its principal but no email, so a server that listed someone by email let them in on the web page and turned their Mac away, as "Offline". It now remembers the email you sign in with on the web page, and admits your devices by it. Installation says which admits what.
- "Not on this server's list", not Offline. When a server turns you away, the Mac app says so, and what to do: ask whoever runs it to add you, or, if they just did, sign in once on its web page. The web page says the server is private, and links to running your own.
- A friendlier first start. The welcome offers the servers it knows in a menu, or another you type. It comes back to the front once the browser has signed you in. Midgard is in the Dock and Command-Tab while one of its windows is open, and "You're all set" shows where its menu bar icon is.
- Copies waiting to reach the server show their picture and their whole text, can be copied back, or taken back before they go.
- The pairing code in Settings refreshes once a device takes it, or its ten minutes pass, instead of showing one that no longer works.
Upgrading
- On a Mac, download
Midgard.dmgbelow, or from your server's web page, and replace the app once. From now on it updates itself. - If you run a server, update it: its database gains a table by itself, and nothing needs setting. A person listed by email can use their devices once they sign in on the web page; listing their principal id instead admits them everywhere at once. The server logs the principal id of each sign-in it turns away.
What's next
specs/roadmap.md now has keyboard-first history on the Mac, as Raycast has: a hotkey to open it, type to filter, and Return to paste into the app you were in.
Downloads
Midgard.dmg: the Mac app, notarized, for macOS 14 or later on Apple silicon or Intel.appcast.xml: the feed the app updates from.mgfor macOS, Linux and Windows.checksums.txtverifies every file here.
Full changelog: https://github.com/changkun/midgard/compare/v0.3.0...v0.4.0
- v0.3.02026-09-27 · 2026-09-27 11:46 UTC
查看更新说明
Your copies are encrypted end to end: the server passes them between your devices and cannot read them.
What's new
- End-to-end encryption. Your devices share a key, which the first of them makes. Every copy is sealed with it before it leaves a device, and opened only on another; the server sees when a copy passes, from which device, and its type and size, never what it says. What the server can see.
- Pairing. Give the key to each other device once, with a code or a QR: from the Mac app (Settings → Encryption → Pair Another Device), with
mg pairandmg pair <code>, or in a browser, by the code's link. A code works once, for ten minutes. Pairing a device. - The web page encrypts too, in the browser, with a key it cannot export: on a computer, or on an iPhone's Home Screen, where scanning the Mac's QR pairs it. On an iPhone.
- A bridge for the iPhone Shortcuts, which cannot encrypt. It is off until you switch it on, on one of your devices, and then passes the Shortcuts' copies in the clear, as the setting says.
- The Mac app is notarized by Apple: it opens like any app you download, with no trip to System Settings. Its disk image shows its version.
mgsays inmg statuswhether this machine encrypts, exits with code 6 when it lacks the key, and refusesmg share listand the like, which used to publish your clipboard under that name.GET /clipboardnames the device the copy came from, as the history does, anddaemon_id, which names a client that posts copies, is documented (#30).- The web page fits a phone's width, and its front page shows midgard at work.
Upgrading
- Update every device. The first to run v0.3.0 makes your key; each other one asks to pair. Once your key exists, apps and daemons older than v0.3.0 have their copies refused, and are told to update.
- Pair each browser once, and your iPhone's Home Screen page by the Mac's QR.
- Shortcuts and Tasker call
/midgard/api/v1/plain/clipboardnow. Switch the bridge on (the Mac app's Settings → Encryption, orplain_bridge: truefor a daemon), and add the Shortcuts again from the web page. - If you run a server, there is nothing to set: it keeps your key's id, never the key. See Upgrading to encryption.
What's next
midgard is heading toward continuity between all of one's devices, with files, phone apps, handoff and agents: specs/roadmap.md.
Downloads
Midgard.dmg: the Mac app, notarized, for macOS 14 or later on Apple silicon or Intel.mgfor macOS, Linux and Windows.checksums.txtverifies every file here.
Full changelog: https://github.com/changkun/midgard/compare/v0.2.0...v0.3.0
- v0.2.02026-09-27 · 2026-09-27 06:28 UTC
查看更新说明
midgard is redesigned: your clipboard, and its history, on all your devices, through a server that keeps none of it.
What's new
- The server keeps no copies. It passes each copy from one of your devices to the others, numbers it so every device has the same history in the same order, and holds it in memory only until each device has it. A laptop you closed gets what you copied meanwhile when you open it again. How it works.
- History on your devices. Each device keeps the last 200 copies, for 30 days, up to 64 MB. A copy is kept once: copying it again moves it to the top.
- The Midgard app for the Mac. It lives in the menu bar, with your recent copies to put back and the history in a window. Ctrl+Option+S shares the clipboard at a link, and it can start at login. Download
Midgard.dmgbelow or from your server's web page. It needs macOS 14 or later, on Apple silicon or Intel. - A web page for any computer or phone. It shows your clipboard and history, what's on its way to devices that are offline, and your devices, shares and app tokens.
- iPhone Shortcuts, Get from Midgard and Send to Midgard, added from the web page.
mgfor scripts and agents:mg copy,mg paste,mg history,--jsonon every command that prints results, and stable exit codes.- Shares: publish a copy or a file at a link, optionally with a name and an expiry. Links shared from an older server keep working once imported.
- Copies a password manager marks as secret are neither synced nor kept.
Upgrading
- Sign-in is through auth.latere.ai, for the people on the server's allowlist. The shared password is gone. Sign in once on each device: from the Mac app, or with
mg login. - The API changed in place at
/midgard/api/v1, so older clients don't work with this server. Updatemgand the daemon on every device. - If you run a server, see Installing midgard for the
.envsettings, the reverse proxy, and importing an older server's shares withmg server import. The older server's plaintext clipboard log is not imported.
Not yet
End-to-end encryption is designed (specs/redesign.md §11) and comes in a later release.
Downloads
Midgard.dmg: the Mac app. It isn't notarized by Apple yet, so the first time you open it, macOS refuses. Allow it once in System Settings → Privacy & Security → Open Anyway.mgfor macOS, Linux and Windows.checksums.txtverifies every file here.
Full changelog: https://github.com/changkun/midgard/compare/v0.1.0...v0.2.0
- v0.1.02024-01-06 · 2024-01-06 08:37 UTC
查看更新说明
Full Changelog: https://github.com/changkun/midgard/compare/v0.0.9...v0.1.0
- v0.0.92022-12-31 · 2022-12-31 10:54 UTC
查看更新说明
What's Changed
- internal/version: use stirngs.Builder by @kvii in https://github.com/changkun/midgard/pull/10
- cmd/alloc: allocated URL to clipboard does not work on Linux by @Summuss in https://github.com/changkun/midgard/pull/16
- api: typo fixes by @kvii in https://github.com/changkun/midgard/pull/18
- Makefile: update golang.org to go.dev by @gogorush in https://github.com/changkun/midgard/pull/20
- api: fix ticker not stop by @kvii in https://github.com/changkun/midgard/pull/21
- all: lint fixes by @kvii in https://github.com/changkun/midgard/pull/22
- all: fix service lunch issue in windows by @kvii in https://github.com/changkun/midgard/pull/24
- all: upgrade go Go 1.19
New Contributors
- @kvii made their first contribution in https://github.com/changkun/midgard/pull/10
- @Summuss made their first contribution in https://github.com/changkun/midgard/pull/16
- @gogorush made their first contribution in https://github.com/changkun/midgard/pull/20
Full Changelog: https://github.com/changkun/midgard/compare/v0.0.8...v0.0.9
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
midgard

English | 中文
midgard keeps your clipboard the same on all your devices: copy on one, paste on another, and find what you copied yesterday on any of them. Turn a copy or a file into a link to share. Your copies are encrypted end to end: the server passes them between your devices and cannot read them. It runs on a server you own, for the people you let sign in, on macOS, Linux and Windows, and on phones through the web page.
How it works
flowchart LR
subgraph you["Your computers: where copies live"]
A["Laptop<br/>midgard · history"]
B["Desktop<br/>midgard · history"]
end
subgraph other["Other ways in"]
W["Web page · phone"]
C["mg · agents"]
end
R["Your midgard server<br/>relays and orders sealed copies,<br/>keeps none, reads none"]
A <-->|sealed| R
B <-->|sealed| R
W <-->|sealed| R
C <-->|sealed| R
- Your copies stay on your devices. Each device keeps the history, the same list in the same order on every one.
- The server keeps none of them. It passes each copy from one of your devices to the others, numbering them so every device agrees on the order, and holds a copy in memory only until each device has it: one that was off gets it when it comes back.
- The server cannot read them. Your devices encrypt every copy with a key they share, which the first of them makes; you give it to each other one by pairing, with a code or a QR.
- Only you see your clipboard. Everyone signs in through auth.latere.ai, the server lets in the people on its allowlist, and each reaches only their own.
How midgard works explains it in full: what is kept where, what happens while a device is away or the server restarts, and what the server can see.
What it looks like
On a Mac, midgard lives in the menu bar, and its window has the whole history. On a phone, or in any browser, the web page does the same, and encrypts as the apps do.
Quick start
1. The server. On a machine with a public address:
$ cp config.example.yml config.yml # set domain
$ cp .env.template .env # set AUTH_ALLOWED_PRINCIPALS: who may sign in
$ make build && make up # or run: mg server
docker-compose.yml joins an existing traefik network; see
Installation to put midgard behind your own reverse proxy.
2. A Mac. Download the app from your server's web page, Download for
Mac (for changkun.de's, here),
or build it with make mac. It asks for your server, signs you in, and
lives in the menu bar: recent copies to put back, the history in a
window, Ctrl+Option+S to share the clipboard at a link. It replaces
mg daemon on a Mac; see the Midgard app.
3. Linux, Windows, or a Mac without the app. Download mg from the
releases (or
go install changkun.de/x/midgard@latest, which names it midgard), then
put this in ~/.config/midgard/config.yml on Linux,
~/Library/Application Support/midgard/config.yml on macOS, or
%AppData%\midgard\config.yml on Windows:
domain: example.com # or http://your-server:8456
$ mg login # sign in through auth.latere.ai, once
$ mg daemon install # as yourself, no sudo
$ mg daemon start
$ mg status
server status: OK
daemon status: OK
If another of your devices connected first, pair this one with it: show a
code on that one (the Mac app's Settings, Encryption, or mg pair), then
mg pair <code> here. See Pairing a Device.
A device that cannot open a browser to sign in can use an app token
instead: mg server token add <name> --owner <you> on the server
(see Usage).
Now copy something on one device and paste it on another. mg share turns the
clipboard, or a file, into a link; see Usage.
Docs
Contributes
Easiest way to contribute is to provide feedback! I would love to hear what you like and what you think is missing. Issue and PRs are also welcome.
Acknowledgment
The author of this project would like to thank Wen Yang and Quancheng Rao for their inspiring discussion and testing in the early stage of the midgard.
License
Copyright 2020-2021 Changkun Ou. All rights reserved.