Allows detection of Alacritty terminal emulator and focus targeting for notifications, supporting tmux session navigation when clicked
Provides detection and focus targeting for iTerm2, allowing notifications to navigate to specific tmux sessions, windows, and panes
Sends native macOS notifications using the UserNotifications API with customizable sounds and click actions
Uses Node.js as the runtime environment for the MCP server functionality
Employs Swift for the native macOS application component that handles notifications and terminal focusing
Offers deep integration with tmux, allowing navigation to specific sessions, windows, and panes through clickable notifications
Implements the MCP server using TypeScript for the command-line interface and tmux session management
macOS Notify MCP
A Model Context Protocol (MCP) server for macOS notifications with tmux integration. This tool allows AI assistants like Claude to send native macOS notifications that can focus specific tmux sessions when clicked.
Features
- 🔔 Native macOS notifications using UserNotifications API
- 🖱️ Clickable notifications that focus tmux sessions
- 🎯 Direct navigation to specific tmux session, window, and pane
- 🔊 Customizable notification sounds
- 🚀 Support for multiple concurrent notifications
- 🤖 MCP server for AI assistant integration
- 🖥️ Terminal emulator detection (VSCode, Cursor, iTerm2, Terminal.app)
Installation
Prerequisites
- macOS (required for notifications)
- Node.js >= 18.0.0
- tmux (optional, for tmux integration)
Install from npm
Build from source
Usage
As MCP Server
First, install the package globally:
Quick Setup with Claude Code
Use the claude mcp add
command:
Then restart Claude Code.
Manual Setup for Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json
:
Available MCP Tools
send_notification
- Send a macOS notificationmessage
(required): Notification messagetitle
: Notification title (default: "Claude Code")sound
: Notification sound (default: "Glass")session
: tmux session namewindow
: tmux window numberpane
: tmux pane numberuseCurrent
: Use current tmux location
list_tmux_sessions
- List available tmux sessionsget_current_tmux_info
- Get current tmux session information
As CLI Tool
Terminal Detection
The tool automatically detects which terminal emulator you're using and uses this information when you click on notifications to focus the correct application. You can test terminal detection with:
Supported Terminal Detection
The tool detects terminals using various methods:
- Cursor: Via
CURSOR_TRACE_ID
environment variable - VSCode: Via
VSCODE_IPC_HOOK_CLI
orVSCODE_REMOTE
environment variables - alacritty: Via
ALACRITTY_WINDOW_ID
orALACRITTY_SOCKET
environment variables - iTerm2: Via
TERM_PROGRAM=iTerm.app
- Terminal.app: Via
TERM_PROGRAM=Apple_Terminal
Terminal Detection in tmux
When running inside tmux, the tool attempts to detect which terminal emulator the active tmux client is using:
- Active Client Detection: Identifies the most recently active tmux client
- TTY Process Analysis: Traces processes using the client's TTY
- Environment Preservation: Checks preserved environment variables
- Process Tree Fallback: Analyzes the process tree as a last resort
For advanced tmux client tracking, see examples/tmux-client-tracking.sh
.
How it Works
- Notification Delivery: Uses a native macOS app bundle (MacOSNotifyMCP.app) to send UserNotifications API notifications
- Click Handling: When a notification is clicked, the app activates the detected terminal emulator (VSCode, Cursor, iTerm2, alacritty, or Terminal.app) and switches to the specified tmux session
- Terminal Support: Automatically detects and activates the correct terminal application
- Multiple Instances: Each notification runs as a separate process, allowing multiple concurrent notifications
Architecture
The project consists of two main components:
- MCP Server/CLI (TypeScript/Node.js)
- Implements the Model Context Protocol
- Provides a command-line interface
- Manages tmux session detection and validation
- MacOSNotifyMCP.app (Swift/macOS)
- Native macOS application for notifications
- Handles notification clicks to focus tmux sessions
- Runs as a background process for each notification
MacOSNotifyMCP.app
The MacOSNotifyMCP.app is bundled with the npm package and is automatically available after installation. No additional setup is required.
Troubleshooting
Notifications not appearing
- Check System Settings → Notifications → MacOSNotifyMCP
- Ensure notifications are allowed
- Run
macos-notify-mcp -m "test"
to verify
tmux integration not working
- Ensure tmux is installed and running
- Check session names with
macos-notify-mcp --list-sessions
- Verify terminal app is supported (Alacritty, iTerm2, WezTerm, or Terminal)
Development
License
MIT
Author
Yuki Yano
An MCP server that enables AI assistants like Claude to send native macOS notifications with tmux integration, allowing notifications to focus specific tmux sessions when clicked.
Related MCP Servers
- -securityFlicense-qualityAn MCP server that allows AI assistants like Claude to execute terminal commands on the user's computer and return the output, functioning like a terminal through AI.Last updated -38Python
- -securityAlicense-qualityAn MCP server that enables AI assistants like Claude to help users manage their GitHub notifications through natural language commands.Last updated -5511TypeScriptMIT License
- -securityAlicense-qualityAn MCP server that enables AI assistants like Claude to access and manipulate Apple Notes on macOS, allowing for retrieving, creating, and managing notes through natural language interactions.Last updated -60TypeScriptMIT License
- AsecurityAlicenseAqualityAn MCP server that allows AI assistants like Claude Code, Claude Desktop, and Cursor to interact with Things.app on macOS, enabling task creation, updates, viewing, scheduling, and organization through natural language.Last updated -6541TypeScriptMIT License