Skip to main content
Glama
README.md
# πŸ”Š MCP Make Sound

A Model Context Protocol (MCP) server that provides comprehensive sound playback capabilities for macOS. This server allows AI assistants and other MCP clients to play system sounds, text-to-speech, and custom audio files for rich audio feedback.

<a href="https://glama.ai/mcp/servers/@nocoo/mcp-make-sound">
  <img width="380" height="200" src="https://glama.ai/mcp/servers/@nocoo/mcp-make-sound/badge" alt="Make Sound MCP server" />
</a>

## ✨ Features

- **πŸ”” Simple Sound Methods**: Pre-configured info, warning, and error sounds
- **🎡 Custom System Sounds**: Play any of the 14 built-in macOS sounds
- **πŸ—£οΈ Text-to-Speech**: Convert text to speech with customizable voices
- **πŸ“ File Playback**: Play custom audio files from disk
- πŸš€ Built with TypeScript and the MCP SDK
- πŸͺΆ Lightweight and easy to integrate

## πŸ“‹ Requirements

- 🍎 macOS (uses `afplay` and system sounds)
- 🟒 Node.js 18+ 
- πŸ“ TypeScript

## πŸš€ Installation

1. Clone this repository:
```bash
git clone <repository-url>
cd mcp-make-sound
```

2. Install dependencies:
```bash
npm install
```

3. Build the project:
```bash
npm run build
```

## πŸ’‘ Usage

### 🎡 Running the Server

Start the MCP server:
```bash
npm start
```

For development with auto-reload:
```bash
npm run dev
```

### 🎯 Example: Claude Integration with Warp Terminal

Here's how you can set up the MCP sound server to provide audio feedback when AI tasks complete in Warp terminal:

**Configuration Rule:**
"When AI is done, use mcp-make-sound to play a sound. The MCP supports error, info and success. Play the right sound based on AI task outcome."

This setup allows you to:
- πŸ”” Hear a pleasant chime when tasks complete successfully
- ⚠️ Get an alert sound for warnings or partial completions  
- ❌ Receive clear audio feedback for errors or failures

The audio feedback helps you stay focused on other work while knowing immediately when your AI assistant has finished processing your requests.

### πŸ› οΈ Available Tools

The server provides four tools:

#### Simple Sound Methods (Legacy)

#### `play_info_sound`
- **Description**: Play an informational system sound
- **Parameters**: None
- **Sound**: Glass.aiff

#### `play_warning_sound`
- **Description**: Play a warning system sound  
- **Parameters**: None
- **Sound**: Purr.aiff

#### `play_error_sound`
- **Description**: Play an error system sound
- **Parameters**: None
- **Sound**: Sosumi.aiff

#### Advanced Sound Method

#### `play_sound`
- **Description**: Play various types of sounds with customizable parameters
- **Parameters**: 
  - `type` (required): `"system"`, `"tts"`, or `"file"`
  - Additional based on type (see examples below)

### πŸ“– Usage Examples

#### System Sounds
Play any of the 14 built-in macOS sounds:

```json
{
  "name": "play_sound",
  "arguments": {
    "type": "system",
    "name": "Basso"
  }
}
```

**Available system sounds:**
`Basso`, `Blow`, `Bottle`, `Frog`, `Funk`, `Glass`, `Hero`, `Morse`, `Ping`, `Pop`, `Purr`, `Sosumi`, `Submarine`, `Tink`

#### Text-to-Speech
Convert text to speech with optional voice selection:

```json
{
  "name": "play_sound",
  "arguments": {
    "type": "tts",
    "text": "Hello, this is a test message",
    "voice": "Albert"
  }
}
```

Without voice (uses system default):
```json
{
  "name": "play_sound",
  "arguments": {
    "type": "tts",
    "text": "Task completed successfully"
  }
}
```

**Supported voices:**
- **English**: `Albert`, `Alice`, `Bad News`, `Bahh`, `Bells`, `Boing`, `Bruce`, `Bubbles`, `Cellos`, `Daniel`, `Deranged`, `Fred`, `Good News`, `Hysterical`, `Junior`, `Kathy`, `Pipe Organ`, `Princess`, `Ralph`, `Trinoids`, `Whisper`, `Zarvox`
- **International**: `Anna`, `AmΓ©lie`, `Daria`, `Eddy`, `Fiona`, `Jorge`, `Juan`, `Luca`, `Marie`, `Moira`, `Nora`, `Rishi`, `Samantha`, `Serena`, `Tessa`, `Thomas`, `Veena`, `Victoria`, `Xander`, `Yelda`, `Zosia`

**Note**: If an unsupported voice is specified, the system will gracefully fall back to the default voice and continue playback.

#### Custom Audio Files
Play audio files from disk:

```json
{
  "name": "play_sound",
  "arguments": {
    "type": "file",
    "path": "/Users/username/Music/notification.mp3"
  }
}
```

Supports common audio formats: `.aiff`, `.wav`, `.mp3`, `.m4a`, etc.

### πŸ”’ Security & Limitations

- **System Sounds**: Only the 14 official macOS sounds are allowed
- **Text-to-Speech**: 
  - Text limited to 1000 characters maximum
  - Voice validation with graceful fallback to system default
  - Curated list of 43+ supported voices for security
- **File Playback**: Requires absolute paths and validates file existence

### πŸ”— Integration with MCP Clients

This server can be integrated with any MCP-compatible client, such as:
- πŸ€– Claude Desktop
- πŸ› οΈ Custom MCP clients
- 🧠 AI assistants that support MCP

#### MCP Configuration Example

Add this to your MCP client configuration:

```json
{
  "mcp-make-sound": {
    "command": "node",
    "args": [
      "/Users/nocoo/Workspace/mcp-make-sound/dist/index.js"
    ],
    "env": {},
    "working_directory": "/Users/nocoo/Workspace/mcp-make-sound",
    "start_on_launch": true
  }
}
```

Example tool calls:
```json
{
  "name": "play_info_sound",
  "arguments": {}
}
```

```json
{
  "name": "play_sound",
  "arguments": {
    "type": "system",
    "name": "Hero"
  }
}
```

## πŸ› οΈ Development

### πŸ“ Project Structure

```
mcp-make-sound/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts          # Main server implementation
β”‚   └── __tests__/        # Unit tests
β”‚       └── sound.test.ts # Sound system tests
β”œβ”€β”€ dist/                 # Compiled JavaScript output
β”œβ”€β”€ eslint.config.js      # ESLint configuration
β”œβ”€β”€ vitest.config.ts      # Vitest test configuration
β”œβ”€β”€ package.json          # Project configuration
β”œβ”€β”€ tsconfig.json         # TypeScript configuration
└── README.md            # This file
```

### πŸ“œ Scripts

#### Build & Run
- `npm run build` - πŸ”¨ Compile TypeScript to JavaScript
- `npm start` - ▢️ Run the compiled server
- `npm run dev` - πŸ”„ Development mode with auto-rebuild and restart
- `npm run kill` - πŸ›‘ Stop all running MCP server instances

#### Code Quality & Testing
- `npm run lint` - πŸ” Check code style and errors
- `npm run lint:fix` - πŸ”§ Fix auto-fixable linting issues
- `npm run test` - πŸ§ͺ Run tests in watch mode
- `npm run test:run` - βœ… Run tests once
- `npm run test:ui` - πŸŽ›οΈ Run tests with interactive UI

### βš™οΈ How It Works

1. The server implements the MCP protocol using the official SDK
2. It exposes four tools for different sound capabilities
3. When a tool is called, it uses macOS commands:
   - `afplay` for audio file playback (system sounds and custom files)
   - `say` for text-to-speech synthesis
4. System sounds are located in `/System/Library/Sounds/`
5. The server communicates over stdio transport

## πŸ”§ Technical Details

- **πŸ”Œ Transport**: Standard I/O (stdio)
- **πŸ“‘ Protocol**: Model Context Protocol (MCP)
- **🎧 Audio Backend**: macOS `afplay` and `say` commands
- **🎡 Sound Files**: System .aiff files, custom audio files, and synthesized speech

## 🚨 Error Handling

The server includes comprehensive error handling:
- Validates tool names and parameters
- Handles `afplay` and `say` command failures
- Validates required parameters for each sound type
- Returns appropriate error messages to clients
- Graceful server shutdown on errors

## πŸ“„ License

MIT License

## 🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## 🎼 Sound Capabilities

### Simple Methods (Legacy)
- **πŸ”” Info**: Glass.aiff - A pleasant chime sound
- **⚠️ Warning**: Purr.aiff - A gentle alert sound  
- **❌ Error**: Sosumi.aiff - A distinctive error sound

### Advanced Method (play_sound)
- **🎡 14 System Sounds**: All built-in macOS sounds available
- **πŸ—£οΈ 50+ TTS Voices**: Multiple languages and character voices
- **πŸ“ Custom Files**: Support for .aiff, .wav, .mp3, .m4a, and more

These capabilities provide rich audio feedback options for any application need.

TDQS

C2.9/5.0

Scored across 4 tools

Disambiguation2/5

The tool set has significant ambiguity, as 'play_sound' appears to be a general-purpose tool that can handle what the three specific tools (error, info, warning) do, making it unclear when to choose one over the other. This overlap could easily lead to misselection by agents, as the specific tools seem redundant given the customizable 'play_sound'.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with 'play_' as the prefix, using snake_case throughout. This predictability makes it easy for agents to parse and understand the naming conventions without confusion.

Tool Count3/5

With 4 tools, the count is borderline for the server's purpose of playing sounds. It feels slightly thin, as the domain might benefit from more specific or varied sound operations, but it's not extreme. The tools cover basic sound types, though the overlap reduces the effective utility of having four separate tools.

Completeness3/5

The tool set covers basic sound playback for error, info, warning, and customizable sounds, which aligns with the server's name 'Make Sound'. However, there are notable gaps, such as missing operations like listing available sounds, stopping sounds, or adjusting volume, which could limit agent workflows in more complex scenarios.

Maintenance

ActivityInactive
ResponsivenessNo issues