语音交互工具

一个为Claude Code添加语音功能的MCP服务器,通过微软神经TTS实现自然语音输出。

  • by Rajvardhman05
  • JavaScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 Rajvardhman05/claude-speaks

使用说明

克劳德讲话

给克劳德·科德一个声音。一个MCP服务器,让克劳德用自然的神经声音和你说话。

与其阅读长篇回复,不如让克劳德大声说出来。

运作原理

Claude Speaks补充道 speak Claude Code的工具。当Claude调用它时,您可以使用微软的神经TTS语音通过扬声器听到响应——与Edge浏览器的“朗读”功能中使用的语音相同。

快速开始

1.安装边缘tts(一次性)

pip install edge-tts

2.添加到克劳德代码

claude mcp add claude-speaks -- npx -y claude-speaks

3.使用它

启动一个新的Claude Code会话,并请Claude发言:

  • “跟我打个招呼”
  • “大声读出你最后的回应”
  • “解释这段代码并告诉我”
  • “用英国口音说”

可用工具

speak

通过扬声器大声朗读文本。

参数 必填 说明
text 是 要发言的文本
voice 否 语音ID(默认值: en-GB-RyanNeural)
rate 否 速度调节类似 +10% 或 -20%

list_voices

列出所有可用的神经声音。

参数 必填 说明
language 否 按语言代码过滤(例如。, en, es, fr)

声音

一些流行的声音:

语音ID 描述
en-GB-RyanNeural 英国男性(默认)
en-US-GuyNeural 美国男性
en-AU-WilliamNeural 澳大利亚男性
en-US-AriaNeural 美国女性
en-US-JennyNeural 美国女性,温暖
en-GB-SoniaNeural 英国女性

跑 list_voices 与 language: "en" 查看所有英语语音,或省略过滤器以查看100多种语言的400多种语音。

需求

  • macOS (使用 afplay 用于音频播放)
  • Node.js 18+
  • Python 3 与 edge-tts 已安装(pip install edge-tts)
  • Claude 代码 命令行界面

如何安装边缘tts

# Using pip
pip install edge-tts

# Or using pipx (isolated install)
pipx install edge-tts

# Verify it works
edge-tts --text "Hello" --write-media /tmp/test.mp3 && afplay /tmp/test.mp3

手动安装

如果您更喜欢手动安装而不是使用 npx:

# Clone and build
git clone https://github.com/rajvardhman/claude-speaks.git
cd claude-speaks
npm install
npm run build

# Add to Claude Code
claude mcp add claude-speaks -- node /path/to/claude-speaks/dist/index.js

故障排除

“说话失败:找不到边缘tts”

  • 安装边缘tts: pip install edge-tts
  • 确保它在你的路径中: which edge-tts

无音频输出

  • 检查您的系统音量
  • 直接测试: edge-tts --text "test" --write-media /tmp/test.mp3 && afplay /tmp/test.mp3

声音听起来像机器人

  • 不要通过 rate 参数——省略它会产生最自然的声音
  • 尝试不同的声音:让克劳德 list_voices 与 language: "en"

许可证

麻省理工学院