SDK source code examples

Source code for every open-source app built with the SDK

Each one has a README with copy-paste setup. Pick the closest one and start from it. Terms: see the glossary.

ExampleStart here if you want…
repo-qa to connect to an MCP server you don't control — the smallest example, a CLI, no signing or permissions.
plate-today / -tools connectors (Calendar, Reminders) plus an OAuth-gated MCP server (Todoist) in a signed SwiftUI app — the same app on the hand-written and ready-made tool-calling paths, to diff.
workspace-buddy to give the model scoped access to a folder of files under App Sandbox — Core’s workspace tools plus the security-scoped-bookmark pattern.
components-demo to drop in the prebuilt SwiftUI MCP-server management UI instead of wiring one connection yourself.
repo-qa-local the smallest "download and run an open-weight model" — repo-qa with an MLX model instead of Apple's, about 30 lines different, including the pin.
code-buddy the full model-layer pattern: a CLI coding agent with .heavy / .light routes to two local models, Workspace + host Process tools, an MCP docs server, and a persistent >> session.
workspace-buddy-local a sandboxed GUI app running a downloaded model — the Mac App Store shape, model download working inside the App Sandbox container.
model-switch hosted providers — GPT / Claude's online API / OpenRouter and on-device behind one chat call site, with provider-run web search and citations.
mcp-chat a chat app with a local model where an MCP server's own interactive views (MCP Apps) show up in the conversation — Todoist's task list for “what's due today?” — with streaming, per-server trust and approval, and conversations that reopen.
jevdk to design and test decision-model questions: run them on a local MLX model and on hosted Jev side by side, score a batch against your marked answers, calibrate, compare models, and export the tested questions for your app (decision models, JevDK guide).
jev-serve to serve hosted Jev’s HTTP API from your Mac with OpenJev, so code written for hosted Jev runs locally. It comes with the JevDK download; source and releases are in the JevDK repo.
security-demo to see the security/authorization layer in isolation — a frontier model against Calendar and a Todoist MCP server, gated by nothing but a Security panel.
aiql plain-English → one read-only SQL SELECT → CSV over an MCP dataset; rows never enter the model's context, so nothing is fabricated.
vistanova a small search engine on local models and an MCP server (Tavily), with the MLX summary model pinned to an exact commit so an upstream change never silently changes what your app runs.
answersearch-oss an online AI provider as a search engine: a menu-bar app that gets sourced answers from Claude or OpenAI web search with the user’s own key, and uses Apple’s on-device model for simple questions. It lives in its own repository and is built on SDK 2.3, not yet 3.0.
mlx-control-room every MLX knob with a gauge that proves it changed something, plus the supply-chain flow made visible: validate, download, pin, update, roll back, clean up, and speed-helper / adapter pairing.
components-updates-demo the Components onboarding, update and versions-on-disk views, driven by simulated sources so every state (a denied preflight, a failed update, a rollback) is reachable.
os-matrix one .macOS("26.0") build that runs on both macOS 26 and 27, with the 27-only model families gated by ModelAvailability.requiresOS — no source #if.

annotated-examples.md walks the examples in the SDK repository line by line, with SDK touchpoints marked inline. Back to the SDK overview.