3 comments

  • leoliu_builds 3 hours ago ago

    Having --only-tags and --exclude-tags right on the MCP server is a really sensible default for people who don't want an agent rummaging through an entire personal vault.

    Two quick architecture questions from the stack summary:

    1. Are password-locked notes automatically excluded from the SQLite FTS5 index and the MCP server even when no tag filter is passed? That seems like the biggest footgun people worry about once they connect a personal notes DB to an LLM.

    2. When theonotes mcp-server edits a section of a note that is currently open in the CodeMirror 6 WKWebView, how do you reconcile the write without resetting the cursor position or wiping the undo history?

    • jankutschera 3 hours ago ago

      Thanks, good questions.

      1) Locked notes: yes, regardless of tag filters. A password-locked note has no readable text anywhere in the library: the body is stored encrypted, so it is not in the FTS5 index in the clear, and the CLI and MCP tools only return metadata for it (locked: true, no content, derived title and stats blank). Asking for its content fails with a note_locked error. That holds without --only-tags/--exclude-tags; the tag scoping is an extra layer on top. One distinction: this is the per-note password lock. The app-level lock (App Lock) does not apply to the CLI/MCP server, and the app's Settings say so.

      2) Open notes: the MCP write goes into the same SQLite library and the running app gets a system notification. If the note is open, the editor receives it as an external change (applyExternalChange), not a reload. If the edit is away from the line you are typing on, the two merge. If it touches the line you are typing on, your typing wins and the agent's text is saved as a conflict copy instead of silently overwriting. External changes sit outside the editor's undo stack, and undoing your own edit keeps them. Writes can also carry a base hash, so an agent can't overwrite text it hasn't read (stale_hash).

      Caveat: that behaviour is pinned by tests against the real app environment with a fake editor page, not in a live WKWebView. I haven't verified cursor position pixel by pixel there, so tell me if you see it jump.

  • jankutschera 5 hours ago ago

    Hi HN, I'm Jan. Theo Notes is a free, GPL-3.0 notes app for Mac, iPhone, iPad and Apple Watch. Every note is stored as the Markdown you typed, there are nested tags, wiki links, full-text search (including text in images and scanned PDFs), password-locked notes and sync through your own iCloud account.

    Why I built it: I wanted plain-text notes that I own on every Apple device, and I wanted Claude to be able to search and edit them without copy-pasting. And I wanted it as easy to handle as possible for me, while AI can use it too. So the Mac app ships a command line tool, `theonotes`, and `theonotes mcp-server` exposes the same as an MCP server (search, read, append, edit by section, tags, attachments; optional `--only-tags` / `--exclude-tags` scoping).

    Stack: Swift 6 with strict concurrency, SwiftUI and AppKit, GRDB with SQLite FTS5 for storage and search, a CodeMirror 6 editor in a WKWebView, CloudKit for sync. The repo is about 250k lines of Swift and 19k of TypeScript.

    How it was made: I started on 2026-10-22 and wrote most of it with AI coding agents (Claude Code, Codex, Kimi and Grok), with me reviewing, testing on devices and deciding. I'm saying this up front because it's the honest answer to "how did one person do this in five weeks".

    Limits, so you don't have to find them: Apple-only and it needs macOS 26 / iOS 26. Sync is iCloud only (no self-hosted server yet). The CLI and MCP server are Mac-only, they need a library the app created, and there's no Homebrew formula yet. It imports from Apple Notes, Evernote, Notion, Bear, Markdown and ZIP, but it is a young app: back up first.

    It's GPL so you can read every line; the name and icon are trademarked so forks need their own. I'd love feedback on the editor, the MCP tool design, and what breaks for you.