
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
mcp-desktop-notification
Advanced tools
A desktop notification server that can work either as an MCP (Model Context Protocol) server and a Claude Code hook processor. Send desktop notifications with sound alerts from your AI assistants or command line.
# Install globally from npm
npm install -g mcp-desktop-notification
# Or use directly with npx (no installation needed)
npx mcp-desktop-notification --title "Hello" --message "World"
# Clone the repository
git clone https://github.com/franz-see/mcp-desktop-notification
cd mcp-desktop-notification
# Install dependencies
npm install
# Build the project
npm run build
Send notifications directly from the terminal:
# Basic notification
npx mcp-desktop-notification --title "Build Complete" --message "Your project has been built successfully"
# With custom sound
npx mcp-desktop-notification --title "Alert" --message "Important notification" --sound beep
# With icon (path to image file)
npx mcp-desktop-notification --title "Info" --message "Check this out" --icon /path/to/icon.png
-t, --title <title>
- Notification title (required)-m, --message <message>
- Notification message (required)-i, --icon <icon>
- Path to icon file (optional)-s, --sound <sound>
- Sound to play (optional):
beep
or system
- System beep soundbeep:frequency
- Beep with specific frequency/path/to/audio.mp3
- Custom audio file@sound.mp3
)--verbose
- Show debug outputUse as an MCP server for AI assistants like Claude Desktop.
claude_desktop_config.json
:{
"mcpServers": {
"desktop-notification": {
"command": "npx",
"args": ["mcp-desktop-notification", "--server"],
"env": {}
}
}
}
Once configured, Claude will have access to the send_notification
tool:
send_notification({
title: "Task Complete",
message: "The requested operation has finished successfully"
})
The tool will:
You can ask Claude to:
Integrate with Claude Code to receive notifications for various events during your coding session.
# For specific events
npx mcp-desktop-notification --claude-hook
# With verbose output for debugging
npx mcp-desktop-notification --claude-hook --verbose
The notification server handles these Claude Code events:
Event | Notification Title | Description |
---|---|---|
PreToolUse | [PreToolUse] Claude Code: [Tool Name] | Before a tool executes |
PostToolUse | [PostToolUse] ✓ [Tool Name] Completed | After a tool finishes |
UserPromptSubmit | [UserPromptSubmit] Claude Code | When you submit a prompt |
Notification | [Notification] Claude Code Notification | Custom notifications |
Stop | [Stop] Claude Code | Response completed |
SubagentStop | [SubAgentStop] Claude Code Subagent | Subagent task completed |
SessionStart | [SessionStart] Claude Code Session | New session started |
SessionEnd | [SessionEnd] Claude Code Session | Session ended |
PreCompact | Claude Code | Context compaction starting |
In your Claude Code settings or configuration file:
{
"hooks": {
"PostToolUse": "npx mcp-desktop-notification --claude-hook",
"UserPromptSubmit": "npx mcp-desktop-notification --claude-hook",
"Stop": "npx mcp-desktop-notification --claude-hook"
}
}
You can test the hook processor manually:
# Test PostToolUse event
echo '{"hook_event_name":"PostToolUse","tool_name":"Bash"}' | npx mcp-desktop-notification --claude-hook
# Test with verbose output
echo '{"hook_event_name":"UserPromptSubmit","prompt":"Test prompt"}' | npx mcp-desktop-notification --claude-hook --verbose
# Test notification event
echo '{"hook_event_name":"Notification","message":"Custom message"}' | npx mcp-desktop-notification --claude-hook
By default, all notifications use @sound.mp3
which:
assets/sound.mp3
fileYou can specify custom sounds:
# System beep
--sound beep
# Custom audio file
--sound /path/to/notification.mp3
# Platform-specific system sounds
--sound system
For custom sounds, use the --sound
parameter with a path to your audio file:
# Use your custom sound file
npx mcp-desktop-notification --title "Alert" --message "Custom sound" --sound ~/my-notification-sound.mp3
mcp-desktop-notification/
├── src/
│ ├── index.ts # Main entry point
│ ├── types.ts # TypeScript interfaces
│ ├── notification.ts # Notification handling
│ ├── sound.ts # Sound playback logic
│ ├── claude-hook.ts # Claude hook processor
│ ├── claude-hook.test.ts # Tests for Claude hook processor
│ └── mcp-server.ts # MCP server implementation
├── assets/
│ └── sound.mp3 # Default notification sound
├── dist/ # Compiled JavaScript
├── package.json
├── tsconfig.json
├── jest.config.js # Jest test configuration
└── README.md
# Build TypeScript to JavaScript
npm run build
# Run in development mode (using tsx)
npm run dev -- --title "Dev" --message "Test"
# Run MCP server in development
npm run server
# Run Claude hook processor in development
npm run claude-hook
# Start compiled version
npm start -- --title "Test" --message "Hello"
# Run tests
npm test
Test all three modes:
# 1. Test CLI mode
npx mcp-desktop-notification --title "CLI Test" --message "Testing CLI mode"
# 2. Test MCP server (starts server, use Ctrl+C to stop)
npx mcp-desktop-notification --server
# 3. Test Claude hook
echo '{"hook_event_name":"PostToolUse","tool_name":"TestTool"}' | npx mcp-desktop-notification --claude-hook
afplay
for audio playback/System/Library/Sounds/Glass.aiff
node-notifier
paplay
, aplay
, mpg123
, ffplay
[console]::beep()
node-notifier
notify-osd
, dunst
, etc.)ls assets/sound.mp3
--sound beep
npm run server
--verbose
flag to see debug outputnpm login
Update version number in package.json
:
npm version patch # for bug fixes
npm version minor # for new features
npm version major # for breaking changes
Build the project:
npm run build
Run tests to ensure everything works:
npm test
Publish to npm:
npm publish --access public
If the package name is already taken, you'll need to either:
package.json
@yourusername/mcp-desktop-notification
For scoped packages:
npm publish --access public # Required for first publish of scoped packages
After publishing, verify your package is available:
npm view mcp-desktop-notification
# Test installation
npx mcp-desktop-notification --title "Test" --message "Package published!"
Contributions are welcome! Please feel free to submit issues or pull requests.
ISC
Built with:
Note: This tool requires appropriate permissions for desktop notifications and audio playback on your system. Make sure to grant necessary permissions when prompted.
FAQs
MCP Desktop Notification Server in TypeScript
The npm package mcp-desktop-notification receives a total of 31 weekly downloads. As such, mcp-desktop-notification popularity was classified as not popular.
We found that mcp-desktop-notification demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.