I built a local-first tab manager and gave it an MCP server so Claude can organize my tabs

2026年8月14日1 次浏览来源:Dev.to阅读原文

My browser is a war crime I'm a designer and developer, and a hopeless tab hoarder.

On a normal day I've got 70+ tabs open across a couple of windows, every favicon crushed into an unreadable sliver, and my "system" for finding anything is to just… open another tab.

Bookmarks?

A write-only graveyard I never revisit.

I bounced between tab managers for a while.

Toby was the one that stuck — until it capped the free plan at 60 saved tabs and started asking for an account.

For a tab hoarder, a 60-tab cap is like a notes app that locks after 60 words.

That was the nudge.

So I did the reasonable thing and spent way too long building my own.

It's called Mos Tab.

This is the build story — the parts I'm proud of, the part that nearly broke me (multiple windows, I'm looking at you), and the weirdly fun part at the end where I let Claude reorganize my tabs.

What I actually wanted Three non-negotiables: Local-first.

No account required.

Data lives in the browser, works offline.

I was tired of "sign in to see your own bookmarks." No limits on the free stuff.

Saving a tab locally costs me nothing to run — so there's no reason to cap it.

A calm dashboard, not a list.

I stare at my new tab all day; it should feel like a desk, not a void.

The shape of it Mos Tab overrides (MV3).

The data model is a boring normalized tree — Space → Collection → Section → Tab — records plus ID arrays for ordering.

It's a single Zustand store with a middleware writing to .

Your currently-open tabs show in a live side panel (); one click saves them into a collection, drag to organize, and a palette searches everything you've saved.

Stack, for the curious: React 18 + TypeScript + Vite + , Tailwind, dnd-kit, zod, i18next (5 languages).

Since the new tab is prime real estate, I threw in the stuff I open a tab for anyway — calendar, pomodoro, to-dos, sticky notes.

All free.

So far, so normal.

Then I wanted sync.

The hard part: sync (or, how multiple windows tried to kill me) Local-first is lovely until you have two machines.

I wanted optional cloud sync (the paid tier — more on money later) without turning this into a database migration.

The backend is deliberately dumb: a Cloudflare Worker + R2, one JSON blob per user ().

No per-row DB.

To save, you the blob back with an ETag conditional request ().

On a (someone wrote first), you pull, 3-way merge on the client, and push again.

The 3-way merge (base + local + remote) handles the real cases: both sides added a tab → keep both; something in vanished on one side → it was deleted, respect it; field conflicts → local wins.

Sticky-note text conflicts resolve to a symmetric content-addressed copy, so two machines converge instead of endlessly duplicating.

The part that actually broke me wasn't cross-device — it was multiple windows on the same machine.

Every window wanted to push, each invalidating the others' ETag → 412 → merge → push → 412 → forever.

A beautiful infinite loop.

The fix: only the focused window pushes.

Every window can pull (reads are idempotent), but writes are gated to the focused one, with a flush-on-blur so the last edit isn't lost when you switch away.

Add adaptive polling backoff (15s active → 2min idle) and an "away mode" that stops polling after 20 min of no activity, and it stops hammering the Worker.

The fun part: teaching Claude to use my tabs (MCP) Here's the part I'm actually excited about.

I gave Mos Tab a remote MCP server so you can connect Claude or ChatGPT to it.

Once connected, the assistant can search and summarize everything you've saved (tabs, notes, to-dos) and — the fun bit — save new things it finds into a brand-new space, add notes, or make a public share link.

All from the chat.

Concrete example.

I told Claude: "Find the top-rated budget strollers on Amazon, save them to my tabs, and make a share link." A few seconds later there was a new "Stroller shortlist" space on my dashboard, organized into categories, and a public link I sent straight to my wife — she opened it in her brow

分享