iMCP README

The project's README from github.com/mattt/iMCP. As one markdown file: README.md.

iMCP

iMCP is a macOS app for connecting your digital life with AI. It works with Claude Desktop 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.
Location Access current location data and convert between addresses and geographic coordinates.
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.
Phone View call history synced from your iPhone, filter calls by participant, date, or call type, and start calls with system confirmation.
Reminders View and create reminders with customizable due dates, priorities, and alerts across different reminder lists.
Shortcuts List and run shortcuts on your Mac, with optional text input.
Weather Access current weather conditions including temperature, wind speed, and weather conditions for any location.

Getting Started

Download and open the app

First, download the iMCP app (requires macOS 15.3 or later).

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

brew install --cask mattt/tap/iMCP
Screenshot of iMCP on first launch

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

Clicking on this icon reveals the iMCP menu, which displays all available services. Initially, all services will appear in gray, indicating they're inactive.

The blue toggle switch at the top indicates that the MCP server is running and ready to connect with MCP-compatible clients.


Screenshot of macOS permission dialog

Activate services

To activate a service, click on its icon. The system will prompt you with a permission dialog. For example, when activating Calendar access, you'll see a dialog asking "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. Clients like Claude Desktop do send your data off device as part of tool calls.


Screenshot of iMCP with all services enabled

Once activated, each service icons goes from gray to their distinctive colors — red for Calendar, green for Messages, blue for Location, and so on.

Repeat this process for all of the capabilities you'd like to enable. These permissions follow Apple's standard security model, giving you complete control over what information iMCP can access.


Connect to Claude Desktop

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

Open Claude Desktop and go to "Settings... (⌘,)". Click on "Developer" in the sidebar of the Settings pane, and then click on "Edit Config". This will create a configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json.


To connect iMCP to Claude Desktop, click > "Configure Claude Desktop".

This will add or update the MCP server configuration to use the imcp-server executable bundled in the application. Other MCP server configurations in the file will be preserved.

You can also 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. You'll be prompted to approve the connection.


After approving the connection, you should now see 🔨12 in the bottom right corner of your chat box. Click on that to see a list of all the tools made available to Claude by iMCP.

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 will use the appropriate tools to retrieve this information, providing you with accurate, personalized responses without requiring you to manually share this data during your conversation.

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

Connect to Claude Code

To add iMCP globally after installing the app:

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

Connect to Cursor

Open this deep link to automatically install the iMCP server:

Install MCP Server

Connect to Amp

To add iMCP globally (available in all projects):

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

[!NOTE] When a client first connects, iMCP will show an approval dialog. Click "Allow" and check "Always trust this client" to avoid repeated prompts.

Technical Details

App & CLI

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

The app and CLI communicate with each other on the local network using Bonjour for automatic discovery. Both advertise a service with type "_mcp._tcp" and domain "local". 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 StdioProxy for implementation details.

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.

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.

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"
}

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.

Debugging

Allowing local network access

imcp-server finds the iMCP app with Bonjour, so it needs permission to access the local network. imcp-server has its own entry in System Settings > Privacy & Security > Local Network, separate from iMCP and from the app that runs it, such as your terminal. If that entry is turned off, imcp-server can't find the app and reports that Bonjour service discovery timed out.

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.

iMCP (mattt/iMCP)

Searching Database…

1.8K ·GitHub
这是什么?iMCP 是一个 macOS 应用,把你 Mac 上的个人数据(日历、通讯录、信息、提醒事项、位置、地图、电话、快捷指令、天气)变成一个 MCP 服务器,让 Claude 等 AI 助手可以在你授权的情况下查询。
这是独立应用,还是后台服务?它是一个带菜单栏图标的 macOS 应用,捆绑了一个单独的命令行可执行文件(imcp-server);应用负责权限界面,而命令行工具通过 stdio 与客户端进行 MCP 协议通信。
怎么把它跑起来?下载 iMCP 应用(需要 macOS 15.3+)或通过 Homebrew 安装,打开它即可看到菜单栏图标,然后点击每个服务图标(日历、信息等),通过正常的 macOS 弹窗授予相应权限。
使用它需要 Claude Desktop 吗?你需要一个兼容 MCP 的客户端来实际与它对话——Claude Desktop、Claude Code、Cursor 和 Amp 都受支持,提供一键或复制粘贴的配置。
开启信息(Messages)访问权限是否很直接?并不完全:信息数据库会先把新消息写入单独的 WAL 日志文件,因此只授予 chat.db 的访问权限(旧版本就是这样做的)会让最近的消息无法读取——你需要改为授予整个 Messages 文件夹的访问权限。
我需要什么版本的 macOS?需要 macOS 15.3 或更高版本;没有 Windows 或 Linux 版本,因为它依赖 Contacts 和 EventKit 等 Apple 原生框架。
我的个人数据会离开我的 Mac 吗?iMCP 本身不收集也不存储任何东西,但一旦你向 AI 客户端提出需要用到你数据的问题,该客户端(例如 Claude Desktop)就会在工具调用过程中把取回的数据发送到设备之外。
AI 助手通过 iMCP 实际能做什么?通过暴露的工具,客户端可以读取/创建日历事件、搜索联系人、调取与某个特定人的消息历史、查询路线和附近地点、查看通话记录、运行快捷指令、查看提醒事项,以及获取当前天气或位置。
作者为什么不得不做逆向工程?Apple 没有读取 iMessage 内容的公开 API,因此作者构建了一个名为 Madrid 的 Swift 包,解码 Apple 专有的 typedstream 格式来直接读取 chat.db 数据库。
连接不工作时我该怎么调试?你可以运行官方的 MCP Inspector(需要 Node.js)或 Companion 应用来查看客户端与 iMCP 服务器之间的原始请求和响应,并检查 imcp-server 是否拥有本地网络权限,以便它能通过 Bonjour 找到该应用。
Creator
mattt
Size
3.4 MB
Stars
1.8K
Age
1y
Commits · 90 Days