Back to MCP directory
publicPublicdnsLocal runtime

ms-lucidia-voice-gateway-mcp

一个基于Windows原生语音服务的文本转语音和语音转文本的MCP服务器,无需外部API依赖。

article

README

🚀 MS-Lucidia-Voice-Gateway-MCP

MS-Lucidia-Voice-Gateway-MCP 是一个模型上下文协议(MCP)服务器,它借助 Windows 内置语音服务,提供文字转语音(TTS)和语音转文字(STT)功能。该服务器通过 PowerShell 命令调用本地 Windows 语音 API(SAPI),无需依赖外部 API 或服务,使用起来更加便捷和安全。

🚀 快速开始

先决条件

  • Windows 10/11,启⽤语⾳识别
  • Node.js 16+
  • PowerShell

安装步骤

  1. 克隆仓库:
git clone https://github.com/ExpressionsBot/MS-Lucidia-Voice-Gateway-MCP.git
cd MS-Lucidia-Voice-Gateway-MCP
  1. 安装依赖项:
npm install
  1. 构建项目:
npm run build

使用说明

测试界⾯

  1. 启动测试服务器:
npm run test
  1. 打开 http://localhost:3000 在浏览器中
  2. 使用网页界⾯测试 TTS 和 STT 功能

可⽤⼯具

text_to_speech

⽤ Windows SAPI 语⾳将⽂字转为语⾔。

参数:

  • text(必需):要转换的⽂字
  • voice(可选):要使⽤的语⾳(例如,“Microsoft David Desktop”)
  • speed(可选):语⾔速度,范围 0.5 到 2.0(默认:1.0)

例:

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

记录⾳频并将其转换为⽂字,使⽤ Windows 语⾔识别。

参数:

  • duration(可选):录制时⻓(秒,默认:5,最⼤:60)

例:

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));

✨ 主要特性

  • 使用 Windows SAPI 语⾳的⽂字转语⾔(TTS)
  • 使用 Windows 语⾔识别(SR)的语⾔转⽂字(STT)
  • 简单的网页界面⽤于测试
  • 无外部 API 依赖
  • 利⽤本地 Windows 功能

🔧 故障排除

  1. 确保 Windows 语⾔识别已启⽤:

    • 打开 Windows 设置
    • 进⼊时间和语言 > 语⾳
    • 启⽤语⾔识别
  2. 检查可⽤的语⾳:

    • 打开 PowerShell 并运⾏:
    Add-Type -AssemblyName System.Speech
    (New-Object System.Speech.Synthesis.SpeechSynthesizer).GetInstalledVoices().VoiceInfo.Name
    
  3. 测试语⾔识别:

    • 在 Windows 设置中打开语⾔识别
    • 如果尚未完成,请完成安装向导
    • 测试 Windows 是否能识别您的语⾳

🤝 贡献

  1. 叉克隆仓库
  2. 创建功能分支
  3. 提交更改
  4. 推送到分支
  5. 创建新的 Pull Request

📄 许可证

MIT

READY-TO-PASTE CONFIG

MCP client config generator

Choose your client, fill the required environment variables, then copy a config generated from this server's published metadata

terminal
data_object

This entry does not contain a standard command or remote URL, so a safe client config cannot be generated automatically

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client