AI-enhanced Maccy: transforms, MCP server, insights, smart clipboard#1
Open
AI-enhanced Maccy: transforms, MCP server, insights, smart clipboard#1
Conversation
- Fix off-by-one crash in App Intents (Get, Select, Delete) that would crash when requesting the last item by index - Add SHA-256 content hashing for O(1) dedup instead of O(n*m) full table scan on every clipboard copy - Cache compiled regexes in Clipboard.shouldIgnore() to avoid recompilation on every 0.5s poll cycle - Fix data race in Vision OCR callback writing to @model from background thread — dispatch to main queue - Graceful database recovery instead of fatalError on corrupt SQLite — attempts re-creation before crashing - Fix Accessibility.check() silent no-op — now prompts user for permissions and gates paste functionality on approval Co-Authored-By: Claude <noreply@anthropic.com>
…d, filter chips - Add ContentCategory enum with automatic detection of clipboard content types: URLs, code, emails, colors, file paths, phone numbers, images, files, and plain text. Uses heuristic pattern matching (regex + code structure analysis) with zero user effort required. - Add InsightsView — a new "Insights" Settings pane with: - Overview cards: total items, total copies, duplicate rate, apps used - Content type donut chart (Swift Charts) - App usage horizontal bar chart (which apps you copy from most) - Hourly activity chart (when you copy most during the day) - Top 10 most-copied items with copy count badges - Add CategoryFilterView with filter chips UI component for future integration into the main clipboard popup (All, URLs, Code, etc.) - Wire auto-categorization into Clipboard.checkForChangesInPasteboard() so every new clipboard entry is categorized on capture - Add category field to HistoryItem SwiftData model Co-Authored-By: Claude <noreply@anthropic.com>
Enable multi-selection + paste stack:
- Flip multiSelectionEnabled to true — the entire feature was already
built but permanently disabled. Cmd+click to select multiple items,
then paste them sequentially as a stack.
Add item metadata display in clipboard list:
- Category icons (link, code, envelope, etc.) shown inline
- Copy count badges ("3×") for items copied more than once
- Relative timestamps ("2m", "1h", "3d") showing when last copied
- All gated behind new "Show item metadata" toggle in Appearance settings
Expand search to match app names and categories:
- Typing "Chrome" now finds all items copied from Chrome
- Typing "URL" or "Code" finds items by auto-detected category
- Falls through to title search first, then app, then category
Co-Authored-By: Claude <noreply@anthropic.com>
Paste Transforms — type ":" in search to access 17 built-in transforms: - :json / :json1 — pretty-print or minify JSON - :upper / :lower / :title — case conversion - :trim / :1line — whitespace cleanup - :noutm — strip UTM tracking params from URLs - :urlencode / :urldecode — URL encoding - :b64enc / :b64dec — Base64 encode/decode - :escape / :unescape — escape special characters - :sort / :uniq — sort or deduplicate lines - :count — character/word/line count - :rev — reverse text - :md2txt — strip Markdown formatting Transform suggestions appear as a visual menu when typing ":" with icons, commands, and descriptions. Selecting a transform applies it to the currently selected clipboard item and pastes. Smart Suggestions — contextual banners shown at popup open: - Pin suggestions: "You've copied X 8 times. Pin it?" with action - Rotating tips about paste transforms, multi-select, search features - Dismissable with X button, regenerates each popup open Rich Preview enhancements: - Category badge with icon (purple capsule) in preview sidebar - Color swatch for color entries (rendered as 20x20 block) - Content stats: character count, word count, line count - All shown above the existing metadata Co-Authored-By: Claude <noreply@anthropic.com>
Add a full MCP (Model Context Protocol) server that exposes Maccy's
clipboard history to AI agents over stdio JSON-RPC 2.0.
Tools exposed:
- clipboard_read — Read current system clipboard (pbpaste)
- clipboard_write — Write to system clipboard (pbcopy)
- clipboard_history — Get recent history with metadata
- clipboard_search — Search by title, app name, or category
- clipboard_pinned — Get all pinned items
- clipboard_stats — Usage statistics (totals, app breakdown,
category distribution, most-copied items)
- clipboard_transform — Apply 17 paste transforms server-side
(json, trim, upper, strip_utm, b64, etc.)
The server reads Maccy's SwiftData SQLite database directly
(~/Library/Application Support/Maccy/Storage.sqlite) in read-only
mode. Write operations use /usr/bin/pbcopy and /usr/bin/pbpaste
via execFileSync (no shell, no injection risk).
Handles SwiftData schema detection (Z-prefixed vs plain columns)
and NSDate epoch conversion (2001-01-01 reference).
Registered with:
- Claude Code (~/.claude.json mcpServers)
- Overlord-v2 (mcp-servers.json)
Co-Authored-By: Claude <noreply@anthropic.com>
In-app AI transforms (Swift): - Type `:ai <instruction>` in the Maccy search field - Works with any natural language instruction: ":ai summarize in 3 bullets" ":ai translate to Spanish" ":ai explain this code" ":ai rewrite as professional email" ":ai fix grammar" ":ai add TypeScript types" - Shows processing indicator while Claude responds - Result is copied to clipboard and pasted automatically - API key from ANTHROPIC_API_KEY env var or ~/.anthropic/api_key Regular transforms now triggered from Return key: - Typing `:json` and pressing Return applies the transform directly - No need to click the suggestion — keyboard-first workflow MCP server AI tools (Node.js): - clipboard_ai: AI transform with copy_result option for agents - clipboard_context: Structured context digest from clipboard history (grouped by app, category, with pinned items) - clipboard_watch: Monitor clipboard changes since timestamp Total MCP tools now: 10 (was 7) Co-Authored-By: Claude <noreply@anthropic.com>
- FORK.md: comprehensive overview of all custom features, build instructions, and differences from upstream - mcp-server/README.md: tool reference, setup guide for Claude Code and Overlord-v2, architecture diagram, usage examples - ContentCategory.swift: docstring explaining the auto-categorization system and where categories are consumed Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive enhancement of Maccy from a simple clipboard history tool into an AI-powered clipboard processing platform.
Bug Fixes & Performance
fatalErroron corrupt SQLitePaste Transforms (17 built-in)
Type
:in search to access::json,:trim,:upper,:lower,:title,:1line,:noutm(strip UTM tracking),:urlencode/:urldecode,:b64enc/:b64dec,:escape/:unescape,:sort,:uniq,:count,:rev,:md2txtAI Transforms (Claude API)
Type
:ai <instruction>for natural language clipboard transformation::ai summarize in 3 bullets:ai translate to Spanish:ai explain this code:ai rewrite as professional emailClipboard Intelligence
Insights Dashboard
New "Insights" tab in Preferences with Swift Charts:
Multi-Select & Paste Stack
Enabled the fully-built but disabled multi-selection feature. Cmd+Click to select multiple items, paste sequentially.
MCP Server (10 tools)
Node.js MCP server exposing clipboard to AI agents via JSON-RPC 2.0:
clipboard_read/write— system clipboard accessclipboard_history/search/pinned/stats— Maccy database queriesclipboard_transform— 19 text transformsclipboard_ai— Claude-powered transformationclipboard_context— structured work context from clipboard historyclipboard_watch— monitor recent clipboard changesRegistered with Claude Code (
~/.claude.json) and Overlord-v2 (mcp-servers.json).Test plan
:jsonwith JSON on clipboard — verify pretty-print and paste:ai summarize— verify Claude API call and result pasteecho '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | node mcp-server/dist/index.jsclipboard_readtool worksCommits (7)
fix: critical bugs and performance improvementsfeat: clipboard intelligence — auto-categorization, insights dashboard, filter chipsfeat: multi-select, item metadata, and app/category searchfeat: paste transforms, smart suggestions, and rich previewfeat: MCP server for AI agent clipboard accessfeat: AI-powered clipboard transforms via Claude APIdocs: add FORK.md, MCP server README, and code documentationRelated
🤖 Generated with Claude Code