MCP Audio Server

MCP Audio Server

Enables text-to-speech conversion with smart language detection (using Google TTS for Chinese) and audio file playback with playback controls for Claude Desktop.

Category
Visit Server

README

MCP Audio Server πŸ”Š

English | δΈ­ζ–‡

A powerful Model Context Protocol (MCP) server that provides text-to-speech and audio playback capabilities for Claude Desktop and other MCP clients.

✨ Features

  • πŸ—£οΈ High-Quality TTS:
    • Smart Language Detection: Automatically uses Google's TTS for high-quality Chinese speech and falls back to the system's TTS for other languages.
    • Voice Selection: For non-Chinese text, list and select from various system-installed voices.
    • Customizable Speech: Adjust rate and volume for a tailored listening experience.
  • 🎡 Audio File Playback: Play various audio formats (WAV, MP3, OGG, etc.).
  • ⏹️ Audio Control: Stop playback and get real-time audio status.
  • πŸ”Œ MCP Compliant: Fully compatible with Claude Desktop and MCP specification 2024-11-05.
  • πŸ›‘οΈ Error Handling: Robust error handling and validation.
  • πŸ“Š Status Monitoring: Real-time audio system status and playback information.

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • Claude Desktop (for MCP integration)
  • System audio capabilities

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/mcp-audio-server.git
cd mcp-audio-server
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure Claude Desktop: Add to your claude_desktop_config.json:
{
  "mcpServers": {
    "audio-server": {
      "command": "/path/to/your/python",
      "args": ["/path/to/mcp-audio-server/audio_server.py"]
    }
  }
}
  1. Restart Claude Desktop and start using audio features!

πŸ› οΈ Available Tools

Tool Description Parameters
speak_text Convert text to speech. Automatically uses Google TTS for Chinese. text (required), rate (optional), volume (optional), voice_id (optional, for non-Chinese)
list_voices List available TTS voices for non-Chinese languages. None
play_audio_file Play an audio file. file_path (required), volume (optional)
stop_audio Stop current audio playback. None
get_audio_status Get audio system status. None

πŸ“– Usage Examples

Text-to-Speech (Chinese)

"θ―·η”¨θ―­ιŸ³θ―΄ε‡Ί 'δ½ ε₯½οΌŒδΈ–η•Œ'"

This will automatically use Google TTS for a natural-sounding voice.

Text-to-Speech (English, with a specific voice)

  1. First, list available voices:
    "List all available voices"
    
  2. Then, use a specific voice ID from the list:
    "Use the voice with ID 'com.apple.speech.synthesis.voice.daniel' to say 'Hello, this is a test.'"
    

Play Audio File

"Play the audio file at /path/to/music.mp3"

Stop Audio

"Stop the current audio playback"

Check Status

"What's the current audio status?"

πŸ§ͺ Testing

Run the comprehensive test suite:

# Test all MCP methods
python test_all_mcp_methods.py

# Test Claude Desktop format compatibility
python test_claude_desktop_format.py

# Test audio functionality
python test_audio_server.py

# Interactive testing mode
python audio_server.py --interactive

πŸ“ Project Structure

mcp-audio-server/
β”œβ”€β”€ audio_server.py              # Main MCP server
β”œβ”€β”€ requirements.txt             # Python dependencies
β”œβ”€β”€ README.md                   # English documentation (default)
β”œβ”€β”€ README_CN.md                # Chinese documentation
β”œβ”€β”€ .gitignore                  # Git ignore rules
β”œβ”€β”€ tests/                      # Test files
β”‚   β”œβ”€β”€ test_*.py               # Various tests
β”‚   └── validate_*.py           # Validation scripts
β”œβ”€β”€ examples/                   # Configuration examples
β”‚   β”œβ”€β”€ claude_desktop_config.json
β”‚   └── other config files
β”œβ”€β”€ scripts/                    # Utility scripts
β”‚   β”œβ”€β”€ install_and_setup.sh
β”‚   └── other shell scripts
└── docs/                       # Additional documentation
    β”œβ”€β”€ INTEGRATION_GUIDE.md    # Integration guide
    β”œβ”€β”€ USAGE_GUIDE.md          # Usage guide
    └── FINAL_INTEGRATION_REPORT.md

πŸ”§ Configuration

Claude Desktop Configuration

The server integrates seamlessly with Claude Desktop. Make sure your configuration file is properly set up:

Location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Example configuration:

{
  "mcpServers": {
    "audio-server": {
      "command": "/Users/yourusername/miniconda3/envs/mcp_agent/bin/python",
      "args": ["/path/to/mcp-audio-server/audio_server.py"]
    }
  }
}

πŸ› Troubleshooting

Common Issues

  1. Audio not playing: Check system audio settings and permissions
  2. TTS not working: Ensure pyttsx3 is properly installed
  3. MCP connection issues: Verify Claude Desktop configuration path
  4. Permission errors: Check file permissions for audio files

Debug Mode

Run in interactive mode for debugging:

python audio_server.py --interactive

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built with the Model Context Protocol (MCP)
  • Uses pyttsx3 for text-to-speech
  • Uses pygame for audio playback
  • Compatible with Claude Desktop

πŸ“ž Support

If you encounter any issues or have questions:

  1. Check the troubleshooting section
  2. Review the integration guide
  3. Open an issue on GitHub
  4. Check Claude Desktop documentation

Made with ❀️ for the MCP community

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured