Skip to main content
Glama
yuki-yano

macOS Notify MCP

by yuki-yano

send_notification

Send native macOS notifications with tmux integration to focus specific tmux sessions when clicked, enabling AI assistants to deliver system alerts.

Instructions

Send a macOS notification with optional tmux integration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesThe notification message
titleNoThe notification title (default: "Claude Code")
soundNoThe notification sound (default: "Glass")
sessionNotmux session name
windowNotmux window number
paneNotmux pane number
useCurrentNoUse current tmux location

Implementation Reference

  • MCP tool handler for send_notification: validates inputs, handles tmux current/useCurrent logic, session validation, and calls notifier.sendNotification
    case 'send_notification': {
      // Safely extract properties from args
      const notificationArgs = args as Record<string, unknown>
    
      // Validate message is provided
      if (!notificationArgs.message) {
        throw new Error('Message is required')
      }
    
      const options: NotificationOptions = {
        message: String(notificationArgs.message),
        title: notificationArgs.title
          ? String(notificationArgs.title)
          : undefined,
        sound: notificationArgs.sound
          ? String(notificationArgs.sound)
          : undefined,
      }
    
      if (notificationArgs.useCurrent) {
        const current = await notifier.getCurrentTmuxInfo()
        if (current) {
          options.session = current.session
          options.window = current.window
          options.pane = current.pane
        }
      } else {
        if (notificationArgs.session)
          options.session = String(notificationArgs.session)
        if (notificationArgs.window)
          options.window = String(notificationArgs.window)
        if (notificationArgs.pane)
          options.pane = String(notificationArgs.pane)
      }
    
      // Validate session if specified
      if (options.session) {
        const exists = await notifier.sessionExists(options.session)
        if (!exists) {
          const sessions = await notifier.listSessions()
          return {
            content: [
              {
                type: 'text',
                text: `Error: Session '${options.session}' does not exist. Available sessions: ${sessions.join(', ')}`,
              },
            ],
          }
        }
      }
    
      await notifier.sendNotification(options)
    
      return {
        content: [
          {
            type: 'text',
            text: `Notification sent: "${options.message}"${options.session ? ` (tmux: ${options.session})` : ''}`,
          },
        ],
      }
    }
  • Input schema for the send_notification tool defining parameters and validation rules
    inputSchema: {
      type: 'object',
      properties: {
        message: {
          type: 'string',
          description: 'The notification message',
        },
        title: {
          type: 'string',
          description: 'The notification title (default: "Claude Code")',
        },
        sound: {
          type: 'string',
          description: 'The notification sound (default: "Glass")',
        },
        session: {
          type: 'string',
          description: 'tmux session name',
        },
        window: {
          type: 'string',
          description: 'tmux window number',
        },
        pane: {
          type: 'string',
          description: 'tmux pane number',
        },
        useCurrent: {
          type: 'boolean',
          description: 'Use current tmux location',
        },
      },
      required: ['message'],
    },
  • src/index.ts:45-82 (registration)
    Registration of the send_notification tool in the MCP tools list response
    {
      name: 'send_notification',
      description: 'Send a macOS notification with optional tmux integration',
      inputSchema: {
        type: 'object',
        properties: {
          message: {
            type: 'string',
            description: 'The notification message',
          },
          title: {
            type: 'string',
            description: 'The notification title (default: "Claude Code")',
          },
          sound: {
            type: 'string',
            description: 'The notification sound (default: "Glass")',
          },
          session: {
            type: 'string',
            description: 'tmux session name',
          },
          window: {
            type: 'string',
            description: 'tmux window number',
          },
          pane: {
            type: 'string',
            description: 'tmux pane number',
          },
          useCurrent: {
            type: 'boolean',
            description: 'Use current tmux location',
          },
        },
        required: ['message'],
      },
    },
  • Helper function implementing the actual notification sending logic via MacOSNotifyMCP.app, including terminal detection and tmux targeting
      async sendNotification(options: NotificationOptions): Promise<void> {
        const {
          title = this.defaultTitle,
          message,
          sound = 'Glass',
          session,
          window,
          pane,
        } = options
    
        // Check if app path is valid
        if (!this.appPath) {
          throw new Error('MacOSNotifyMCP.app not found')
        }
    
        // Always detect terminal emulator to pass to notification app
        const terminal = await this.detectTerminalEmulator()
    
        // Use MacOSNotifyMCP.app for notifications
        const args = [
          '-n',
          this.appPath,
          '--args',
          '-t',
          title,
          '-m',
          message,
          '--sound',
          sound,
          '--terminal',
          terminal,
        ]
    
        if (session) {
          args.push('-s', session)
          if (window !== undefined && window !== '') {
            args.push('-w', window)
          }
          if (pane !== undefined && pane !== '') {
            args.push('-p', pane)
          }
        }
    
        await this.runCommand('/usr/bin/open', args)
      }
    }
  • Type definition for NotificationOptions used in the handler
    interface NotificationOptions {
      message: string
      title?: string
      sound?: string
      session?: string
      window?: string
      pane?: string
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool sends notifications and has tmux integration, but doesn't describe what happens when notifications are sent (do they appear immediately? require permissions?), what errors might occur, or any rate limits. The description is minimal and leaves important behavioral aspects unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence that efficiently communicates the core functionality and key feature. Every word earns its place with no wasted text, making it front-loaded and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a notification tool with 7 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what the tool returns, what happens on success/failure, platform requirements (macOS only?), or how the tmux integration actually works. For a tool with this complexity, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly with descriptions and defaults. The description adds no additional parameter information beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('send') and resource ('macOS notification'), and mentions the optional tmux integration feature. However, it doesn't specifically differentiate this tool from its siblings (get_current_tmux_info, list_tmux_sessions), which are query tools while this is a notification tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions 'optional tmux integration' which implies some context for when tmux parameters might be relevant, but provides no explicit guidance about when to use this tool versus alternatives, when not to use it, or what prerequisites might be needed for macOS notifications or tmux integration to work.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yuki-yano/macos-notify-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server