Skip to content

bramato/talkToMeDearAi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TalkToMeDearAi

npm version npm downloads npm total downloads license GitHub stars GitHub issues Node.js Version TypeScript

An MCP (Model Context Protocol) server for text-to-speech synthesis using the OpenAI TTS API, designed to provide audio notifications for AI agents.

πŸ“¦ Package Available: This package is available on npm as talktomedearai - an MCP server for text-to-speech synthesis with intelligent caching.

🎯 Overview

TalkToMeDearAi is a specialized MCP server that allows AI agents to convert text to audio using OpenAI's text-to-speech models. The system includes an intelligent cache system to avoid duplicate API calls and reduce costs.

✨ Key Features

  • OpenAI Voice Synthesis: Uses OpenAI's best TTS models for superior audio quality
  • Intelligent MP3 Cache: Automatically saves generated audio for future reuse
  • Global Installation: Can be installed globally and used by multiple projects
  • MCP Integration: Compatible with Claude Code, Cursor, and other MCP clients
  • Agent Notifications: Perfect for audio notifications on process completion
  • Simple Configuration: Guided setup for OpenAI API keys

πŸš€ Quick Installation

# Global installation
npm install -g talktomedearai

# OpenAI API keys configuration
talktomedearai setup

πŸ“‹ Requirements

  • Node.js >= 18.0.0
  • OpenAI API key with access to TTS models
  • Operating system: macOS, Linux, Windows

πŸ› οΈ Usage

As MCP Server

Add to your MCP configuration file:

{
  "mcpServers": {
    "talktomedearai": {
      "command": "talktomedearai",
      "args": ["serve"]
    }
  }
}

Available Tools

speak_text

Converts text to audio and plays or saves it

Parameters:

  • text (string, required): The text to convert to audio
  • voice (string, optional): Voice to use (alloy, echo, fable, onyx, nova, shimmer)
  • model (string, optional): TTS model (tts-1, tts-1-hd)
  • save_only (boolean, optional): If true, only saves without playing
  • output_path (string, optional): Custom path to save the file

Example:

await mcp.callTool("speak_text", {
  text: "Process completed successfully!",
  voice: "alloy",
  model: "tts-1-hd"
});

start_notification

Plays a predefined energetic audio notification to indicate the start of a process

Uses file: sounds/start.mp3 (customizable by replacing the file)

Parameters:

  • save_only (boolean, optional): If true, only saves without playing

Example:

await mcp.callTool("start_notification", {});

alert_notification

Plays a predefined attention-grabbing audio notification to signal important warnings

Uses file: sounds/alert.mp3 (customizable by replacing the file)

Parameters:

  • save_only (boolean, optional): If true, only saves without playing

Example:

await mcp.callTool("alert_notification", {});

finish_notification

Plays a predefined satisfying audio notification to indicate process completion

Uses file: sounds/finish.mp3 (customizable by replacing the file)

Parameters:

  • save_only (boolean, optional): If true, only saves without playing

Example:

await mcp.callTool("finish_notification", {});

πŸ”Š Sound Customization

To customize notification sounds, simply replace the files in the sounds/ directory:

# In project directory or global package
sounds/
β”œβ”€β”€ start.mp3   # Start sound
β”œβ”€β”€ alert.mp3   # Alert sound
└── finish.mp3  # Completion sound

The tools search first in the local project directory, then in the global package installation directory.

πŸ“ Project Structure

talktomedearai/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ server.ts          # Main MCP server
β”‚   β”œβ”€β”€ tts/
β”‚   β”‚   β”œβ”€β”€ client.ts      # OpenAI TTS client
β”‚   β”‚   └── cache.ts       # MP3 cache system
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── setup.ts       # API keys configuration
β”‚   └── tools/
β”‚       └── speak.ts       # Speech synthesis tool
β”œβ”€β”€ dist/                  # Build output
β”œβ”€β”€ cache/                 # MP3 cache files
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

πŸ—ΊοΈ Roadmap

For detailed information on upcoming developments, see the ROADMAP.

🀝 IDE Integration

Claude Code

Complete guide: πŸ“˜ Claude Code Integration

  1. npm install -g talktomedearai && talktomedearai setup
  2. Add MCP configuration
  3. Restart Claude Code
  4. Use the speak_text tool in your agents

Cursor

Complete guide: πŸ“˜ Cursor Integration

  1. npm install -g talktomedearai && talktomedearai setup
  2. Configure MCP settings
  3. Integrate with build scripts and development workflow
  4. Receive voice notifications during development

πŸ”§ Advanced Configuration

Cache Settings

# Set maximum cache size (MB)
talktomedearai config --cache-size 500

# Set cache duration (days)
talktomedearai config --cache-duration 30

# Clear cache
talktomedearai cache clear

Voice Models

The system supports all OpenAI TTS models:

  • tts-1: Fast and efficient
  • tts-1-hd: High audio quality

Available Voices

  • alloy: Neutral and balanced
  • echo: Male and clear
  • fable: Expressive and dramatic
  • onyx: Deep and authoritative
  • nova: Young and energetic
  • shimmer: Sweet and melodious

πŸ“Š Cache Management

The cache system automatically saves all generated audio files with hash based on:

  • Text content
  • Selected voice
  • Used model

This ensures immediate reuse for identical texts and drastically reduces API costs.

πŸ› Troubleshooting

Common Issues

  1. "API Key not configured"

    talktomedearai setup
  2. "Cannot play audio"

    • Verify that the system has an audio player configured
    • On Linux you might need to install sox or aplay
  3. "Cache full"

    talktomedearai cache clean --older-than 7d

πŸ” Security

  • API keys are stored securely in the system keychain
  • Cache files are stored locally and not shared
  • All audio data is processed locally after download

πŸ“ˆ Performance

  • Typical cache hit rate: 85-95%
  • API cost reduction: up to 90%
  • Cache response time: <50ms
  • OpenAI API latency: 1-3 seconds

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

MIT License - see LICENSE for details.

πŸ†˜ Support

πŸ“§ Contact


🎡 Support the Developer

Love coding with chill vibes? Support this project by listening to my developer album:

"Code Chill: Loops of Relaxation" 🎧

Perfect background music for your coding sessions

Listen on Apple Music Listen on Spotify Listen on YouTube Music

Every stream helps support the development of free tools like this one! πŸ™

Note: This project is optimized for use with AI agents and automation systems. For general TTS use, consider simpler alternatives.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors