# supermemoryai/apple-mcp architecture

> Architecture diagram of the GitHub repository supermemoryai/apple-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/supermemoryai/apple-mcp
- Repository: https://github.com/supermemoryai/apple-mcp

## Overview

1. This repository is a Bun/TypeScript implementation of an MCP server for macOS. Its purpose is to expose Apple-app actions to AI clients like Claude Desktop or Cursor, so the model can search, create, and modify content across Apple apps.

2. The top-level runtime entrypoint is `index.ts`. That file is the server bootstrap: it wires the MCP server lifecycle together and connects the exposed tools to the underlying app-specific logic.

3. `tools.ts` is the central capability registry. It is the layer that defines which MCP tools exist, how they are named, and how requests are routed into the domain modules. For an architecture diagram, this is the main “API surface” box between the MCP client and the rest of the codebase.

4. The `utils/` directory contains the domain boundaries for Apple functionality:
   - `utils/messages.ts` for Messages
   - `utils/mail.ts` for Mail
   - `utils/notes.ts` for Notes
   - `utils/reminders.ts` for Reminders
   - `utils/calendar.ts` for Calendar
   - `utils/contacts.ts` for Contacts
   - `utils/maps.ts` for Maps
   - `utils/web-search.ts` for search-related helper behavior
   These modules are where the app-specific behavior lives, and they are the main internal subsystems to show separately in a diagram.

5. The repository is structured as a thin orchestration layer over these utilities. The flow is: MCP client request -> `index.ts` server runtime -> `tools.ts` tool dispatch -> one of the `utils/*` domain modules -> result returned back through MCP. That makes the architecture highly modular, with each Apple domain isolated behind its own module.

6. The README shows the server is intended to support chained, multi-step assistant workflows, not just single commands. That means the system is designed for composability: one tool can read or search data, and the output can feed another tool such as sending a message, creating a reminder, or composing an email.

7. The `manifest.json` and `apple-mcp.dxt` files indicate packaging for desktop/MCP distribution. These are deployment-facing artifacts rather than business logic, and they matter because they define how the server is installed and launched inside client environments.

8. Testing is split into a small integration-focused suite under `tests/`. The test layout suggests the repo verifies end-to-end behavior per domain rather than unit-testing each helper in isolation:
   - `tests/integration/*.test.ts` covers calendar, contacts, mail, maps, messages, notes, and reminders
   - `tests/fixtures/` and `tests/helpers/` provide shared test data and utilities
   - `test-runner.ts` is the orchestration entrypoint for executing the test suite

9. The architecture likely depends on macOS-native automation capabilities indirectly through the utility layer, since the project’s goal is to drive Apple apps. The exact mechanism is abstracted away from the entrypoint and tool registry, which keeps the MCP surface stable even if the app-control implementation changes.

10. `README.md` emphasizes local use through Bun and `bunx`, so the runtime boundary is simple: install dependencies, start the TypeScript server, and connect it to an MCP client. That makes this repo a single-process local service rather than a distributed system.

11. The main architectural boundary to diagram is therefore:
   - external MCP client / desktop host
   - MCP server bootstrap and tool routing
   - per-domain Apple app adapters in `utils/`
   - test harness and fixtures validating each domain
   - packaging artifacts for distribution

12. In short, this is a modular MCP adapter server for macOS productivity apps, with one central dispatcher and a set of narrow domain modules. The clean separation is by Apple app domain, and the primary data flow is request/response through the MCP tool layer.

Main entry points: [`tools.ts`](https://github.com/supermemoryai/apple-mcp/blob/main/tools.ts) (Tool registry), [`index.ts`](https://github.com/supermemoryai/apple-mcp/blob/main/index.ts) (Server bootstrap), [`apple-mcp.dxt`](https://github.com/supermemoryai/apple-mcp/blob/main/apple-mcp.dxt) (DXT package), [`utils/message.ts`](https://github.com/supermemoryai/apple-mcp/blob/main/utils/message.ts) (Messages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_mcp_client(("MCP client<br/>external host"))
  node_index_ts["Server bootstrap<br/>entrypoint<br/>[index.ts]"]
  node_tools_ts["Tool registry<br/>dispatcher<br/>[tools.ts]"]
  node_multi_step(("Chained workflows<br/>assistant pattern"))
end

subgraph group_domains["Apple domains"]
  node_messages_ts["Messages<br/>domain adapter<br/>[message.ts]"]
  node_mail_ts["Mail<br/>domain adapter<br/>[mail.ts]"]
  node_notes_ts["Notes<br/>domain adapter<br/>[notes.ts]"]
  node_reminders_ts["Reminders<br/>domain adapter<br/>[reminders.ts]"]
  node_calendar_ts["Calendar<br/>domain adapter<br/>[calendar.ts]"]
  node_contacts_ts["Contacts<br/>domain adapter<br/>[contacts.ts]"]
  node_maps_ts["Maps<br/>domain adapter<br/>[maps.ts]"]
  node_web_search_ts["Web search<br/>shared helper<br/>[web-search.ts]"]
end

subgraph group_testing["Testing"]
  node_test_runner_ts["Test runner<br/>test orchestration<br/>[test-runner.ts]"]
  node_integration_tests["Integration tests<br/>test suite"]
  node_test_helpers["Test helpers<br/>test support"]
end

subgraph group_packaging["Packaging"]
  node_apple_mcp_dxt["DXT package<br/>distribution artifact<br/>[apple-mcp.dxt]"]
  node_manifest_json["Manifest<br/>distribution config<br/>[manifest.json]"]
end

node_mcp_client -->|"MCP requests"| node_index_ts
node_index_ts -->|"registers tools"| node_tools_ts
node_tools_ts -->|"dispatches"| node_messages_ts
node_tools_ts -->|"dispatches"| node_mail_ts
node_tools_ts -->|"dispatches"| node_notes_ts
node_tools_ts -->|"dispatches"| node_reminders_ts
node_tools_ts -->|"dispatches"| node_calendar_ts
node_tools_ts -->|"dispatches"| node_contacts_ts
node_tools_ts -->|"dispatches"| node_maps_ts
node_tools_ts -->|"dispatches"| node_web_search_ts
node_messages_ts -.->|"supports"| node_multi_step
node_mail_ts -.->|"supports"| node_multi_step
node_notes_ts -.->|"supports"| node_multi_step
node_reminders_ts -.->|"supports"| node_multi_step
node_calendar_ts -.->|"supports"| node_multi_step
node_contacts_ts -.->|"supports"| node_multi_step
node_maps_ts -.->|"supports"| node_multi_step
node_test_runner_ts -->|"executes"| node_integration_tests
node_integration_tests -->|"uses"| node_test_helpers
node_apple_mcp_dxt -.->|"described by"| node_manifest_json
node_manifest_json -->|"launches"| node_index_ts
node_apple_mcp_dxt -.->|"bundles"| node_index_ts

click node_index_ts "https://github.com/supermemoryai/apple-mcp/blob/main/index.ts"
click node_tools_ts "https://github.com/supermemoryai/apple-mcp/blob/main/tools.ts"
click node_messages_ts "https://github.com/supermemoryai/apple-mcp/blob/main/utils/message.ts"
click node_mail_ts "https://github.com/supermemoryai/apple-mcp/blob/main/utils/mail.ts"
click node_notes_ts "https://github.com/supermemoryai/apple-mcp/blob/main/utils/notes.ts"
click node_reminders_ts "https://github.com/supermemoryai/apple-mcp/blob/main/utils/reminders.ts"
click node_calendar_ts "https://github.com/supermemoryai/apple-mcp/blob/main/utils/calendar.ts"
click node_contacts_ts "https://github.com/supermemoryai/apple-mcp/blob/main/utils/contacts.ts"
click node_maps_ts "https://github.com/supermemoryai/apple-mcp/blob/main/utils/maps.ts"
click node_web_search_ts "https://github.com/supermemoryai/apple-mcp/blob/main/utils/web-search.ts"
click node_test_runner_ts "https://github.com/supermemoryai/apple-mcp/blob/main/test-runner.ts"
click node_integration_tests "https://github.com/supermemoryai/apple-mcp/tree/main/tests/integration"
click node_test_helpers "https://github.com/supermemoryai/apple-mcp/tree/main/tests/helpers"
click node_apple_mcp_dxt "https://github.com/supermemoryai/apple-mcp/blob/main/apple-mcp.dxt"
click node_manifest_json "https://github.com/supermemoryai/apple-mcp/blob/main/manifest.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mcp_client,node_index_ts,node_tools_ts,node_multi_step toneBlue
class node_messages_ts,node_mail_ts,node_notes_ts,node_reminders_ts,node_calendar_ts,node_contacts_ts,node_maps_ts,node_web_search_ts toneAmber
class node_test_runner_ts,node_integration_tests,node_test_helpers toneMint
class node_apple_mcp_dxt,node_manifest_json toneRose
```

## Components

### Runtime

MCP server bootstrap and tool dispatch

- **MCP client**: external host · Claude Desktop, Cursor, or another MCP consumer sending requests
- [Server bootstrap](https://github.com/supermemoryai/apple-mcp/blob/main/index.ts): entrypoint · Starts the MCP server and wires lifecycle to tool handlers · `index.ts`
- [Tool registry](https://github.com/supermemoryai/apple-mcp/blob/main/tools.ts): dispatcher · Defines MCP tools and routes calls into domain modules · `tools.ts`
- **Chained workflows**: assistant pattern · Read/search then compose follow-up actions across apps

### Apple domains

App-specific capability modules

- [Messages](https://github.com/supermemoryai/apple-mcp/blob/main/utils/message.ts): domain adapter · Apple Messages actions and lookups · `utils/message.ts`
- [Mail](https://github.com/supermemoryai/apple-mcp/blob/main/utils/mail.ts): domain adapter · Apple Mail actions and lookups · `utils/mail.ts`
- [Notes](https://github.com/supermemoryai/apple-mcp/blob/main/utils/notes.ts): domain adapter · Apple Notes actions and lookups · `utils/notes.ts`
- [Reminders](https://github.com/supermemoryai/apple-mcp/blob/main/utils/reminders.ts): domain adapter · Apple Reminders actions and lookups · `utils/reminders.ts`
- [Calendar](https://github.com/supermemoryai/apple-mcp/blob/main/utils/calendar.ts): domain adapter · Apple Calendar actions and lookups · `utils/calendar.ts`
- [Contacts](https://github.com/supermemoryai/apple-mcp/blob/main/utils/contacts.ts): domain adapter · Apple Contacts actions and lookups · `utils/contacts.ts`
- [Maps](https://github.com/supermemoryai/apple-mcp/blob/main/utils/maps.ts): domain adapter · Apple Maps actions and location workflows · `utils/maps.ts`
- [Web search](https://github.com/supermemoryai/apple-mcp/blob/main/utils/web-search.ts): shared helper · Search-oriented helper behavior used by tools · `utils/web-search.ts`

### Testing

Integration test harness and shared test assets

- [Test runner](https://github.com/supermemoryai/apple-mcp/blob/main/test-runner.ts): test orchestration · Runs the integration-focused test suite · `test-runner.ts`
- [Integration tests](https://github.com/supermemoryai/apple-mcp/tree/main/tests/integration): test suite · Domain coverage for calendar, contacts, mail, maps, messages, notes, and reminders · `tests/integration`
- [Test helpers](https://github.com/supermemoryai/apple-mcp/tree/main/tests/helpers): test support · Shared fixtures, data, and utilities for integration tests · `tests/helpers`

### Packaging

Distribution and launch artifacts

- [DXT package](https://github.com/supermemoryai/apple-mcp/blob/main/apple-mcp.dxt): distribution artifact · Desktop distribution package for MCP installation · `apple-mcp.dxt`
- [Manifest](https://github.com/supermemoryai/apple-mcp/blob/main/manifest.json): distribution config · Package metadata and launch configuration · `manifest.json`

## Connections

- MCP client → Server bootstrap: MCP requests · Client connects to the server entrypoint
- Server bootstrap → Tool registry: registers tools · Bootstrap wires server lifecycle to the tool registry
- Tool registry → Messages: dispatches · Routes Messages-related tool calls
- Tool registry → Mail: dispatches · Routes Mail-related tool calls
- Tool registry → Notes: dispatches · Routes Notes-related tool calls
- Tool registry → Reminders: dispatches · Routes Reminders-related tool calls
- Tool registry → Calendar: dispatches · Routes Calendar-related tool calls
- Tool registry → Contacts: dispatches · Routes Contacts-related tool calls
- Tool registry → Maps: dispatches · Routes Maps-related tool calls
- Tool registry → Web search: dispatches · Routes search-oriented helper behavior
- Messages → Chained workflows: supports · Message actions can be part of longer assistant workflows
- Mail → Chained workflows: supports · Mail actions can be chained with search or read steps
- Notes → Chained workflows: supports · Notes actions can feed follow-up actions
- Reminders → Chained workflows: supports · Reminder creation often follows read/search steps
- Calendar → Chained workflows: supports · Calendar lookups can feed scheduling actions
- Contacts → Chained workflows: supports · Contacts lookups can feed message or mail actions
- Maps → Chained workflows: supports · Maps results can feed downstream assistant decisions
- Test runner → Integration tests: executes · Runs the integration suite
- Integration tests → Test helpers: uses · Shared fixtures and utilities support tests
- DXT package → Manifest: described by · Package distribution is defined by the manifest
- Manifest → Server bootstrap: launches · Manifest points the package at the server entrypoint
- DXT package → Server bootstrap: bundles · Desktop package contains the MCP server runtime
