PyApple MCP Toolsのロゴ

PyApple MCP Tools

コミュニティ
54yyyu

MCP server and CLI for seven macOS apps — Messages, Mail, Notes, Calendar, Reminders, Contacts and Maps. Native frameworks, honest truncation.

公開者54yyyu
リポジトリpyapple-mcp
言語Python
フォーク
6
スター
17
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    PyApple MCP Toolsは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには17件のスターと6件のフォークがあります。

PyApple MCP Tools

PyPI Downloads License MCP

A Python implementation of Apple-native tools for the Model Context Protocol (MCP), providing seamless integration with macOS applications.

There are two front ends over the same integrations: an MCP server for Claude Desktop and other MCP clients, and pyapple, a command line for driving the same ten tools from a shell. They share one permission policy, so what you allow in one you have allowed in both.

88 operations across ten tools. They are listed in full under The tools, and what they refuse to do is under Limits worth knowing — read that before you rely on any of them.

If you are an agent about to drive the CLI rather than a person reading about it, .claude/skills/pyapple/SKILL.md in this repository is the operator guide: which call to make first, how to read the exit status, and which refusals to route around versus report.

Features

  • Messages: find conversations, read a thread whole, search message text, list what a thread was sent, and send — text or a file. Reads go through chat.db directly and are scoped by chat, so a group thread comes back as the group rather than as one participant's share
  • Notes: search, list, read, create, append, rename and rewrite — with a gate that refuses any note whose content a round trip would destroy — plus filing a note into another folder, and folders themselves: list them, create one, rename one, delete one. create refuses a folder name that does not exist rather than making a folder out of a typo, and the listing is how you find out what does; folder-delete refuses a folder holding notes unless you pass their exact count, because what it deletes does not go to Recently Deleted
  • Contacts: search by name, go the other way from a number or address to a person, and add, correct or delete a card. Reads and writes both go through the Contacts framework; nothing launches Contacts.app
  • Mail: unread, header search, body search, read one message whole by id, a whole thread in order, what is attached and whether the bytes are here, coverage — what each account can actually answer about — send, reply, forward, the drafted form of each of those three, mark read, file, delete, and list mailboxes and accounts. Reads come from the local Envelope Index rather than through the app
  • Reminders: list, search, create, update, complete, uncomplete and delete, plus creating and deleting the lists themselves, through EventKit
  • Calendar: list and search occurrences of recurring events, list calendars, coverage — what range of events each calendar actually holds — find free gaps rather than events, create with repeats, alarms and invitees, reschedule, move and delete
  • Maps: location search and directions through MapKit — no window, no Automation grant, and Maps never launches. Favourites and Guides are not available at all and say so
  • Shortcuts: list the user's own automations, list the library's folders, describe one, open it in the editor, run it. Through /usr/bin/shortcuts — a subprocess and not an Apple Event, so it costs no Automation grant and launches nothing
  • Presence: whether now is a moment to interrupt — Focus mode, the frontmost app, idle seconds, whether the screen is locked. Read-only, and structurally so: there is no setter and there must not be one
  • Doctor: why a tool just failed. Which macOS grants this process holds, per tool, and where to click for the missing ones. Nothing it does can launch an app or raise a permission prompt
  • Command line: the same ten tools from a shell, with --json output that says how much of the answer came back, and an exit status you can branch on — see Command Line
  • Permissions: one policy string, honoured identically by the server and the CLI, and an optional two-phase gate that makes any send show what it would send first — see Permission Policy

Quick Installation

Automated Setup (Recommended)

bash
# Install pyapple-mcp
pip install pyapple-mcp

# Run the setup helper to configure Claude Desktop
pyapple-mcp-setup

The setup helper will:

  • Find your pyapple-mcp installation
  • Locate your Claude Desktop config file
  • Automatically add the configuration
  • Display helpful setup information

Manual Installation

  1. Install pyapple-mcp:

    bash
    pip install pyapple-mcp
  2. Configure Claude Desktop by editing ~/Library/Application Support/Claude/claude_desktop_config.json:

    json
    {
      "mcpServers": {
        "pyapple": {
          "command": "pyapple-mcp"
        }
      }
    }
  3. Restart Claude Desktop to load the new configuration.

What gets installed

Three commands land on your PATH:

CommandWhat it is
pyapplethe command line — the ten tools from a shell
pyapple-mcpthe MCP server, which is what an MCP client launches
pyapple-mcp-setupthe helper that writes the Claude Desktop config

Nothing else is needed to use the CLI; pip install pyapple-mcp is the whole installation.

bash
pyapple --version
pyapple --help

Usage Examples

Through the MCP server you ask in plain language; through the CLI you type the operation. The first two headings below are the former, the third is the latter.

Basic Commands

Can you send a message to my sister saying "Hello from Claude!"?
Find all notes about "AI research" and summarize them
Create a reminder to "Buy groceries" for tomorrow at 5pm
When am I free for an hour on Thursday?
Get directions from "Apple Park" to "San Francisco Airport"

Advanced Workflows

You can chain commands together for complex workflows:

"Find the email with the booking reference in it, and put the reference in my trip note"

From a shell

The same operations are available without an MCP client at all:

bash
pyapple messages conversations --query "book club"
pyapple mail unread --limit 5 --since 2026-08-01
pyapple calendar free --from-date 2026-08-06 --to-date 2026-08-08 --duration 60
pyapple presence snapshot
pyapple doctor report

See Command Line below.

Limits worth knowing

Every one of these was measured against the real applications, and each is something you need to know before relying on a tool rather than after. They are not bugs waiting to be fixed; where a thing cannot be done, the operation still exists and refuses out loud, because an assistant that has no operation for what it was asked will reach for the nearest one that does exist.

Almost nothing launches an app any more — but Mail, Messages and Notes still do

Reminders, calendar and contacts writes moved from Apple Events to EventKit and CNSaveRequest; maps search and directions moved to MapKit. Those four tools now need only the privacy grant their reads already held, and the separate "control Automation" grant they used to demand is gone. Verified with Calendar, Reminders and Maps all quit: listing calendars, listing reminder lists, finding free time, searching for a place and routing between two of them launched none of the three.

What still dispatches Apple Events, and therefore still launches its app and still needs Automation:

ToolWhat needs Automation
noteseverything, reads included — move and delete too
mailsend, reply, draft, replyDraft, forward, forwardDraft, move, delete, open, markRead, mailboxes, and unread --mark-read. reply, replyDraft, forward, forwardDraft and anything with --html need an Accessibility grant on top
messagessend, sendAttachment, open
calendaropen, and create --invitees
remindersopen
contacts, maps, shortcuts, presence, doctornothing

mail thread and mail attachments are on the index-and-filesystem side with the other reads: no Apple Event, Mail is not launched, and nothing is marked read. reminders listCreate and listDelete are EventKit like the rest of that tool.

shortcuts is a fourth route into macOS and the cheapest one here. It goes through /usr/bin/shortcuts, a plain subprocess. Measured against the binary Apple ships: codesign -d --entitlements - shows no com.apple.security.automation.apple-events, and otool -L finds no AppleEvents and no Carbon — it reaches its daemon over mach-lookup. shortcuts list and shortcuts run <a name that does not exist> were both run with Shortcuts.app not running; neither prompted and neither started it. shortcuts open is the exception and puts the editor on screen, which is what calendar open and reminders open cost.

Two honest qualifications, because that is easy to over-read. We pay no permission; the shortcut does — one whose actions touch Contacts or Photos raises those prompts against Shortcuts, and this package cannot enumerate what a shortcut will reach, so it cannot warn you either. And a shortcut containing an interactive action will put UI on screen and block until somebody answers, which is why run has a timeout at all.

Notes is the exception that cannot be fixed. Notes ships no framework API at all, so AppleScript is the only route in and Notes.app launches for every operation including a search and including folders. That is a platform limit, not an omission.

mail accounts came off that list. It used to ask Mail whether each account was enabled; it now reads the same index coverage reads and reports what this Mac actually holds per account, which is the consequence a caller cares about where "disabled" was only a cause of it. It falls back to asking Mail only if the index names no accounts at all, which on a machine with mail means the read failed rather than that there are none. mail coverage and mail readMessage never touch Mail either — index and filesystem only.

maps pin is the odd one out: it opens a Maps window, but through open(1) and a maps:// URL rather than an Apple Event, so it needs no Automation grant. It opens behind what you are working in unless you pass --show. The window cannot be closed again from here — measured, close window 1 blocks until the Apple Event times out and leaves the window where it was — so a pin is a one-way door.

Notes editing refuses more than it accepts

Notes' HTML serialiser and its HTML parser do not agree, so the body Notes hands you is not a body it will take back. Every edit here is a whole-body rewrite, because Notes offers nothing else, so a read-modify-write is destructive. Measured, writing a body back unchanged:

ContentWhat the round trip does to it
imagesdestroyed outright — 2 <img> before, 0 after, three clean trials
attachmentsdestroyed, even under a pure identity write
links<a href="…">text</a> comes back as <u>text</u>: the text survives, the URL does not
headingsfive input forms of <h1> all stored as a bold span
checkliststen candidate markups all stored as plain <ul><li>, every tick cleared

So append, rename, replace and setBody refuse any note carrying that content, name what it holds, and change nothing. There is deliberately no override flag: a flag saying "yes, lose the images" would be set by a model that has never seen the note, on behalf of someone who has, and the loss is invisible afterwards — the attachment does not go to the Trash, it is gone.

On the development machine 0 of 56 existing notes pass that gate — 40 carry an attachment, 36 an image, 19 a heading, 13 a link, and 6 are password protected. That is the honest number, and it is why the refusal is worth documenting rather than discovering. Notes this tool creates always pass, so create then append works as you would expect.

create and delete are unaffected by that gate: neither reads a body back.

create has a refusal of its own, though. It used to make any folder it was handed, silently, so a misspelled folder name did not fail — it started a second folder and filed the note there, reporting success. It now refuses a folder that does not exist and names the ones that do. notes folders is the listing that lets you check first, and notes folder-create is how you make one on purpose; the tool's own default folder is the one exemption, since a caller that named no folder cannot be told the folder it did not ask for is missing.

The refusal is the right way round because of what it costs to be wrong either way. Refusing when a new folder was genuinely wanted costs one further call to folder-create, immediately, with the error naming what the folder could have been. Creating on a typo costs a folder in your sidebar, and two more calls — notes move to file the note where it belonged and folder-delete to remove what the typo made.

notes folder-delete destroys what is in it

Every other delete in this package is recoverable from a Trash or a Recently Deleted. This one is not, and that is measured rather than assumed: a disposable folder holding two notes was deleted, the trash's own note count was 3 before and 3 after, and a search of every note — which does reach the trash, since the same query found a trashed note by name in the same run — matched 0 of the two deleted bodies. The notes are gone, not filed away.

So the refusals are the feature, and there are four of them:

  • A folder holding notes is refused unless you pass --delete-notes N with the folder's exact count. N is re-checked against the live store, so a count that has moved since you read it refuses rather than proceeds. You cannot pass the flag without having counted first, and that interlock is the only thing between a mistyped folder name and an unrecoverable loss.

  • A folder with subfolders is refused outright, with no override at all. Deleting a container leaves the app in a state where id of that container raises, and there is no argument that gets past this.

  • The trash and any account's default folder are refused for what they are. There is one of each per account and nothing here needs to remove them.

  • The result carries may_return: True rather than a bare success, because a synced account may put the folder back. Measured on both account types on one machine: an Exchange folder was listed again inside 15 seconds and was still there five minutes later, and iCloud resurrection has been reproduced five times — but neither reproduces every time, which is why the caveat is unconditional rather than naming an account. The script re-queries after deleting and reports what it saw, so what you get is what the store said, not what the command intended.

    The message says only what happened. Delete an empty folder and it warns that a synced account may restore it and stops there; the sentence about notes not being in Recently Deleted appears only when notes were actually destroyed, and notes_recoverable is null rather than false when there were none to recover.

bash
pyapple notes folders                          # read the count first
pyapple notes folder-delete "Scratch" --delete-notes 2

Four of seven maps operations are permanently impossible

Maps.app ships no scripting dictionary — there is no .sdef anywhere in it — and Favourites and Guides have no public API and no readable on-disk copy; the data is CloudKit-backed and opaque. So save, listGuides, createGuide and addToGuide cannot be implemented at all.

They report failure and hand back a durable maps.apple.com link instead, which is the part you can actually keep: stored in a note or a reminder it survives and opens in Maps on every Apple device.

bash
$ pyapple maps list-guides; echo $?
failed: Apple Maps guides cannot be listed. macOS exposes no API for them and keeps no readable copy on disk — the data lives in iCloud in a private format. This is not an empty list of guides; it is no answer at all. Open Maps and look under Library to see them.
1

listGuides in particular must never answer with an empty list: a store that cannot be read has to be distinguishable from a store with nothing in it.

There is also no current location. A non-bundled process cannot hold the Location Services grant, so "directions from here" has no answer and directions always needs an explicit --from.

A shortcut's actions cannot be read, which is why run is a send

/usr/bin/shortcuts has four subcommands — run, list, view, sign — and Apple's own help for the third reads "View a shortcut in Shortcuts." It opens the editor. There is no subcommand that describes what a shortcut does, so shortcuts describe reports actions: null and actions_known: false and says why, rather than returning an empty list. A shortcut that could not be described must not read as a shortcut that does nothing.

(~/Library/Shortcuts/Shortcuts.sqlite carries a ZACTIONSDESCRIPTION column, which is the obvious way round it. It was populated for 2 of 7 shortcuts on the library this was written against, so it is a cache and not a source: reading it would answer "what does this do" for some shortcuts and silently for none of the others. It is not read.)

That is also the whole argument for run being classified send rather than write. An effect nobody can read has to be assumed to be the worst one it could have, and a shortcut can trivially send mail. The decisive part is what the alternative would do to a promise this package already makes: PYAPPLE_READ_ONLY=1 is documented as *=read and it is the flagship safety setting, and if run were anything below send that setting would permit arbitrary user code that can text a stranger. Classified too high it costs somebody an extra grant; classified too low it sends the email.

One more trap, closed rather than documented: shortcuts list --folder-name ignores a folder it does not recognise and returns the entire library at exit 0. Measured — -f "Starter Shortcuts" gave 3, -f none gave 4, and -f "@@@nope@@@" gave all 7, with nothing on stderr. So pyapple shortcuts list --folder validates the name against the folder listing first and refuses with the real names, at exit 2. A mistyped filter that came back with everything you own would be a wrong answer wearing a success.

Focus costs Full Disk Access, and its format is undocumented

Four of the five presence operations cost the user nothing at all — that is measured rather than assumed, from an unsigned .app launched through LaunchServices so that its responsible process was itself and it held no TCC grant of any kind. That control was denied chat.db with EPERM, which is what makes the rest of the row mean something: from it, NSWorkspace.frontmostApplication(), CGEventSourceSecondsSinceLastEventType and CGSessionCopyCurrentDictionary all answered.

presence focus is the exception. Focus state lives in ~/Library/DoNotDisturb/DB, which is behind Full Disk Access, and Apple documents neither the directory nor the JSON in it. So every presence value carries a provenance field, and Focus's says reverse-engineered while the other three say documented. The result also reports the schema version it found and whether that version is one this package has seen, so a macOS update that changes the format shows up as an unrecognised schema rather than as a confident wrong answer.

INFocusStatusCenter, the one public documented Focus API, was tried and rejected: it returns only isFocused as an optional Bool and never names the mode, and it is gated on an NSFocusStatusUsageDescription in an Info.plist, which a pip-installed console script does not have. It would cost a new dependency and an app bundle to learn strictly less.

presence snapshot is the one to poll and the only one that survives a partial failure: every field carries its own available, so a field that could not be read stays distinct from a field that is genuinely off, and the envelope carries unavailable and complete. Without Full Disk Access a snapshot still answers about the app, the idle clock and the screen.

There is no write half of this tool and there must not be one. Setting Focus or moving a window needs an Accessibility grant — the broadest permission macOS hands out, unscopeable, with effects nothing can verify afterwards because a synthetic keystroke leaves no record distinguishable from a real one. Sensing costs one grant a person can reason about; acting costs the machine. For the same reason there is no clipboard read here: it is not an attention signal, and it is the highest-value thing on the machine to exfiltrate.

mail delete refuses the accounts where it would not be recoverable

Mail's delete verb is what the Delete key is: on an ordinary account it files the message in that account's Trash, which is a write — private, and undoable.

But that is a per-account setting, not a fact about Mail. Mail.sdef declares move deleted messages to trash on the account class, and with it off a delete erases. Nothing in the verb's name says so and the caller cannot see the setting, so the script reads it off the message's own account before touching anything and refuses when it is off, pointing at move instead. The same refusal covers a message whose account could not be determined at all: an unverifiable claim of recoverability is not a weaker claim, it is a false one.

On the path that does go ahead, "recoverable" is qualified rather than promised. Two further account settings — empty trash on quit and empty trash frequency (0 means on quit, -1 means never, anything else is days) — decide how long the Trash keeps it, and both are read and both are reported. "It is in the Trash" is a promise with an expiry.

mail move is the reversible neighbour and it refuses three things rather than guessing: a destination that names no mailbox (with the real ones listed — it will not create a mailbox out of a typo, which would sync a new folder to somebody's phone), a name that matches more than one (Sent on a machine with three accounts is three mailboxes), and a destination it could not check, since listing mailboxes is itself an Apple Event and an empty answer there means "Mail did not answer" rather than "there are none".

Whether an attachment is on this Mac is a stat, and the answer is tri-state

Both attachment operations report presence by looking for the file, not by believing the database, and neither will report "not there" when it means "cannot say".

messages attachments carries available_locally, and it has three values. Measured across 5,426 rows on a real store: 35 of the 5,404 that name a path have no file at that path, and two of those 35 carry the same transfer_state as the 5,365 that do — so the column cannot be trusted and presence is a stat. None means no path was recorded at all, which is unknowable rather than false.

mail attachments reports names and sizes, and sizes are not in the index: the attachments table has four columns and none of them is a size, so a size can only come from the file. On the store measured, 2,755 of 8,101 indexed attachments — 34.0% — have their bytes on this Mac, the same split coverage reports for bodies. A size that is not known is null, never 0. A zero-byte attachment and one whose bytes were never downloaded are different facts, on_disk says which you have, and the note says how many of each.

Every mail send leaves a copy in the sender's Drafts

Mail autosaves any outgoing message it can attribute to an account. Measured directly, by building a message that was never saved and never sent: it appeared in Drafts within 8 seconds and stayed.

This is known and not fixed. The copy appears asynchronously, so an in-script cleanup runs too early, and a later one would mean this package deleting from your Drafts by subject match. It is documented rather than papered over because the failure it causes is a person seeing the draft, concluding the mail never went, and sending it again.

mail searchBodies is partial by construction, and the split is per account

Bodies are not in the Envelope Index, so a body search has to open .emlx files on disk — and those exist for only part of the store. On the development machine that is 14,532 files against 45,654 indexed rows, about 32%.

That single number was the misleading way to say it, which is why coverage exists. The three accounts on that machine are nothing like each other: one holds 31,143 indexed messages and zero bodies, and the other two are at 100% of 14,245 and of 279. So "32%" is the mean of a zero and two hundreds, and a body search that finds nothing across the first account is not a failed search — there was nothing there to search inside. Run mail coverage before you conclude anything from an empty body search.

It is its own operation rather than a flag on search for exactly that reason: a flag would hide the partiality behind a list that cannot say what it missed. The result carries candidates (rows in scope), scanned (rows the budget reached), with_body, without_body and scan_truncated, so a caller can see what was not read rather than inferring it from a short list.

bash
pyapple mail search-bodies "booking reference" --since 2026-07-01 --scan-limit 500

--scan-limit is how many bodies to open, 500 by default. Decoding the 500 newest bodies is 2.25s and 2,000 is 5.98s, so it is a real budget and the default is the one that answers in about two seconds. Raising it reads more of the store; no setting makes a body appear that was never downloaded.

Always give it a --since or an --account. Unfiltered, the candidate set on that machine is 31,192 and the newest of them come from the account with no bodies at all, so the scan spends its whole budget on messages that cannot match. A truncated scan says so — scan INCOMPLETE in the text, scan_truncated in --json — and a truncated zero is not the same fact as a complete one.

coverage is the answer to "why did that find nothing"

Two operations exist only to be called before a read, because an empty result and a nonexistent thing look identical otherwise.

mail coverage reports, per account: how many messages are indexed, how many have a body on this Mac, that as a percentage, and the dates the index spans. It reads the index and walks the account directories — no Apple Event, so Mail is not launched, unlike mail mailboxes. --mailboxes asks the same question one level down, per mailbox: a mailbox listed with 0 indexed is empty, and a mailbox absent from the listing is one this Mac has never synced. Both report zero unread and they are not the same fact. Bodies are deliberately not reported per mailbox and cannot be — an .emlx is filed under its account, not its mailbox — so body coverage stays an account-level figure.

bash
pyapple mail coverage
pyapple mail coverage --mailboxes

calendar coverage is the same idea one app along. calendars lists names and says which are writable; nothing said what is in them, so there was no way to learn the bounds of the store without guessing a window and inferring from what came back. It reports per calendar — empty ones included — how many occurrences fall in a window it states in the result, how many distinct repeating series those occurrences are (a weekly item is 52 occurrences of one thing), and the earliest and latest it saw.

Two properties are worth knowing before you read the numbers. earliest and latest are exact inside the scanned window and nothing of the sort outside it, which is why the window is a field. And each calendar carries before_window / after_window, counted from one extra segment scanned either side: a non-zero one is a fact — there is more, and you are looking at the edge of the question rather than the edge of the data. A zero is weaker and means only that the adjacent segment holds nothing.

The default window is 20 years back and 5 years forward. On a store of 15 calendars that is 7 segments, 4,788 occurrences and 0.378s; a whole century is 33 segments and 1.08s, so widening it is affordable. seconds in the result is the real elapsed time of the call that produced it.

bash
pyapple calendar coverage
pyapple calendar coverage --from-date 2026-01-01 --to-date 2026-12-31

mail --mailbox INBOX used to answer about the wrong mail

Gmail stores each message once in [Gmail]/All Mail and records membership in a labels table, so the Gmail INBOX mailboxes hold zero rows. unread --mailbox INBOX reported 2 unread to a user with 6, and search --mailbox Sent found the Exchange sends and none of the 1,293 Gmail ones. The predicate follows labels now, and every result says which label matched.

--account is fixed in the same place: it was accepted, documented, and then dropped, so --account returned every account's mail. Scoping needs a name-to-uuid resolution that was never done. An account name nothing matches now raises rather than silently widening to everything.

This is worth knowing because it changes what a result means, not just how many there are.

About one contact card in nine cannot be written at all

20 of 179 cards on the development machine — 11.2% — refuse every write through the Contacts framework with Cocoa error 134092, and the refusal is stable per card rather than intermittent: 5 attempts of 5 fail on an affected card, 0 of 5 on each control.

Ruled out by driving each one: the fetch key set, staleness, the container or account, unification and linked cards, images, and the kind of change. Nothing CNContact exposes tells the two groups apart, so it cannot be pre-flighted and retrying is pointless.

The one good property, verified on every failure measured: it is total, never partial — the card is byte-identical afterwards. add, addTo, rename and delete refuse with the cause named and tell you to edit that card in the Contacts app, which still can.

messages schedule cannot work, and says so

Messages.sdef declares exactly three commands — send, login, logout — and none of them takes a date. The words "schedule", "later" and "delay" appear nowhere in the dictionary. The schedule_state column in chat.db looks like a way in until you notice that every row carrying it also carries a send error.

So schedule refuses. It is kept on the surface rather than removed because a model asked to send something at 7am, finding no such operation, is likely to reach for send — and sending immediately instead of at the requested time is the failure that would actually hurt.

Ambiguity is refused, not resolved

contacts, notes and reminders all match by text. When more than one thing matches, the operation refuses and names the candidates rather than picking one. Completing, deleting or renaming the wrong item makes it vanish with nothing to explain why, and the caller is the only one who can tell which was meant.

reminders gives every result an id for this reason — pass --id and the question does not arise. calendar's writes sidestep it entirely by requiring --event-id, which list and search print.

calendar free returns gaps, and ignores all-day entries

A list of events is not the answer to "am I free on Thursday": the caller would have to know the window, subtract every event, know which of them actually occupy the person, and know the working day. Three of those four are things the tool knows and the caller does not.

All-day entries do not count as busy unless you pass --include-all-day, and neither do events marked free or cancelled. Without that rule the development machine reports zero free time on 211 of the next 365 days, every one of them a holiday or a birthday.

bash
pyapple calendar free --from-date 2026-08-06 --to-date 2026-08-08 --duration 60

calendar create --invitees genuinely mails people

Attaching invitees turns an event into a meeting and sends an invitation to each address, from your account, immediately. It is the one calendar write still on Apple Events, because EKParticipant has no public setter — so it is also the one that needs an Automation grant. The CLI flag says so in its own help text.

Two control characters cannot be stored, and you are told when they are dropped

U+001E and U+001F are reserved. Every refusal and hint this package writes marks its parameter names with them, so that one sentence in a handler can print as --delete-notes in a shell and delete_notes to a model — which means text that arrives carrying them would be spelled the same way. Measured: a reminder named shop ␞account␟ now was stored verbatim by EventKit and came back out of the CLI as Created reminder 'shop --account now' — a flag this tool never offered, written by whoever typed the reminder.

So they are removed from every argument on every operation, before anything is stored or matched — note titles and bodies, folder names, calendar titles, locations and notes, invitee addresses, reminder names and notes, contact fields, mail subjects, bodies and recipients, message text, and search terms. The write still happens; nothing is refused over two non-printing bytes. What changed is that it is no longer silent:

bash
$ pyapple reminders create --name "shop ␞account␟ now"
note: Removed 2 reserved control characters (U+001E, U+001F) before storing: 2 from --name. What was stored differs from what was supplied — …
Created reminder 'shop account now'

Under --json the same fact is a removed_control_characters object mapping each parameter to a count, present only when something was removed. Over MCP the sentence is appended to the tool's answer, since that surface renders text and nothing else.

Nothing else in your text is altered. Quotes, backslashes, emoji and bidirectional overrides are stored exactly as sent; a terminal whose encoding cannot render a character will print \uXXXX for it, but that is the display, not the store.

Command Line

pyapple drives this Mac's Messages, Mail, Contacts, Reminders, Calendar, Notes, Maps and Shortcuts from a shell, and answers two questions about the machine itself — presence and doctor. It is the same integration code the MCP server calls — not a reimplementation — so the two cannot drift.

bash
pyapple --help
pyapple mail --help
pyapple mail draft --help

Every tool and every operation has its own --help, and the tool-level help is where the useful caveats live.

Start with messages conversations rather than a chat id you do not have: it finds a thread by a person's name, a group's name, or by naming two people who share one, and prints the id messages read wants.

bash
pyapple messages conversations --query "book club"
2 conversations:
[67] Book Club (group: Ada Byron, Grace Hopper, Alan Turing) - 412 messages, last 2026-08-04 19:22, 3 unread
[104] Ada Byron (1:1) - 88 messages, last 2026-07-30 08:11
bash
pyapple messages read --chat-id 67 --limit 20
pyapple contacts lookup --phone "+15550000000"
pyapple reminders list --list-name School
pyapple maps directions --from "Apple Park" --to "San Francisco Airport"

The tools

88 operations. The class column is what the permission policy gates on, and it is worth reading alongside the operation: mail open is a write because it marks the message read, while reminders open is a read because showing a reminder changes no reminder.

Fifteen operations are spelled with a hyphen on the command line and in camelCase in the policy string and the MCP schema. Both spellings work as CLI subcommands — with one exception, messages send-attachment, which does not answer to sendAttachment. The camelCase form is canonical, and it is the one pyapple perms prints. One more differs outright: pyapple mail read is the operation the schema and the policy call readMessage, because read was the name a person reaches for and mail read cannot be confused with anything else on the command line.

contacts — 6

OperationClassWhat it does
searchreadfind people by name, or list everyone with a number
lookupreadnumber or address to person — the direction you need when something arrives from a number
addwriteadd a contact
addTo / add-towriteadd a number or address to an existing card, rather than making a second card for the same person
renamewritecorrect or complete a contact's name
deletewritedelete a contact

notes — 14

OperationClassWhat it does
searchreadsearch notes
listreadlist notes
viewreadprint one note in full
foldersreadlist note folders, with their nesting and each one's own note count
createwritecreate a note in a folder that already exists
appendwriteadd a line to an existing note
renamewriterename a note
replacewritereplace text inside a note
setBody / set-bodywritereplace a note's whole body
movewritefile a note in another folder
folderCreate / folder-createwritecreate a folder, optionally nested inside another
folderRename / folder-renamewriterename a folder, leaving everything in it alone
folderDelete / folder-deletewritedelete a folder — see the interlock before using it
deletewritedelete a note

move is the one note write that is not behind the round-trip gate, and that is correct rather than an oversight. AppleScript can move a note object without reading or rewriting its body, so the script contains no body of at all and there is nothing for the gate to protect — the images, links and checklists it exists to save are never touched. Applying it anyway would refuse exactly the notes most worth filing, and it is why move is also the only write here that works on a password-protected note. An unknown destination folder is refused with the real ones named.

append, rename, replace and setBody refuse notes they cannot edit safely — see Notes editing refuses more than it accepts, which also covers why create refuses an unknown folder.

A folder's notes count is its own and excludes its subfolders'. That is Notes' own accounting rather than a choice made here — measured, count of notes on a parent whose child separately held one note returns one — and it is the more useful of the two, because a folder's own count is what changes when you file something into it. --include-deleted adds Notes' trash, which is off by default since a listing is what you pick a target from.

A folder rename is durable, which is worth stating because the note case is not: Notes re-derives a note's name from the first line of its body, so a renamed note reverts the moment anything writes to it. A folder has no body to derive from, and driving it confirmed the difference — the folder's id was unchanged, and a fresh osascript process looking it up by that id read back the new name, still did so after a note was created inside it.

messages — 9

OperationClassWhat it does
conversationsreadfind conversations by name, group or participant
readreadread one conversation, whole
searchreadsearch the text of messages
attachmentsreadwhat a thread was sent, and whether the bytes are here
unreadreadunread incoming messages across every conversation
openwriteshow a conversation in Messages, which also clears its badge
sendsendsend a message
sendAttachment (CLI: send-attachment)sendsend a file into a thread that already exists
schedulesendrefuses — Messages has no such verb

send --chat-id is the only way to reach a group: sending to one participant's number starts a separate one-to-one, and nothing in the result would say the group never saw it.

send-attachment is the most dangerous operation in the package — it takes a path from a caller that may have been reading untrusted text a moment ago and puts those bytes into somebody else's hands. Three things stand in the way and each refuses rather than adjusts. The file must resolve into your home directory, a temporary directory or a mounted volume, must not be hidden or under ~/Library (bar the attachments you were sent), and must be an existing, readable, non-empty regular file — judged after symlinks are followed. The recipient must be a conversation that already exists here: unlike send there is no buddy fallback, because buddy resolves an address that was never in a conversation, and that is exactly the route by which a handle lifted out of an injected email becomes a recipient. And a timeout raises rather than reporting failure, since a script killed mid-send may already have dispatched the file.

There is deliberately no caption. A file and a caption are two Apple Events and the second can fail after the first has arrived, which leaves the caller unable to say what the other person is looking at. Send the file, then call send for the words: two calls, two answers, and it is obvious which failed. The result reports the resolved absolute path that was actually sent, not the name it was asked for.

read used to be "the most recent N, with no way to tell". It reports total and truncated now, and --since / --until are a half-open window — since <= date < until — so "what did we say in March" is one call rather than a walk. Paging backwards is the same mechanism: the result carries next_until, and you pass it back as --until. It is deliberately not an offset, because an offset is counted from the end of a live conversation: one message arriving mid-walk shifts every later page and the caller both repeats and skips with no way to notice. The trade is one duplicate at each boundary rather than a silent gap — driven against the real store, two pages of 20 on each of the three busiest threads overlapped by exactly the one boundary message. It is not a way to fetch a whole conversation; the busiest thread measured holds 11,608 messages.

search matches the text of messages and is the operation that did not exist: finding a thread previously meant already knowing who was in it, since conversations matches chat names and participants and never text. Both storage columns are searched, and the second is the important one — text is populated on 21,415 of 84,402 rows and the other 62,749 live entirely in attributedBody, a binary typedstream. Searching text alone found 171 messages for one term where searching both found 402, so 43% recall with nothing to say the rest existed. A blob match is only a candidate — a substring can land in the typedstream's own class names — so every candidate is decoded and confirmed against the text a reader would see. Measured at 0.07s over 84,402 rows.

mail — 19

OperationClassWhat it does
unreadreadunread mail
searchreadsearch headers — sender, subject, recipients, attachment names
searchBodies / search-bodiesreadsearch what the messages say, not just headers
readMessage (CLI: mail read)readone message whole, by the id every other read prints
threadreada whole conversation, oldest first, without launching Mail
attachmentsreadwhat is attached to one message, and whether the bytes are here
coveragereadwhat each account, or each mailbox, can answer about
mailboxesreadlist mailboxes
accountsreadlist mail accounts, disabled ones marked
markRead / mark-readwritemark a message read without opening anything; --unread for the reverse
openwriteshow a message in Mail, which also marks it read
movewritefile a message in a mailbox that already exists
deletewritemove a message to its account's Trash, or refuse
draftdraftcompose an email into Drafts without sending
replyDraft / reply-draftdraftcompose a reply into Drafts without sending
forwardDraft / forward-draftdraftcompose a forward into Drafts without sending
replysendreply in the thread of a message you name
forwardsendpass a message on to somebody else
sendsendsend an email

thread answers the question neither readMessage nor search does — what has already been said here, and did I reply. It selects on conversation_id, a column the index already carries, so it is one indexed predicate rather than a call per message: no Apple Event, Mail never launches, nothing is marked read. Re-threading by subject line instead would be wrong in both directions, measured on a real 45,628-message index: it merges 2,516 subject lines shared by more than one conversation (the worst single subject is shared by 417) and splits 354 conversations that legitimately change subject partway through, both silently. It is label-aware, so a Gmail thread living in [Gmail]/All Mail comes back whole rather than as whichever part one mailbox happened to hold. Pass --conversation-id, or --id with any message in the thread.

forward and forwardDraft are two operations rather than one with a flag, for the reason reply and replyDraft are: the policy gate reads (tool, operation) and never sees an argument, so a flag would have put composing and sending behind one grant. A covering note goes in through the pasteboard and is verified in the compose window before anything is sent, because content is not a property of outgoing message and writing to it discards the thing being forwarded — see Drafting a reply. A forward with no note is allowed, unlike an empty reply: the payload is the thing being forwarded, so an empty body is a complete message rather than the defect.

readMessage marks nothing: no read status, no open, no Apple Event of any kind. The index is read read-only, the body comes off the disk, Mail is not launched, and a message that was unread stays unread — which is the difference between reading somebody's mail and rearranging it. max_chars caps the body at 20,000 and body_truncated says whether it bit. Where a body is not on this Mac it gets a sentence naming the account rather than an empty string.

Mail ids are Envelope Index ROWIDs and Mail reassigns them. Observed inside a single session with nothing unusual happening, ids for the same mail moved from roughly 58,000 to roughly 102,000 because Mail reindexed in the background. So take an id from the read in front of you and spend it immediately; do not carry one across sessions. If mail read --id reports no such message, re-run the search rather than retrying the number — the tool will not silently re-resolve a stale id for you, because re-running a search can land on a different message and quietly reading the wrong mail is worse than an error you can see.

reminders — 11

OperationClassWhat it does
listreadlist reminders, with --due-before / --due-after
searchreadsearch names and notes
listsreadname the reminder lists that exist
openreadopen a reminder in the app
createwritecreate a reminder
updatewritechange a reminder's name, notes, due date or priority
completewritemark a reminder done
uncompletewritemark one not done again
deletewritedelete a reminder
listCreate / list-createwritemake a new reminder list
listDelete / list-deletewritedelete a list and everything on it — see the interlock below

uncomplete is its own operation rather than only a flag (complete --undo still works, and is the same code path — complete(completed=False), which is how the ambiguity refusal and the not-found behaviour stay identical between doing and undoing). Without it the route a caller takes is delete-and-recreate, which silently loses the due date, the priority and the notes.

listCreate refuses rather than choosing an account when more than one could hold the list. A list in the local account never leaves the Mac; a list in iCloud reaches the user's phone. Those are different answers to "add a shopping list", and the one who asked cannot see which they got. It also refuses a duplicate name — not because

PyApple MCP ToolsのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度PyApple MCP Toolsに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

PyApple MCP Toolsをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. PyApple MCP ToolsのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "pyapple-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてPyApple MCP ToolsのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. PyApple MCP ToolsのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
PyApple MCP Toolsを使ってこのタスクを手伝ってもらえますか?
PyApple MCP Tools
はい、読みました。
PyApple MCP Toolsで調べた結果をお伝えします。

よくある質問

PyApple MCP Tools MCPサーバーは何に使いますか?

PyApple MCP Toolsは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでPyApple MCP Tools MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでPyApple MCP Toolsを利用できます。

TypingMindでPyApple MCP Tools MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。PyApple MCP Toolsを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

PyApple MCP Tools MCPをTypingMindに接続するにはどうすればよいですか?

PyApple MCP ToolsはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでPyApple MCP Tools MCPのどのようなツールを利用できますか?

PyApple MCP ToolsはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

PyApple MCP Tools MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。PyApple MCP Toolsで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇