mac-control-mcp: Instructions file for Claude Code

CLAUDE.md

mac-control-mcp CLAUDE.md is an instructions file for Claude Code from AdelElo13/mac-control-mcp. It costs 806 tokens per session, scanned A, original, MIT.

Project instructions for a native macOS server that lets coding agents control apps and system features through macOS interfaces. It covers a Swift project, its structure, and how to build and test it.

In plain words
What is it for?
Use it when developing, building, testing, or debugging the macOS control server and its features for windows, menus, Apple apps, hardware, and system information.
Why use it?
It gives an agent the project background and the commands needed to work on the code safely. This reduces confusion when changing or checking the server.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is AdelElo13/mac-control-mcp's own configuration. It tells Claude Code how to work on mac-control-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mac-control-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to AdelElo13/mac-control-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/AdelElo13/mac-control-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/AdelElo13/mac-control-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mac-control-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/adelelo13/mac-control-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/adelelo13/mac-control-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/adelelo13/mac-control-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/adelelo13/mac-control-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mac-control-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/adelelo13/mac-control-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/adelelo13/mac-control-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 806 This file is loaded in full into every session.
When invoked 806 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00806 $0.00806
Opus 5.5 $0.00322 $0.00322
Sonnet 5.5 $0.00161 $0.00161
Haiku 4.5 $0.00081 $0.00081

Measured 2mo ago against content hash 66f7f0684b30, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mac-control-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 62 lines

How it starts

The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Project: mac-control-mcp

Context

  • What this builds: Native macOS MCP server (Model Context Protocol) for controlling macOS via Accessibility API, AppleScript, and system frameworks
  • Stack: Swift 6, Swift Package Manager, macOS 14+, AX API (ApplicationServices), AppKit, EventKit, Contacts, CoreLocation, AVFoundation
  • Platform: macOS
  • Phase: Active development / production (v0.8.x)
  • Repo: AdelElo13/mac-control-mcp (public on GitHub)
  • Binary: .build/debug/mac-control-mcp (debug), .build/release/mac-control-mcp (release)

Build

swift build           # debug
swift build -c release # release (for shipping/notarization)
swift test            # run test suite

Architecture

  • Sources/MacControlMCP/ — all source files
    • Tools.swift — main dispatch router + tool registry
    • Tools+V2.swift, Tools+V2Phase*.swift — tool definitions split by phase
    • *Controller.swift — domain controllers (Accessibility, Window, Menu, etc.)
    • AppleAppsController.swift — Messages, Mail, Calendar, Reminders, Contacts
    • SystemInfoController.swift — disk, battery, network, bluetooth, system load
    • HardwareController.swift — brightness, volume, night shift
  • Tests/ — unit + integration tests
  • TestHarness/ — manual test scripts

Tool routing rules

Task Use
macOS UI automation AX API via AccessibilityController
Contacts lookup CNContactStore (NOT AppleScript — Contacts.app may not be running)
Calendar/Reminders EventKit directly
Browser control BrowserController (AppleScript fallback)
Disk/system info SystemInfoController via df -k -P (KB → GB conversion applied)

Known pitfalls

  • df -g on macOS does NOT reliably return GB values — always use df -k and divide by 1024² to get real GB
  • list_menu_titles defaults to frontmost app when pid is omitted — no need to call focused_app first
  • AppleScript tell application "Contacts" fails with -600 when Contacts.app isn't running — use CNContactStore instead
  • parsePID(nil) returns nil same as an invalid pid — check arguments["pid"] == nil to distinguish "not provided" from "invalid"
  • Always wrap framework imports in #if canImport(...) guards (EventKit, Contacts, CoreLocation not available on all platforms)
  • list_windows is NOT a reliable process-liveness probe: its CG fallback can report a residual window-server entry (count:1, minimized:true, empty title) for a window that is already closed. To detect a windowless zombie, walk the AX tree (get_ui_tree) and require an AXWindow node — a zombie exposes only a childless AXApplication root (2026-07-06, ControlZoo pid 19604/38320)

Read the full file on GitHub · 62 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 62 lines · 806 tokens per session scan A 66f7f0684b30

Subscribe to this mod's changes

mac-control-mcp CLAUDE.md is an instructions file published in the GitHub repository AdelElo13/mac-control-mcp (18 stars, last pushed 26d ago), licensed MIT. It adds 806 tokens to every session, about $0.0032 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

mac-control-mcp CLAUDE.md compared with instructions from other repositories

mac-control-mcp CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mac-control-mcp CLAUDE.mdAdelElo13/mac-control-mcpInstructions file1826d agoMITA806Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot