tinci-mcp (填词)
用于粤语歌词写作的MCP(模型上下文协议)服务器,提供发音查找、音调模式分析和押韵查找。
特性
- Jyutping罗马化:使用将粤语文本转换为Jyutping发音 陶玉萍
- 声调模式分析:使用1056/0243分类系统分析歌词,将音节与旋律相匹配
- 韵律查找:根据Jyutping finals(韵母)查找押韵字符,并提供音调过滤选项。数据来源于 拼音先生韵表
安装
需要Python 3.10+和 紫外线.
# Clone or navigate to the project directory
cd tinci-mcp
# Install dependencies
uv sync用法
运行服务器
uv run tinci-mcp使用Claude Desktop进行配置
添加到您的Claude Desktop配置(~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"tinci-mcp": {
"command": "uv",
"args": ["--directory", "/path/to/tinci-mcp", "run", "tinci-mcp"]
}
}
}使用游标进行配置
添加到光标MCP设置中:
{
"mcpServers": {
"tinci-mcp": {
"command": "uv",
"args": ["--directory", "/path/to/tinci-mcp", "run", "tinci-mcp"]
}
}
}工具
get_jyutping
将粤语文本转换为Jyutping罗马化。
输入:
text:粤语文本(繁体或简体中文)
输出:
{
"text": "你好",
"jyutping": [
["你", "nei5"],
["好", "hou2"]
],
"romanization": "nei5 hou2"
}get_tone_pattern
使用1056或0243系统分析歌词写作的音调模式。
输入:
text:粤语文本分析system:要么"1056"或"0243"(默认值:"0243")
输出:
{
"text": "你好",
"system": "0243",
"pattern": "43",
"breakdown": [
{ "character": "你", "jyutping": "nei5", "tone": 5, "mapped": "4" },
{ "character": "好", "jyutping": "hou2", "tone": 2, "mapped": "3" }
]
}get_rhyming_characters
找到与输入字符押韵的字符(相同的Jyutping最终/韻母).
输入:
character:一个可以押韵的汉字tone_filter:如何按音调过滤(默认值:"all")
- "all":返回所有押韵字符,无论音调如何 - "same":只返回具有完全相同音调的字符 - "group":返回同一音调组中的字符(1056/0243)
system:音调分类系统("1056"或"0243",默认值:"0243")limit:最大结果数(默认值:50)target_tone:查找具有特定音调(1-9)的押韵,覆盖tone_filtertarget_group:查找特定音调组中的押韵,覆盖tone_filter
示例1:基本押韵查找
// Input: character="來"
{
"input": {
"character": "來",
"jyutping": "loi4",
"tone": 4,
"tone_group": "0"
},
"final": "oi",
"rhymes": [
{ "character": "愛", "jyutping": "oi3", "tone": 3, "tone_group": "4" },
{
"character": "外",
"jyutping": "ngoi6",
"tone": 6,
"tone_group": "2"
},
{ "character": "改", "jyutping": "goi2", "tone": 2, "tone_group": "3" }
],
"total_count": 190
}示例2:找到不同音调的押韵
// Input: character="泉", target_tone=1
// 泉 is cyun4 (tone 4), but we want rhymes with tone 1
{
"input": {
"character": "泉",
"jyutping": "cyun4",
"tone": 4,
"tone_group": "0"
},
"final": "yun",
"target_tone": 1,
"rhymes": [
{
"character": "村",
"jyutping": "cyun1",
"tone": 1,
"tone_group": "3"
},
{
"character": "川",
"jyutping": "cyun1",
"tone": 1,
"tone_group": "3"
},
{ "character": "穿", "jyutping": "cyun1", "tone": 1, "tone_group": "3" }
],
"total_count": 74
}示例3:在不同的音调组中查找押韵
// Input: character="泉", target_group="3"
// 泉 is in group 0, but we want rhymes in group 3 (tones 1, 2, 7)
{
"input": {
"character": "泉",
"jyutping": "cyun4",
"tone": 4,
"tone_group": "0"
},
"final": "yun",
"target_group": "3",
"rhymes": [
{
"character": "忖",
"jyutping": "cyun2",
"tone": 2,
"tone_group": "3"
},
{
"character": "村",
"jyutping": "cyun1",
"tone": 1,
"tone_group": "3"
},
{ "character": "川", "jyutping": "cyun1", "tone": 1, "tone_group": "3" }
],
"total_count": 119
}音调系统
1056和0243系统将粤语的9个音调分为4类,以与音符相匹配:
| 音调编号 | 1056值 | 0243值 | 描述 |
|---|---|---|---|
| 1、2、7 | 1 | 3 | 高音 |
| 4 | 0 | 0 | 低下降 |
| 3、5、8 | 5 | 4 | 中音 |
| 6、9 | 6 | 2 | 低音 |
参考: HK01粤语歌词创作文章
数据源
许可证
麻省理工学院
