MCP macOS
Sends native macOS system notifications (with title, message, subtitle, sound and group) via AppleScript's display notification, and exposes a clipboard service for reading/writing the macOS clipboard, plus an environment check that verifies the host supports notifications (platform, osascript availability). Includes AppleScript-safe string escaping and in-memory rate limiting.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP macOS send a notification that my build succeeded"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP macOS
A Model Context Protocol (MCP) server that provides macOS system integration capabilities to LLMs via AppleScript. Built with Effect TS for robust error handling and resource management.
Features
π macOS Native Notifications: Uses AppleScript's
display notificationfor system-native notificationsπ‘οΈ Type-Safe & Robust: Built with Effect TS and comprehensive error handling
π Rate Limited: Prevents notification spam with configurable rate limiting (default: 5 per 10 seconds)
ποΈ Reproducible Builds: Uses Nix flakes for reproducible dependency management
π MCP Compliant: Implements the full MCP specification with proper tool definitions
β‘ Single Binary: Compiles to a standalone executable for easy deployment
Related MCP server: Notifications MCP Server
Requirements
macOS: This server only works on macOS systems
Node.js 24+: Required for native TypeScript support
osascript: Must be available in PATH (comes with macOS)
Nix (for building): Install Nix with flakes enabled
Quick Start
Using Nix (Recommended)
# Clone and enter the project
git clone <repository-url>
cd macos-mcp
# Enter development environment
nix develop
# Install dependencies
npm install
# Run in development mode
npm run dev
# Or build and run
nix build
nix runManual Setup
# Install Node.js 24+ and dependencies
npm install
# Run the server directly (no build needed!)
npm start
# Or run TypeScript directly
node --experimental-strip-types src/index.tsTools
notify
Display a native macOS notification.
Input Schema:
{
"title": "string (required)",
"message": "string (required)",
"subtitle": "string (optional)",
"sound": "string (optional)",
"group": "string (optional)"
}Example:
{
"title": "Build Complete",
"message": "Your project built successfully!",
"subtitle": "No errors found",
"sound": "Hero"
}Output:
{
"success": true,
"message": "Notification sent successfully",
"title": "Build Complete",
"subtitle": "No errors found"
}checkEnvironment
Verify the system supports notifications.
Input: None
Output:
{
"environment": {
"ok": true,
"platform": "darwin",
"hasOsascript": true,
"notes": "Environment is ready for notifications"
},
"recommendations": [
"Your system is ready to send notifications"
]
}Integration
Claude Desktop
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"macos-notify": {
"command": "nix",
"args": ["run", "/path/to/macos-mcp#default"]
}
}
}For development (local directory):
{
"mcpServers": {
"macos-notify": {
"command": "nix",
"args": ["run", "."]
}
}
}MCP Inspector
Test the server interactively:
# Install mcp-inspector
npm install -g @modelcontextprotocol/inspector
# Run with Nix
npx @modelcontextprotocol/inspector nix run /path/to/macos-mcp#default
# Or from local directory
npx @modelcontextprotocol/inspector nix run .Configuration
Environment Variables
NOTIFY_MAX_PER_10S: Maximum notifications per 10-second window (default: 5)
Rate Limiting
The server implements in-memory rate limiting to prevent notification spam:
Default: 5 notifications per 10 seconds
Configurable via
NOTIFY_MAX_PER_10Senvironment variableExceeding limits returns structured error responses
Development
Commands
npm run dev # Run in watch mode
npm start # Run the server directly
npm test # Run tests
npm run test:run # Run tests once
npm run typecheck # Type checking (no emission)
npm run lint # Run ESLintProject Structure
src/
βββ index.ts # CLI entrypoint (executable with Node 24)
βββ server.ts # MCP server implementation
βββ services/
β βββ applescript.ts # AppleScript utilities & escaping
β βββ clipboard.ts # Clipboard operations
β βββ notification.ts # NotificationService with Effect
β βββ layer.ts # Effect layers
βββ tools/
β βββ notify.ts # Notify tool handler
β βββ check-env.ts # Environment check tool
β βββ clipboard/ # Clipboard tool handlers
βββ schemas/
β βββ notify.ts # Notification schemas
β βββ clipboard.ts # Clipboard schemas
βββ __tests__/
βββ applescript.test.ts # AppleScript escaping tests
βββ clipboard.test.ts # Clipboard tests
βββ tools.test.ts # Tool integration testsTesting
The project includes comprehensive tests:
Unit tests: AppleScript string escaping with edge cases
Integration tests: MCP tool handlers with mocked services
Manual testing: Instructions for mcp-inspector and Claude Desktop
npm test # Run all tests with VitestNix Development
Build System
This project uses Nix flakes with Node.js 24's native TypeScript support:
Node version: 24 (with
--experimental-strip-typessupport)No build step: TypeScript runs directly without transpilation
Simple packaging: Direct execution of source files
Available Nix Commands
nix develop # Enter development shell
nix build # Build the package
nix run # Run the server
nix flake check # Validate the flakeDevelopment Shell
The nix develop shell provides:
Node.js 24 with native TypeScript support
TypeScript language server for IDE support
Development utilities (jq)
All required development dependencies
Security & Safety
AppleScript Injection Prevention
The server implements robust AppleScript string escaping:
Escapes double quotes (
"β\")Escapes backslashes (
\β\\)Handles newlines and tabs safely
Uses
execFileinstead ofexecfor subprocess safety
Error Handling
All operations use Effect TS for structured error handling:
Type-safe error propagation
Resource cleanup guarantees
Graceful degradation on unsupported platforms
Troubleshooting
Common Issues
"Notifications are only supported on macOS"
This server only works on macOS systems
Other platforms will receive structured error responses
"osascript command not found"
Ensure you're on macOS with Command Line Tools installed
Run:
xcode-select --install
"Rate limit exceeded"
Default limit: 5 notifications per 10 seconds
Adjust with
NOTIFY_MAX_PER_10Senvironment variableWait for the rate limit window to reset
Notifications attributed to "osascript"
This is normal macOS behavior
You may need to allow notifications for Terminal or your MCP client
Go to System Settings β Notifications β [Application]
Debugging
Enable verbose logging:
DEBUG=1 nix run .Test notification manually:
echo '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"notify","arguments":{"title":"Test","message":"Hello World"}},"id":1}' | nix run .License
MIT - see LICENSE file for details.
Contributing
Ensure you have Nix with flakes enabled
Run
nix developto enter the development environmentMake your changes and add tests
Run
npm testto verify everything worksSubmit a pull request
Roadmap
Support for notification actions/buttons
Notification history and management
Custom notification icons
Integration with macOS Focus modes
Batch notification operations
Available Tools
5 toolscheckEnvironmentA
Check if the environment supports macOS notifications
Inputs: no named parameters.
clipboard.clearB
Clear the macOS clipboard
Inputs: no named parameters.
clipboard.copyA
Copy text to the macOS clipboard
Inputs: text (required).
clipboard.pasteA
Get current text from the macOS clipboard
Inputs: no named parameters.
notifyA
Display a macOS notification via AppleScript
Inputs: title (required), message (required), group, sound, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 5 tools
Each tool targets a distinct operation: notification display, environment capability check, and three separate clipboard actions. The only mild ambiguity is clipboard.paste, whose name suggests writing into an app but actually reads the clipboard; the description resolves this.
Three conventions coexist: bare verbs (notify), camelCase (checkEnvironment), and dot-namespaced methods (clipboard.copy/paste/clear). The clipboard group is internally consistent, but the overall set mixes styles.
Five tools is a tight, well-scoped surface for a notifications-plus-clipboard utility. Every tool maps to a concrete capability with no filler.
Clipboard coverage is complete (copy, read, clear), and notifications include a capability probe. Notification handling is thinβno schedule, dismiss, or listβbut that is a minor gap agents can work around.
Maintenance
Related MCP Connectors
Push notifications for AI agents - send instant iPhone notifications from any MCP client.
AI agents and scripts reporting back to your iPhone with Push Notifications and Live Activities.
Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.
Send yourself a push notification from an AI assistant. No account, one environment variable.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables LLM applications to interact with macOS through AppleScript.33397MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to send native macOS notifications for task completion alerts and reminders. Supports interactive features like custom system sounds, action buttons, and user replies directly from the notification center.201 npmMIT
- AlicenseAqualityDmaintenanceEnables Large Language Models to automate macOS applications and execute AppleScript commands through natural language. It features built-in security protections including application allowlists and dangerous pattern detection to prevent unauthorized or risky system operations.21MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to send desktop notifications on macOS with rich formatting, urgency levels, and sound options.111 npm1MIT