Mac语音转换
通过使用“say”命令在macOS上启用文本转语音功能,提供对语音、语速、音量和音调等语音参数的广泛控制,从而实现可定制的听觉体验。
可用工具 (2 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
speak 4 个参数 需填 1 项
Use macOS text-to-speech to speak text aloud
必填参数:text
list_voices
List available text-to-speech voices
该工具无需必填参数,直接调用即可
服务介绍
say-mcp-server

这是一个使用 macOS 内置 say 命令提供文本转语音功能的 MCP 服务器。
要求
- macOS(使用内置的
say命令) - Node.js >= 14.0.0
配置
将以下内容添加到您的 MCP 设置配置文件中:
{
"mcpServers": {
"say": {
"command": "node",
"args": ["/path/to/say-mcp-server/build/index.js"]
}
}
}
安装
npm install say-mcp-server
工具
speak
speak 工具提供了访问 macOS 文本转语音功能的能力,并支持广泛的自定义选项。
基本用法
使用 macOS 的文本转语音功能大声朗读文本。
参数:
text(必需):要朗读的文本。支持:- 纯文本
- 基本标点符号用于停顿
- 换行符用于自然停顿
- [[slnc 500]] 表示 500ms 的静音
- [[rate 200]] 表示在文本中间改变速度
- [[volm 0.5]] 表示在文本中间改变音量
- [[emph +]] 和 [[emph -]] 用于强调
- [[pbas +10]] 用于调整音调
voice(可选):使用的语音(默认:"Alex")rate(可选):每分钟单词数的说话速度(默认:175,范围:1-500)background(可选):在后台运行语音以允许进一步的 MCP 交互(默认:false)
高级特性
- 语音调制:
use_mcp_tool({
server_name: "say",
tool_name: "speak",
arguments: {
text: "[[volm 0.7]] This is quieter [[volm 1.0]] and this is normal [[volm 1.5]] and this is louder",
voice: "Victoria"
}
});
- 动态速率变化:
use_mcp_tool({
server_name: "say",
tool_name: "speak",
arguments: {
text: "Normal speed [[rate 300]] now speaking faster [[rate 100]] and now slower",
voice: "Fred"
}
});
- 强调和音调:
use_mcp_tool({
server_name: "say",
tool_name: "speak",
arguments: {
text: "[[emph +]] Important point! [[emph -]] [[pbas +10]] Higher pitch [[pbas -10]] Lower pitch",
voice: "Samantha"
}
});
集成示例
- 与 Marginalia Search 结合使用:
// Search for a topic and have the results read aloud
const searchResult = await use_mcp_tool({
server_name: "marginalia-mcp-server",
tool_name: "search",
arguments: { query: "quantum computing basics", count: 1 }
});
await use_mcp_tool({
server_name: "say",
tool_name: "speak",
arguments: {
text: searchResult.results[0].description,
voice: "Daniel",
rate: 150
}
});
- 与 YouTube 字幕结合使用:
// Read a YouTube video transcript
const transcript = await use_mcp_tool({
server_name: "youtube-transcript",
tool_name: "get_transcript",
arguments: {
url: "https://youtube.com/watch?v=example",
lang: "en"
}
});
await use_mcp_tool({
server_name: "say",
tool_name: "speak",
arguments: {
text: transcript.text,
voice: "Samantha",
rate: 175
}
});
- 多个动作的后台语音:
// Start long speech in background
await use_mcp_tool({
server_name: "say",
tool_name: "speak",
arguments: {
text: "This is a long speech that will run in the background...",
voice: "Rocko (Italian (Italy))",
rate: 69,
background: true
}
});
// Immediately perform another action while speech continues
await use_mcp_tool({
server_name: "marginalia-mcp-server",
tool_name: "search",
arguments: { query: "parallel processing" }
});
- 与 Apple Notes 结合使用:
// Read notes aloud
const notes = await use_mcp_tool({
server_name: "apple-notes-mcp",
tool_name: "search-notes",
arguments: { query: "meeting notes" }
});
if (notes.length > 0) {
await use_mcp_tool({
server_name: "say",
tool_name: "speak",
arguments: {
text: notes[0].content,
voice: "Karen",
rate: 160
}
});
}
示例:
use_mcp_tool({
server_name: "say",
tool_name: "speak",
arguments: {
text: "Hello, world!",
voice: "Victoria",
rate: 200
}
});
list_voices
列出系统上所有可用的文本转语音声音。
示例:
use_mcp_tool({
server_name: "say",
tool_name: "list_voices",
arguments: {}
});
推荐的声音
配置
将以下内容添加到您的 MCP 设置配置文件中:
{
"mcpServers": {
"say": {
"command": "node",
"args": ["/path/to/say-mcp-server/build/index.js"]
}
}
}
要求
- macOS(使用内置的
say命令) - Node.js >= 14.0.0
贡献者
- Barton Rhodes (@bmorphism) - barton@vibes.lol
许可证
MIT