s

say-mcp-server

yaojingyi/say-mcp-server
0 Stars 56 次浏览 更新于 2026-08-23

一个使用 macOS 内置的 `say` 命令提供文本转语音功能的 MCP 服务器。它包括用于朗读文本(支持多种自定义选项)和列出可用语音的工具。

该服务暂未提供标准配置,请参考 README 手动接入

服务介绍

say-mcp-server

macOS 系统语音设置

这是一个使用 macOS 内置 say 命令提供文本转语音功能的 MCP 服务器。

要求

  • macOS(使用内置的 say 命令)
  • Node.js >= 14.0.0

配置

将以下内容添加到您的 MCP 设置配置文件中:

json
{
"mcpServers": {
"say": {
"command": "node",
"args": ["/path/to/say-mcp-server/build/index.js"]
}
}
}

安装

bash
npm install say-mcp-server

工具

speak

speak 工具提供了对 macOS 文本转语音功能的访问,并支持广泛的自定义选项。

基本用法

使用 macOS 的文本转语音功能朗读文本。

参数:

  • text(必需):要朗读的文本。支持:
    • 纯文本
    • 基本标点符号用于停顿
    • 换行符用于自然停顿
    • [[slnc 500]] 表示 500 毫秒的静音
    • [[rate 200]] 表示在文本中间改变速度
    • [[volm 0.5]] 表示在文本中间改变音量
    • [[emph +]] 和 [[emph -]] 表示强调
    • [[pbas +10]] 表示调整音调
  • voice(可选):使用的语音(默认:"Alex")
  • rate(可选):每分钟单词数(默认:175,范围:1-500)
  • background(可选):在后台运行语音以允许进一步的 MCP 交互(默认:false)

高级功能

  1. 语音调节:
    typescript
    use_mcp_tool({
    server_name: "say",
    tool_name: "speak",
    arguments: {
    text: "[[volm 0.7]] 这个声音更小 [[volm 1.0]] 这是正常音量 [[volm 1.5]] 这个声音更大",
    voice: "Victoria"
    }
    });

  2. 动态速率变化:
    typescript
    use_mcp_tool({
    server_name: "say",
    tool_name: "speak",
    arguments: {
    text: "正常速度 [[rate 300]] 现在更快 [[rate 100]] 现在更慢",
    voice: "Fred"
    }
    });

  3. 强调和音调:
    typescript
    use_mcp_tool({
    server_name: "say",
    tool_name: "speak",
    arguments: {
    text: "[[emph +]] 重要点![[emph -]] [[pbas +10]] 更高的音调 [[pbas -10]] 更低的音调",
    voice: "Samantha"
    }
    });

集成示例

  1. 与 Marginalia Search 结合使用:
    typescript
    // 搜索一个主题并将结果大声朗读
    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
}
});

  1. 与 YouTube 字幕结合使用:
    typescript
    // 朗读 YouTube 视频字幕
    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
}
});

  1. 后台语音与多个操作结合使用:
    typescript
    // 在后台开始长时间的语音
    await use_mcp_tool({
    server_name: "say",
    tool_name: "speak",
    arguments: {
    text: "这是一段将在后台运行的长语音...",
    voice: "Rocko (意大利语(意大利))",
    rate: 69,
    background: true
    }
    });

// 在语音继续的同时立即执行另一个操作
await use_mcp_tool({
server_name: "marginalia-mcp-server",
tool_name: "search",
arguments: { query: "parallel processing" }
});

  1. 与 Apple Notes 结合使用:
    typescript
    // 大声朗读笔记
    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
}
});
}示例:
typescript
use_mcp_tool({
server_name: "say",
tool_name: "speak",
arguments: {
text: "Hello, world!",
voice: "Victoria",
rate: 200
}
});

list_voices

列出系统上所有可用的文本转语音声音。

示例:
typescript
use_mcp_tool({
server_name: "say",
tool_name: "list_voices",
arguments: {}
});

推荐的声音

配置

在您的MCP设置配置文件中添加以下内容:

json
{
"mcpServers": {
"say": {
"command": "node",
"args": ["/path/to/say-mcp-server/build/index.js"]
}
}
}

要求

  • macOS(使用内置的 say 命令)
  • Node.js >= 14.0.0

贡献者

许可证

MIT

相关 MCP 服务