Skip to content

tomohiro-owada/TxtSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TxtSync Icon

TxtSync

macOS menubar app that makes your screen readable by AI

Swift Platform License

Extracting text from windows via OCR, accessible through MCP (Model Context Protocol)


Overview

TxtSync is a lightweight menubar application that monitors selected windows and provides their text content to AI assistants like Claude Code via the Model Context Protocol (MCP).

Key Features:

  • On-demand OCR - Only processes when AI requests, saving CPU & battery
  • Multi-window support - Monitor multiple windows simultaneously
  • Japanese & English - Full support for both languages
  • Native macOS - Built with SwiftUI and Vision framework

How It Works

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   Your Screen   │────▶│    TxtSync      │────▶│   Claude Code   │
│  (Slack, etc.)  │     │  (Vision OCR)   │     │   (via MCP)     │
└─────────────────┘     └─────────────────┘     └─────────────────┘
  1. Select windows to monitor from the menubar
  2. AI requests window content through MCP
  3. TxtSync captures and OCRs the window (~1.5s)
  4. Text is returned to AI for analysis

Installation

Build from Source

# Clone
git clone https://github.com/tomohiro-owada/TxtSync.git
cd TxtSync

# Build
./scripts/build.sh

# Create app bundle
./scripts/bundle.sh

# Install
cp -r TxtSync.app /Applications/

First Launch

  1. Open TxtSync from Applications
  2. Grant Screen Recording permission when prompted
  3. Select windows to monitor from the menubar

Note: If window titles don't appear, reset permissions:

tccutil reset ScreenCapture com.txtsync.app

Then relaunch TxtSync and grant permission again.

Claude Code Integration

Add to your MCP configuration (~/.claude.json):

{
  "mcpServers": {
    "txtsync": {
      "command": "/Applications/TxtSync.app/Contents/MacOS/TxtSyncMCP"
    }
  }
}

Available Tools

Tool Description
list_windows List monitored windows with IDs and titles
get_window_text Get OCR text from a specific window
get_all_text Get OCR text from all monitored windows
search_text Search for text across all windows
get_window_screenshot Save window screenshot to temp file (JPEG compressed for large images)

Example Usage

You: What's in my Slack?

Claude: [calls get_window_text with app_name="Slack"]
        Your Slack shows a thread in #general with messages about...

You: Search for "error" in my terminal

Claude: [calls search_text with query="error"]
        Found "error" in Ghostty window: "npm ERR! code ENOENT..."

Architecture

TxtSync/
├── Sources/
│   ├── TxtSync/           # Menubar app (SwiftUI)
│   │   ├── App/           # Entry point, state management
│   │   ├── Views/         # UI components
│   │   ├── Models/        # Data structures
│   │   ├── Services/      # Window management, permissions
│   │   └── Theme/         # Styling
│   └── TxtSyncMCP/        # MCP server (JSON-RPC over stdio)
├── Resources/
│   └── Info.plist
└── scripts/
    ├── build.sh
    └── bundle.sh

Requirements

  • macOS 13.0 (Ventura) or later
  • Screen Recording permission
  • ~50MB disk space

Performance

Metric Value
Idle CPU < 1%
OCR latency ~1.5 seconds
Memory ~70MB

Privacy

  • Local only - All processing happens on your Mac
  • No network - No data sent anywhere
  • You control - Only monitors windows you explicitly select

License

MIT License - see LICENSE for details.


Built with Vision Framework and MCP

Report Bug · Request Feature

About

macOS menubar app that makes your screen readable by AI via MCP

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors