Text To Speech (Windows) MCP server

Integrates with Windows speech services to enable text-to-speech and speech-to-text capabilities using native system features and PowerShell commands.
Back to servers
Provider
ExpressionsBot
Release date
Jan 18, 2025
Language
TypeScript
Stats
4 stars

This MCP server provides text-to-speech and speech-to-text capabilities using Windows' built-in speech services. It leverages the native Windows Speech API (SAPI) through PowerShell commands, eliminating the need for external APIs or services while offering a simple web interface for testing.

Prerequisites

  • Windows 10/11 with Speech Recognition enabled
  • Node.js 16+
  • PowerShell

Installation

  1. Clone the repository:

    git clone https://github.com/ExpressionsBot/MS-Lucidia-Voice-Gateway-MCP.git
    cd MS-Lucidia-Voice-Gateway-MCP
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    

Usage

Testing Interface

  1. Start the test server:

    npm run test
    
  2. Open http://localhost:3000 in your browser

  3. Use the web interface to test TTS and STT capabilities

Available Tools

Text-to-Speech Service

Converts text to speech using Windows SAPI.

Parameters:

  • text (required): The text to convert to speech
  • voice (optional): The voice to use (e.g., "Microsoft David Desktop")
  • speed (optional): Speech rate from 0.5 to 2.0 (default: 1.0)

Example:

fetch('http://localhost:3000/tts', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    text: "Hello, this is a test",
    voice: "Microsoft David Desktop",
    speed: 1.0
  })
});

Speech-to-Text Service

Records audio and converts it to text using Windows Speech Recognition.

Parameters:

  • duration (optional): Recording duration in seconds (default: 5, max: 60)

Example:

fetch('http://localhost:3000/stt', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    duration: 5
  })
}).then(response => response.json())
  .then(data => console.log(data.text));

Troubleshooting

Enabling Speech Recognition

Make sure Windows Speech Recognition is enabled:

  • Open Windows Settings
  • Go to Time & Language > Speech
  • Enable Speech Recognition

Checking Available Voices

To see which voices are available on your system:

  • Open PowerShell and run:
    Add-Type -AssemblyName System.Speech
    (New-Object System.Speech.Synthesis.SpeechSynthesizer).GetInstalledVoices().VoiceInfo.Name
    

Testing Speech Recognition

If speech recognition isn't working:

  • Open Speech Recognition in Windows Settings
  • Run through the setup wizard if not already done
  • Test that Windows can recognize your voice

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