跳到正文
FunCoding

iMCP

A macOS app that provides an MCP server to your Messages, Contacts, Reminders and more

Star
2,030
许可证
MIT
最近提交
2026年12月1日
iMCP

iMCP is a macOS app for connecting your digital life with AI. It works with Claude Desktop, the ChatGPT desktop app, local models served by llama.cpp, and a growing list of clients that support the Model Context Protocol (MCP).

Capabilities

Calendar View and manage calendar events, including creating new events with customizable settings like recurrence, alarms, and availability status.
Contacts Access contact information about yourself and search your contacts by name, phone number, or email address.
Files List, read, and search the folders that you share, and, with the setting turned on, write, move, and trash files in them. Needs folders that you add.
Home Find homes, rooms, accessories, scenes, and automations, read and control accessories, and organize rooms and zones. Needs a helper app that you build with your own Apple Developer account.
Location Access current location data and convert between addresses and geographic coordinates.
Mail List mailboxes, search messages by sender, subject, mailbox, date, or read status, read messages stored on your Mac, and open new drafts in your default email app. Reading mail needs access to your Mail folder.
Maps Provides location services including place search, directions, points of interest lookup, travel time estimation, and static map image generation.
Messages Access message history with specific participants within customizable date ranges.
Music See what's playing in the Music app, control playback, list your playlists and their tracks, and search the Apple Music catalog. Playback and playlist tools need Automation permission for Music; catalog search needs Apple Music access.
Notes Search notes by text, tag, folder, date, pinned state, or what they contain (checklists, tables, links, attachments), and read them as Markdown. List accounts, folders, attachments, and counts. With "Allow tools that make changes" on, create notes and folders.
Phone View call history synced from your iPhone, filter calls by participant, date, or call type, and start calls with system confirmation.
Photos Give photos and their details to the connected client: list albums, find photos and videos by album, date, type, favorite status, or place, view a photo or a contact sheet of several photos as images, and open the system photo picker with a search so that you choose which photos to share. Hidden photos are left out.
Reminders View, create, edit, and delete reminders with customizable due dates, recurrence, priorities, and alerts across different reminder lists, and manage the lists themselves.
Shortcuts List and run shortcuts on your Mac, with optional text input.
Voice Memos Fetch recordings from Voice Memos, with transcripts and audio, filtering by title, folder, or date, or reading Recently Deleted. Needs access to your Voice Memos folder.
Voicemail Fetch voicemails synced from your iPhone, with transcripts and audio, filtering by sender, date, message type, or mailbox (inbox, blocked, or deleted).
Weather Access current weather conditions including temperature, wind speed, and weather conditions for any location.

Getting Started

To use iMCP, you need two apps: iMCP, which gives access to the services you turn on, and an AI app that can connect to MCP servers. Install iMCP and turn on services first. Then follow the instructions for your AI app:

Download and open the app

First, download the iMCP app (requires macOS 15.3 or later). To verify the ZIP, download iMCP.zip.sha256 from the same GitHub release and run shasum -a 256 -c iMCP.zip.sha256 in the directory with both files.

Or, if you have Homebrew installed, you can run the following command:

brew install --cask mattt/tap/iMCP
Screenshot of the iMCP menu, with the Enable MCP Server switch at the top and a list of services below it

When you open the app, you'll see a icon in your menu bar.

Click this icon to open the iMCP menu. The blue "Enable MCP Server" switch at the top indicates that the MCP server is running and ready to connect with AI apps. iMCP must be open for AI apps to use it.

Below the switch, the menu lists the available services. Maps is on when you first open iMCP; the other services are off and appear in gray. iMCP also includes a tool that plays a system sound. That tool is always available, even with every service off, so you can test a connection without granting any permissions.


Screenshot of macOS permission dialog

Turn on services

To turn on a service, click its icon. macOS asks you for permission. For example, when you turn on Calendar, a dialog asks "'iMCP' Would Like Full Access to Your Calendar". Click "Allow Full Access" to continue.

Important

iMCP does not collect or store any of your data. AI apps like Claude and ChatGPT do send your data off device as part of tool calls. Turn on only the services you want your AI app to use. To keep your data on your Mac, use a local model with llama.cpp.


Screenshot of the iMCP menu with all services turned on

When a service is on, its icon changes from gray to the service's color: red for Calendar, green for Messages, blue for Location, and so on.

Repeat these steps for each service that you want to use. macOS asks for each permission separately, so iMCP can access only the data that you allow. To turn off a service, click its icon again. To turn off individual tools in a service, click > "Settings", and then click the service in the sidebar.


Allow tools that make changes

Each service that has tools that make changes has an Allow tools that make changes switch on its Settings page. While it is off, clients don't see that service's tools that make changes and a call to one is refused, so nothing changes. Tools that only read are never affected. Deleting counts as a change, so the same switch covers it. The switch is in the header of the section that lists these tools, after the section of tools that only read. While the switch is off, their rows are dimmed and show no switch. While it is on, a tool's own switch still turns that one tool off.

Services that already had tools that make changes (Calendar, Contacts, Home, Mail, Music, Phone, Reminders and Shortcuts) start with Allow tools that make changes on, so an update changes nothing for them. A service that gets such tools later can start with the switch off until you turn it on.

Sending something to another person needs one more step. Even with Allow tools that make changes on, a tool that sends a message or an email (none does yet; they arrive with their services) shows a window with the client's name, the recipient, and the full text, and sends only after you click its button. When a verified code signature admitted the connection, through a trusted signature or the approval dialog for a verified client, the window names the signing identifier that the approval dialog showed. When a trusted credential admitted it, even for a signed client, or when iMCP couldn't verify the client's signature, the window gives the name that the client reports. The window waits 50 seconds and then cancels, shows one request at a time, and has no "always allow", so each send needs its own click. Starting a call is the same: the Phone app asks you to confirm before dialing.

Approve connections

Screenshot of the iMCP dialog that asks whether to allow an app to connect, with Don't Allow and Allow buttons

The first time an AI app connects, iMCP asks whether to allow it to connect and names the services that the app can use. Click "Allow" to connect, or "Don't Allow" to refuse. "Allow" turns on a second after the dialog opens, and pressing Return doesn't click it, so that a click or a key press meant for another window doesn't approve a client as the dialog opens. If you don't answer within two minutes, iMCP denies the connection. After you deny a client that presents a credential or that iMCP identifies by its code signature, iMCP denies connections from that client without asking for 30 seconds. iMCP shows up to three dialogs at once, and refuses connections while "Enable MCP Server" is off.

Any app can report any name, so iMCP doesn't trust a client by its name. Instead, iMCP trusts a client by the code signature of the app that started it, such as Claude Code, Claude, or Codex, and trusts other clients by a credential that iMCP created for them.

For a client that passes the signature checks, the dialog names the signing identifier and the publisher that iMCP verified, or the team when the certificate names no organization; the team is in the publisher's tooltip. To skip the dialog next time, select "Always allow this app". iMCP stores the client's signing identifier and team in your Keychain, and trusts later versions of the same app. You don't need to add anything to the client's settings. imcp-server finds the app that started it and the app that holds the other ends of its standard input and output, and iMCP accepts only an app whose running code matches a valid signature from a certificate that Apple issued to a team, with the hardened runtime and without entitlements for debugging or for loading libraries named in its environment. iMCP refuses parts of macOS, interpreters and shells by their signing identifiers, and Electron apps whose fuses let them run as Node.js or load code from outside their checked app.asar. iMCP checks the signature each time the client connects. A client that updated on disk but hasn't restarted gets the credential flow until it restarts. If iMCP can't verify a client's signature, the dialog asks about an unverified app and offers a credential instead. The reason is in iMCP's log. The dialog gives the name that the app reports, or, if the app presents a credential that you haven't approved yet, the name of the client that iMCP created the credential for; for a credential that iMCP didn't create or has removed, it says so.

Important

A command-line client such as Claude Code or Codex runs the MCP servers in its settings for whatever program starts it, so any app on your Mac that can start that client can use iMCP through it after you trust the client. For an app such as Claude, other software that runs as you outside App Sandbox can use iMCP through the app's signature. The approval dialog says so for each client that iMCP verifies. A credential has the same limit, because such an app can also read the client's settings. Trust by signature saves you from copying a secret and shows you which team made the client. It doesn't protect iMCP from other software that runs as you outside App Sandbox.

Clients that don't pass, such as an MCP server started from a terminal or by a script, present a credential. imcp-server reads the credential from the IMCP_CLIENT_CREDENTIAL environment variable in the client's MCP settings, and sends it to iMCP after it checks that iMCP is genuine. iMCP stores only a hash of each credential, in your Keychain.

To skip the dialog next time, select "Always allow this client". If the client already presents a credential, for example because an earlier version of iMCP set up Claude Desktop, iMCP trusts that credential. Otherwise, iMCP creates a credential and shows it once. Click "Copy Value" and add IMCP_CLIENT_CREDENTIAL with that value to the environment of the iMCP server in the client's MCP settings. iMCP then shows a notification each time the client connects. You can remove trusted clients in > "Settings" > "Clients", which revokes their credentials or signatures and closes their connections.

Note

Earlier versions of iMCP trusted clients by name. Those clients need your approval again; select "Always allow this app" to trust each one by its code signature, or "Always allow this client" to trust it by a credential if iMCP can't verify its signature.


Add a credential to a client's MCP settings

In a JSON configuration file, add the credential to the server's env:

{
  "mcpServers": {
    "iMCP": {
      "command": "/Applications/iMCP.app/Contents/MacOS/imcp-server",
      "env": {
        "IMCP_CLIENT_CREDENTIAL": "{paste the copied value}"
      }
    }
  }
}

With Claude Code, add the server again with the -e option:

claude mcp remove --scope user iMCP
claude mcp add --scope user -e IMCP_CLIENT_CREDENTIAL={paste the copied value} \
  iMCP -- /Applications/iMCP.app/Contents/MacOS/imcp-server

Anyone who can read the client's settings can use the credential, so keep those files private to your user account. If you think that a credential was exposed, remove the client in "Settings" > "Clients" and trust it again.

Choose which calendars clients can see

By default, iMCP shares all of your calendars. To share only some, click > "Settings", click Calendar in the sidebar, and then turn off the calendars to keep private. Click an account to show its calendars; each account says how many of its calendars are on.

Clients can't list, search, or create events in a calendar that you turn off, and they can't change or delete its events. A request that names such a calendar returns an error that says so. "Show new calendars automatically", below the list of calendars, controls what happens to calendars you add later: when it's off, iMCP keeps new calendars private until you turn them on.

Mail store access uses Envelope, which reads the local index and message files and selects readable content with its internal MIME reader. iMCP manages folder access, tool arguments, JSON output, and composition.

Mail reading requires access to ~/Library/Mail. If folder access is unavailable, mail_compose can still open a compose window in the default email app. It does not save or send a message.

Mail reads use a read-only SQLite connection and require WAL journal mode. iMCP does not change the index's journal mode or run checkpoints. It permits one Mail database connection at a time; concurrent reads wait their turn, and a read returns an error if SQLite reports a lock conflict. Each SQL statement has a 100 ms execution budget, all statements of one read share a 1 s budget, and statements check task cancellation. The deadline is cooperative; it cannot interrupt a filesystem operation while SQLite is waiting for that operation to finish. Slow searches can fail instead of returning results. Service status checks do not open SQLite connections, and message reads close the database before scanning mailbox files. These limits reduce interference, but active reads can still delay WAL checkpoints.

Use the @id string from mail_mailboxes_list as the mailbox filter in mail_messages_search, for example {"mailbox": "V10:12"}. The identifier includes the Mail store, so an identifier from before a Mail store upgrade returns an error. The url field describes storage and is not a search identifier. Each mailbox includes an account identifier when available. The account's email field comes from Mail's local account map; it is null when that map is missing or does not contain an email address.

Search results include localIndex.indexedMessageCount for the selected mailbox, or all mailboxes when no mailbox is selected, before filters and pagination. This count includes label membership without counting a message twice. Sync status is reported as unknown. A count of zero can mean an empty mailbox or missing local indexing; it cannot show whether Mail has ever indexed the account. Open Mail to check account sync.

Search results are newest first. When more messages match, the result includes a nextCursor value; pass it as cursor with the same filters to get the next page. A cursor names the last message of a page, so mail that arrives between requests does not shift later pages.

Search matches sender and subject metadata only. mail_messages_read can read the local content of a returned message. It lists attachments without their content. When Mail stores a message's attachments or inline images in separate files, the message file keeps the text, and each of those attachments has isStoredSeparately set to true. Body search is not available, and these tools do not download messages.

Connect to Claude Desktop

If you don't have Claude Desktop installed, you can download it here.

Open Claude Desktop and choose Claude > "Settings" (⌘,). Click "Developer" in the sidebar, and then click "Edit Config". This creates a configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json.


To connect iMCP to Claude Desktop, click > "Configure Claude Desktop", and then click "Set Up".

iMCP adds or updates its entry in the configuration file so that Claude Desktop starts the imcp-server executable in the app. iMCP keeps the other MCP servers in the file, and keeps a credential that an earlier version of iMCP wrote there. The first time Claude Desktop connects, iMCP still asks you to approve it; select "Always allow this app" to trust it by its code signature.

Configure Claude Desktop manually

Click > "Copy server command to clipboard". Then open claude_desktop_config.json in your editor and enter the following:

{
  "mcpServers": {
    "iMCP": {
      "command": "{paste iMCP server command}"
    }
  }
}

Call iMCP tools from Claude Desktop

Quit and reopen the Claude Desktop app. iMCP asks you to approve the connection.

After you approve the connection, a 🔨 icon with the number of available tools appears in the lower-right corner of the chat box. Click it to see the iMCP tools that Claude can use.

Screenshot of Claude Desktop with tools enabled

Now you can ask Claude questions that require access to your personal data, such as:

"How's the weather where I am?"

Claude uses iMCP tools to get this information, so you don't have to share it in the conversation yourself.

Screenshot of Claude response to user message 'How's the weather where I am?'

Connect to the ChatGPT desktop app

If you don't have the ChatGPT desktop app installed, you can download it here.

Note

These steps use the labels in ChatGPT 26.930 for macOS and haven't been tested end to end yet. OpenAI documents MCP servers for Codex mode, so use iMCP in a Codex conversation.

  1. Click > "Copy server command to clipboard".
  2. In ChatGPT, open Settings (⌘,) and click "MCP servers" in the sidebar.
  3. Click "Add server". Enter iMCP for "Name", choose "STDIO" for "Type", and paste the copied command into "Command to launch". Leave the other fields empty.
  4. Click "Save", and then click "Restart".
  5. Approve the connection in iMCP. ChatGPT might identify itself as codex-mcp-client.

To test the connection, start a new Codex conversation and send this message:

"Use iMCP to play a system sound."

Your Mac plays a short sound. If your Mac is muted, open the tool call in the conversation; a result of true means that iMCP received the request.

Troubleshooting the ChatGPT desktop app
  • Settings doesn't show "MCP servers". Update ChatGPT and switch to Codex mode. If ChatGPT shows "MCP server settings are unavailable" and an organization manages your account, ask your administrator whether you can add MCP servers.
  • iMCP doesn't show an approval dialog. ChatGPT can't open iMCP for you. Make sure that iMCP is open and "Enable MCP Server" is on, and then click "Restart" in ChatGPT's "MCP servers" settings. The dialog can also open behind other windows. If you added a trusted credential to ChatGPT's settings, iMCP shows a notification instead of a dialog.
  • ChatGPT can't use iMCP tools. Make sure that you're in a Codex conversation and that iMCP is turned on in ChatGPT's "MCP servers" settings. If you clicked "Deny", click "Restart" to see the dialog again. If ChatGPT presents a credential, wait 30 seconds first. If you turned on a service after connecting, click "Restart" so that ChatGPT loads its tools.
  • A service doesn't turn on in iMCP. If you denied permission when macOS asked, open System Settings > "Privacy & Security", click the category for the service, such as "Calendars", and turn on iMCP. Then click the service icon in the iMCP menu again.
  • ChatGPT shows an error for the iMCP server. The command might point to the wrong place, for example, if you moved iMCP after setting it up. Copy the server command again, open the iMCP server's settings in ChatGPT, and replace "Command to launch" with the copied command. Make sure that "Arguments" is empty, and then click "Save" and "Restart".

Connect to other clients

Most MCP clients can start iMCP as a local server that uses the STDIO transport. Click > "Copy server command to clipboard", and then enter the copied command as the command for a new STDIO server in your client. The copied command is the full path to the imcp-server executable in your copy of iMCP.

The commands below assume that iMCP is in your Applications folder. If you installed iMCP somewhere else, replace /Applications/iMCP.app/Contents/MacOS/imcp-server with the copied command.

Claude Code

To add iMCP for all of your projects, run this command:

claude mcp add --scope user iMCP -- /Applications/iMCP.app/Contents/MacOS/imcp-server
Or import from Claude Desktop

If you've already configured Claude Desktop, you can import its MCP servers:

claude mcp add-from-claude-desktop
Codex

To add iMCP for all of your projects, run this command:

codex mcp add iMCP -- /Applications/iMCP.app/Contents/MacOS/imcp-server

Codex saves the server in ~/.codex/config.toml, which the ChatGPT desktop app also uses. If you already added iMCP in ChatGPT, Codex has it too.

The first time Codex starts iMCP, iMCP asks you to approve the connection. When the dialog shows a verified publisher, select "Always allow this app" so that Codex can connect without the dialog from then on. You don't need to add a credential to Codex's settings.

Or edit the configuration file

Add this table to ~/.codex/config.toml:

[mcp_servers.iMCP]
command = "/Applications/iMCP.app/Contents/MacOS/imcp-server"
llama.cpp

You can use iMCP with an open model that runs on your Mac through llama.cpp, so your conversations and tool results stay on your Mac. llama-server (or llama serve) starts the MCP servers listed in a configuration file and gives their tools to models in its web UI. This requires llama.cpp 0.1.0 or later.

Create a file at ~/.config/llama/mcp.json with the following contents:

{
  "mcpServers": {
    "imcp": {
      "command": "/Applications/iMCP.app/Contents/MacOS/imcp-server"
    }
  }
}

Then start the server with the --mcp-servers-config option and a model that supports tool calling:

llama serve --mcp-servers-config ~/.config/llama/mcp.json \
            -hf ggml-org/Qwen3-4B-GGUF

Open the web UI at http://localhost:9931 (llama.cpp versions before 0.7.0 use port 8080). iMCP tools appear with an imcp_ prefix, such as imcp_weather_current. The web UI asks you before it runs each tool call, unless you choose to always allow that tool.

Use the Llama app

Llama is a menu bar app that runs llama serve for you. It doesn't have a setting for MCP servers, so add the --mcp-servers-config option to its custom server arguments:

defaults write app.llama.Llama extraServerArgs -string "--mcp-servers-config $HOME/.config/llama/mcp.json"

Llama splits this value at each space and doesn't expand ~, so use the full path to the file, without spaces. If you already set custom server arguments, add the option to your existing value. Quit and reopen Llama, then open the web UI at http://localhost:9931.

Important

When the server starts, it waits 10 seconds for iMCP to list its tools. If you don't approve the connection from "llama.cpp" in that time, no iMCP tools appear until you restart the server.

Technical Details

App & CLI

iMCP is a macOS app that bundles a command-line executable, imcp-server.

  • iMCP.app provides UI for configuring services and — most importantly — a means of interacting with macOS system permissions, so that it can access Contacts, Calendar, and other information.
  • imcp-server provides an MCP server that uses standard input/output for communication (stdio transport).

The app and CLI communicate over a Unix domain socket in the app's sandbox container, at ~/Library/Containers/co.dododo.iMCP/Data/Library/Caches/imcp.sock. The CLI derives that path from the app's bundle identifier, so it needs no network access or service discovery. Before either side sends anything, it reads the other's audit token from the socket and checks the other's code signature. The CLI accepts only an app signed by team TTY35UM57S with the identifier co.dododo.iMCP, and the app accepts only a CLI signed by the same team with the identifier imcp-server. Requests from MCP clients are read by the CLI from stdin and relayed to the app; responses from the app are received by the CLI and written to stdout. See LocalSocket and StdioProxy for implementation details.

Before it sends its hello, imcp-server looks for the client in its process tree. The client must be the only process of the user that holds the other ends of stdin and stdout, which must be pipes or Unix domain sockets. It must be the parent of imcp-server, or its grandparent through one known helper of the same team, such as Claude's disclaimer. imcp-server sends the audit tokens of the client and the helper, with the facts that the sandboxed app can't read itself: entitlements, a static validation of the bundle on disk, and the fuses of an Electron app. The app checks the client's token against a requirement through its signature service (see below), which pins Apple's certificate, the identifier, and the team, and the publisher when the certificate names one that iMCP can put in a requirement. It checks the helper's token against a requirement that pins the helper's identifier and team under Apple's certificate. It checks the parent process IDs, and then checks the rules in ClientSignaturePolicy: hardened runtime, no get-task-allow, no allow-dyld-environment-variables, no platform binary, no interpreter or shell, and, for Electron, RunAsNode off with asar integrity and OnlyLoadAppFromAsar on. A process that runs as the same user outside App Sandbox can still start a trusted client with commands of its choice, so this check identifies the client but doesn't stop such a process.

The app bundle contains an XPC service, Contents/XPCServices/SignatureService.xpc, that runs outside App Sandbox and checks each client's audit token against a requirement for the app. It also reads the client's code-signing status, and returns the results without making any decision. Inside App Sandbox, the same check failed with EPERM for a process whose code signature was larger than about 1 MB, such as Codex: in tests on macOS 27.0, a code directory of 819,688 bytes passed and one of 1,229,288 bytes failed. That limit is observed behavior, not documented behavior. Every client goes through the service. It accepts connections only from code that satisfies the app's requirement, and the app accepts only a service signed by the same team with the identifier co.dododo.iMCP.SignatureService. If the app can't reach the service or gets no answer in 3 seconds, the client is unverified and gets the approval dialog, unless it presents a trusted credential, which approves it without the service. See SignatureService.

Debug builds made with CODE_SIGNING_ALLOWED=NO are signed ad hoc, so they have no team to check and no App Sandbox entitlement. In Debug builds only, each side also accepts a peer that has the expected identifier (imcp-server, iMCP or co.dododo.iMCP for the app, or SignatureService or co.dododo.iMCP.SignatureService for the service), and an unsandboxed app listens at ~/Library/Caches/co.dododo.iMCP/imcp.sock, which the Debug CLI tries after the container path. Any process can claim an identifier, so don't use Debug builds with your own data. Release builds don't contain this code.

For this project, we created what became the official Swift SDK for Model Context Protocol servers and clients. The app uses this package to handle proxied requests from MCP clients.

iMessage Database Access

Apple doesn't provide public APIs for accessing your messages. However, the Messages app on macOS stores data in a SQLite database located at ~/Library/Messages/chat.db.

iMCP runs in App Sandbox, which limits its access to user data and system resources. When you go to enable the Messages service, you'll be prompted to select your ~/Library/Messages folder through the standard file picker. When you do, macOS adds that folder to the app's sandbox. NSOpenPanel is magic like that. The folder matters: chat.db is a WAL-mode database, and Messages writes every new message to chat.db-wal next to it first, only folding the log into chat.db at a checkpoint every few MB — often hours later. A grant on chat.db alone (what earlier versions asked for) leaves that log unreadable, so the newest messages were missing until then. If you granted chat.db with an earlier version, Messages keeps working from the last checkpoint; switch Messages off and on in the iMCP menu to grant the folder instead.

Attachment files are a separate matter. The sandbox walls off ~/Library/Messages/Attachments from a grant on its parent folder, so reading message attachments (messages_attachment_read) asks for that subfolder through the same picker — a second, read-only grant of its own. Granting it is optional: declining leaves messages_attachment_read unable to read files, while everything else keeps working. If you granted the Messages folder before attachments were supported, switch Messages off and on in the iMCP menu to be asked for it.

But opening the iMessage database is just half the battle. Over the past few years, Apple has moved away from storing messages in plain text and instead toward a proprietary typedstream format.

For this project, we created Madrid: a Swift package for reading your iMessage database. It includes a Swift implementation for decoding Apple's typedstream format, adapted from Christopher Sardegna's imessage-exporter project and blog post about reverse-engineering typedstream.

Call History Database Access

Call history synced from your iPhone lives in a SQLite database at ~/Library/Application Support/CallHistoryDB/CallHistory.storedata. Recent calls sit in its write-ahead log next to the store file, so the Phone service asks you to open the CallHistoryDB folder rather than the file alone.

Visual Voicemail Database Access

Voicemails synced from your iPhone by the Phone app (on macOS 26 and later) live in a SQLite database at ~/Library/Group Containers/group.com.apple.FaceTime/com.apple.facetimemessagestored/Data Store/FaceTimeMessageStore-local.sqlitedb. The store is a write-ahead log database, and the message audio sits in an Assets tree beside it, so the Voicemail service asks you to open the Data Store folder rather than the file alone.

Voice Memos Library Access

Voice Memos keeps its library in a SQLite database at ~/Library/Group Containers/group.com.apple.VoiceMemos.shared/Recordings/CloudRecordings.db. The audio files sit beside the database, so the Voice Memos service asks you to open the Recordings folder rather than the file alone. Voice Memos writes each transcript into the audio file of its recording, so a recording has a transcript only when its audio is on your Mac.

For this project, we created TSRP: a Swift package for reading your Voice Memos library. It reads transcripts from both .m4a and .qta files, which keep them in different places.

Shared Folders

The Files service reaches only the folders that you add. Click > "Settings", click Files in the sidebar, and then click "Add Folder…" to choose a folder. Click "Remove" beside a folder to stop sharing it. iMCP keeps each folder as a security-scoped bookmark, which macOS ties to iMCP and which iMCP opens only while a tool runs. If a folder moves or stops working, Settings marks it, and you remove it and add it again.

A path is the name of a shared folder followed by a path inside it, such as Documents/Taxes/2025.pdf, and files_roots lists the names. iMCP resolves symbolic links before it checks a path, so a link that points out of a shared folder is refused, and so are .. and absolute paths. iMCP never opens a Photos library: it refuses to share one, or a folder inside one, and it refuses any path that goes through one.

Reading, listing, and searching are always allowed:

  • files_roots lists the shared folders.
  • files_list lists a folder, 100 entries at a time by default, with nextOffset for the next page. It leaves out hidden files unless includeHidden is true.
  • files_stat describes a file or folder, and can include its SHA-256.
  • files_read returns text, decoded from UTF-8, UTF-16, or Windows text, up to 256 KB at a time by default and 1 MB at most, and says when it was cut short. A binary file comes back as base64 up to 256 KB, and is refused beyond that unless you ask for it in pieces.
  • files_search finds files by name, and text inside them, and stops at a limit or after a time budget of 10 seconds by default, and says when it did. It reads only text files up to 2 MB, and never follows a link out of a folder.

Changing files needs the service's Allow tools that make changes setting in the Files settings, where it is off by default. While it is off, clients aren't offered these tools, and one that calls them anyway is refused. Each of them opens the folder that holds the file one step at a time without following links, and does its work relative to that folder, so a folder or file that is swapped for a link after iMCP checked the path is refused and not written through.

  • files_write writes a text file of up to 1 MB. It creates a new file, and replaces an existing one only if you pass the expectedModified or expectedSha256 that files_stat or files_read returned and the file still matches, or pass overwrite. A replaced file doesn't go to the Trash, so the default is to refuse.
  • files_append adds text to the end of a file.
  • files_mkdir creates a folder, and the folders above it.
  • files_move moves or renames a file or folder between shared folders, and never replaces one that is there.
  • files_trash moves a file or folder to the Trash. iMCP never deletes anything for good.

Notes Database Access

Apple doesn't provide public APIs for accessing your notes, either. The Notes app keeps them in a SQLite database at ~/Library/Group Containers/group.com.apple.notes/NoteStore.sqlite. Recent edits sit in its write-ahead log, so the Notes service asks you to open the group.com.apple.notes folder rather than the file alone. iMCP reads notes from the database and never writes to it.

Each note's contents are stored as a gzip-compressed protocol buffer: the text, followed by runs that give the formatting of each part of it. Tables are stored separately, as the state of a CRDT that lists the rows, the columns, and the cell at each intersection. Notes locked with a password are encrypted, so iMCP can find them by title but can't read their contents.

For this project, we created TopoText: a Swift package for reading the Notes database, named after Apple's internal name for the note text format. It builds on the reverse engineering in Jon Baumann's apple_cloud_notes_parser and Steve Dunham's notesutils. The Notes service reads notes with TopoText and returns them as Markdown.

Besides notes_fetch and notes_read, the service lists accounts, folders (with their paths), attachments, and note counts. Each note has a notes://showNote?identifier= link that opens it in the Notes app. Filters on word counts and on what a note contains need to read each candidate note's contents, so a call reads the contents of at most 500 notes. Every notes_fetch call, whatever its filters, examines at most 2,000 notes, and returns a nextCursor to continue when it stops before filling the page.

The Notes service can also create notes and folders, but only while Allow tools that make changes is on in iMCP's Notes settings, where it is off by default. These tools (notes_create and notes_create_folder) ask the Notes app to make the note or folder with its own scripting interface, so Notes stores it as it stores anything else that it makes. They need Automation permission for Notes, which macOS asks you for the first time. iMCP never edits, moves, or deletes a note that exists: scripting rewrites a note's whole body, and doing that to a note with attachments, checklists, links, or tags silently drops them. Even a new note keeps less than you might write, because Notes drops what it can't store:

  • A link keeps its text but not its address, so iMCP writes Markdown links as the text followed by the address.
  • Notes has no checklists to create through scripting, so a Markdown task becomes a bullet that starts with ☐ or ☑.
  • A numbered list would merge into the bullet list before it, so iMCP writes numbered items as lines that start with their numbers.
  • Block quotes and code blocks become plain and monospaced text, and headings become bold text in a larger size, not the Heading styles.

iMCP passes a note's title, text, and folder to a fixed script as parameters and never builds a script from them, so nothing in a title or a note can change what the script does.

JSON-LD for Tool Results

The tools provided by iMCP return results as JSON-LD documents. For example, the fetchContacts tool uses the Contacts framework, which represents people and organizations with the CNContact type. Here's how an object of that type is encoded as JSON-LD:

{
  "@context": "https://schema.org",
  "@type": "Person",
  "name": "Mattt",
  "url": "https://mat.tt"
}

A tool that returns a list, such as contacts_search, returns a JSON-LD document that holds the list in @graph under a single @context. To keep results short, values nested in another value, including the values in a graph, leave out @type.

Schema.org provides standard vocabularies for people, postal addresses, events, and many other objects we want to represent. And JSON-LD is a convenient encoding format for humans, AI, and conventional software alike.

For this project, we created Ontology: a Swift package for working with structured data. It includes convenience initializers for types from Apple frameworks, such as those returned by iMCP tools.

iMCP Helper

Apple doesn't make the HomeKit framework available to native macOS apps, only to Mac Catalyst apps. So the Home service runs in a separate Catalyst app, iMCP Helper. Apple doesn't allow HomeKit in Developer ID apps, so iMCP's release build doesn't include the helper. Build and install it with your own Apple Developer account:

git clone https://github.com/mattt/iMCP.git
cd iMCP
Scripts/install-helper.sh

The script signs the helper with your team's development certificate and installs it in /Applications. Run it with --help to choose another team, bundle ID, or install directory. Xcode must be signed in to your account (Xcode > Settings > Accounts), and the helper runs only on Macs registered to your team. Whether free personal teams can use HomeKit isn't verified. Then turn on Home in iMCP. iMCP finds the helper in /Applications. If you installed it somewhere else, iMCP asks you to choose it when you turn on Home, or you can choose it in Settings > Home. When you enable Home, iMCP launches the helper if it isn't running, and the helper asks for HomeKit access. The first time, the helper's window shows an eight-character pairing code, such as 7KQ2-M9XD, and numbered steps: click Copy Code, click Open iMCP… to open iMCP's Pair with iMCP Helper window, then paste the code and click Pair. The button opens the URL imcp://pair, which carries no data; iMCP only opens its pairing window for it. The helper opens that URL only with the app that has iMCP's bundle ID, co.dododo.iMCP, preferring the running copy, and not with a copy that doesn't declare the imcp scheme; otherwise, for example if you built iMCP with another bundle ID, the helper tells you to choose Pair… in Settings > Home instead. If the helper's window is behind other windows, click Open iMCP Helper… in iMCP's window. The code works once: when you pair, iMCP sends the helper a new random key, and both apps keep that key in their keychains. After five wrong codes, the helper shows a new one. To pair again, click Pair Again… in the helper's window and confirm; the helper ends iMCP's connection and shows a new code and the same steps. The helper keeps running after iMCP quits; choose Quit iMCP Helper from its app menu, or press Command-Q, to stop it. The window also reports startup and permission errors. The Mac's iCloud account must have access to the home, and writes can require the owner or administrator role.

Sparkle updates iMCP but not the helper. After an iMCP update, rebuild the helper from the tag that matches the new version:

git fetch --tags
git checkout <version>
Scripts/install-helper.sh

A helper from an older version may not match the app's Home tools.

The helper's development certificate and provisioning profile expire. Each is usually valid for one year, but the certificate can expire first. To read the profile's expiration date, run:

security cms -D -i "/Applications/iMCP Helper.app/Contents/embedded.provisionprofile" |
  plutil -extract ExpirationDate raw -o - -

To read the certificate's expiration date, run:

codesign -d --extract-certificates=/tmp/imcp-helper-cert "/Applications/iMCP Helper.app"
openssl x509 -inform DER -in /tmp/imcp-helper-cert0 -noout -enddate

After the earlier of the two dates, the helper may stop launching. Run Scripts/install-helper.sh again to renew it; the script lets Xcode create a new certificate and profile when the old ones have expired.

On the first run, provisioning can fail with "PLA Update available". The team's Account Holder must accept the latest Program License Agreement in the Apple Developer account. If you can't write to /Applications (for example, as a non-admin user), the install can fail with a permission error. Run the script with --destination ~/Applications instead. iMCP then asks you to choose the helper.

Both apps compile the same tool definitions from Shared/Home/HomeTools.swift. The helper implements them with HomeKit; the app forwards each call over an MCP connection on the loopback interface, so the usual service and per-tool switches apply. Object IDs are HomeKit UUID strings. Inventory tools return live characteristic values only when include_values is true, with a five-second timeout and at most four outstanding HomeKit reads. After a lost connection, read-only calls retry once. Writes are not repeated, because HomeKit may have applied them already; the error asks the caller to inspect the home before retrying. HomeKit sometimes refuses characteristic reads, accessory identification, and scene action edits with "Missing entitlement for API" or "Request not handled". In some tests, these refusals happened only while the helper was hidden, or its window was minimized or closed, but other tests didn't reproduce them, so the cause isn't confirmed. The error keeps HomeKit's description, domain, and code, and suggests showing iMCP Helper's window and retrying; the window can stay behind other windows.

The helper advertises "_imcp-helper._tcp" on the local-only DNS-SD interface, and iMCP finds it there, whether or not iMCP launched it. If more than one helper is running, iMCP tries the one at the chosen location first, then the others. Connections use TLS with the key from pairing as a pre-shared key, so a connection without the key fails the TLS handshake. The cipher suite adds an ECDHE key exchange, so a recorded connection stays secret even if the key or code is found later. The pairing connection uses a key derived from the code with PBKDF2, which makes each guess slow for a process that advertises itself as the helper while you pair. If you built the helper with an earlier version of iMCP, quit it and rebuild it with Scripts/install-helper.sh; iMCP refuses a helper that doesn't declare the current protocol version. With Home turned on in iMCP, uv run Scripts/check-home.py <path-to-imcp-server> runs a read-only integration check through iMCP.

Building the helper

Building the iMCP scheme runs Scripts/build-helper.sh, which builds the iMCP Helper scheme for Mac Catalyst in its own derived-data directory and copies the product into the app. A direct target dependency selects the iOS variant of the helper, so the nested build is required. Release builds set EMBED_HOME_HELPER = NO and leave the helper out.

The HomeKit entitlement requires a development certificate and a provisioning profile with the HomeKit capability. So the helper uses automatic signing with team TTY35UM57S in both Debug and Release, even though the native Debug app is unsigned. To build with another team, change it in the helper target's Signing & Capabilities tab. The first Mac Catalyst build for a new bundle ID can fail with "Entitlement com.apple.developer.homekit not found and could not be included in profile", because automatic provisioning registers the capability only for the iOS destination. Scripts/install-helper.sh handles this by building for iOS once and retrying. To do it by hand, build the helper once for iOS to register it, then build for Mac Catalyst:

xcodebuild -scheme "iMCP Helper" -destination "generic/platform=iOS" \
  -allowProvisioningUpdates build
xcodebuild -scheme "iMCP Helper" -destination "platform=macOS,variant=Mac Catalyst" \
  -allowProvisioningUpdates build

CI builds both apps unsigned, which checks compilation and packaging but can't access HomeKit:

xcodebuild -scheme iMCP -configuration Debug -destination "platform=macOS" \
  CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO \
  HELPER_CODE_SIGNING_ALLOWED=NO build

Debugging

Connecting imcp-server to the app

imcp-server writes its log to stderr, which most MCP clients save with their own logs. If it reports that it couldn't connect to iMCP, make sure that iMCP is open and that its server is turned on; imcp-server keeps trying until the app is available. Once it relays anything from the MCP client, it doesn't reconnect: if the connection ends, it exits, and the client must start it again for a new session, which iMCP approves again. If it reports that the process listening at the socket path isn't a signed copy of iMCP, something other than iMCP created the socket. Quit and reopen iMCP, which replaces a socket that it can't verify.

Using the MCP Inspector

To debug interactions between iMCP and clients, you can use the inspector tool (requires Node.js):

  1. Click > "Copy server command to clipboard"

  2. Open a terminal and run the following commands:

    # Download and run inspector package on imcp-server
    npx @modelcontextprotocol/inspector [paste-copied-command]
    
    # Open inspector web app running locally
    open http://127.0.0.1:6274
    

Inspector lets you see all requests and responses between the client and the iMCP server, which is helpful for understanding how the protocol works.

Using Companion

Companion is a utility for testing and debugging your MCP servers (requires macOS 15 or later). It gives you an easy way to browse and interact with a server's prompts, resources, and tools. Here's how to connect it to iMCP:

  1. Click > "Copy server command to clipboard"
  2. Download and open the Companion app
  3. Click the + button in the toolbar to add an MCP server
  4. Fill out the form:
    • Enter "iMCP" as the name
    • Select "STDIO" as the transport
    • Paste the copied iMCP server command
    • Click "Add Server"

Acknowledgments

License

This project is available under the MIT license. See the LICENSE file for more info.

iMessage® is a registered trademark of Apple Inc. This project is not affiliated with, endorsed, or sponsored by Apple Inc.

同类 MCP Server

Netdata

Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.

NEnetdata/netdata82k近 7 天新增 123 个 star

Oh My Posh Validator

Validate oh-my-posh configurations and segment snippets against the official schema.

JAJanDeDobbeleer/oh-my-posh24k近 7 天新增 29 个 star

Coder

Manage Coder workspaces, templates, and cloud development environments

COcoder/coder18k近 7 天新增 57 个 star

docker-android

Android in docker solution with noVNC supported, video recording, mcp server and AI-agent

BUbudtmo/docker-android16k近 7 天新增 18 个 star

精选

Windows-MCP

控制 Windows 应用,操作文件和界面,执行 QA 测试。

CUCursorTouch/Windows-MCP12k近 7 天新增 286 个 star

pal-mcp-server

The power of Claude Code / GeminiCLI / CodexCLI + [Gemini / OpenAI / OpenRouter / Azure / Grok / Ollama / Custom Model / All Of The Above] working as one.

BEBeehiveInnovations/pal-mcp-server12k近 7 天新增 21 个 star