TTS Say MCP server

Integrates with OpenAI's API and local sound playback to convert text into audible speech, enabling voice output for various applications.
Back to servers
Provider
Hiroki Daichi
Release date
Feb 01, 2025
Language
TypeScript
Stats
5 stars

MCP TTS Say is a tool that converts text to speech and plays it in your local environment using OpenAI's TTS SDK. It integrates with an MCP server to provide a simple way to generate and play high-quality synthesized voice audio.

Prerequisites

  • Node.js (v18 or higher)
  • OpenAI API key
  • Local environment capable of audio playback

Installation

First, clone the repository and install the required dependencies:

# Clone the project
git clone https://github.com/hirokidaichi/mcp-tts-say.git
cd mcp-tts-say

# Install dependencies
npm install

Configuration

Set up your environment variables:

  1. Create a .env file in the project root directory
  2. Configure your OpenAI API key in the file:
OPENAI_API_KEY=your_api_key_here

Usage

Starting the Server

To start the MCP TTS server in development mode:

npm run dev

Debugging with MCP Inspector

For debugging purposes, you can use the MCP Inspector tool:

npm run inspect

This will launch the server in a mode that allows for detailed inspection of requests and responses.

Testing the Service

The server provides text-to-speech capabilities. To use it, you'll need to send requests to the MCP server with the text you want to convert to speech. The server will then generate the audio and play it in your local environment.

While the README doesn't provide specific API examples, you would typically interact with the MCP server by sending properly formatted requests containing the text to be spoken, and potentially parameters like voice type, speed, and other audio characteristics supported by OpenAI's TTS SDK.

The service handles the API communication with OpenAI and the audio playback on your behalf, simplifying the process of converting text to speech in your applications.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later