关于 Datamuse MCP
Datamuse MCP 是一个通过 stdio 运行的本地 MCP 服务,将 Datamuse 词汇搜索 API 封装为经过验证的工具,面向支持 MCP 的助手和客户端。它支持同义词、押韵、拼写模式及词义信息查询。
主要功能
- 01查找同义词、反义词和押韵词
- 02按拼写模式或发音相似度搜索
- 03获取词义、词性和发音等信息
- 04提供自动补全和相关词查询
- 05使用本地内存缓存
适用场景
- 01为写作寻找同义词或押韵词
- 02按拼写模式查找候选词
- 03查询词义、音节或发音
- 04为输入前缀补全词语
MCP 相关
该项目是通过 stdio 提供服务的本地 MCP 服务,将 Datamuse API 功能作为工具提供给 MCP 客户端。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
10收录的工具列表 · 更新于 2 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| max | number | 否 | 结果数量上限(1-50,默认值:10) |
| word | string | 是 | 要查找同义词的单词 |
| topic | string | 否 | 用于调整结果偏向的可选主题(例如,'music'、'medical') |
详细介绍
datamuse-mcp
用于 Datamuse API(单词搜索、押韵、同义词等)的 MCP 服务。
本项目是开源的,可免费使用,并采用 MIT 许可证。
关于
datamuse-mcp 是一个本地 stdio MCP 服务,可将 Datamuse 端点封装为经过验证的 MCP 工具。
它面向支持 MCP 的助手和客户端,适用于实际的单词查找场景。
用途
此服务提供简单的 MCP 工具,用于:
- 查找同义词、反义词和押韵词;
- 运行自动补全;
- 获取词汇详情(释义、词性、音节、发音、词频);
- 根据拼写模式(
*、?)或语音相似度进行搜索。
要求
- Node.js
>= 18 - npm
安装
npm install
开发
npm run dev
构建和运行
npm run build
npm start
手动进行 JSON-RPC 检查
# List tools
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node dist/index.js
# Call a tool
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"find_synonyms","arguments":{"word":"happy"}}}' | node dist/index.js
更多工具示例
{ "tool": "find_antonyms", "arguments": { "word": "happy", "max": 10 } }
{ "tool": "find_rhymes", "arguments": { "word": "love", "type": "perfect", "max": 20 } }
{ "tool": "find_similar_sounding", "arguments": { "text": "definately", "max": 15 } }
{ "tool": "find_by_pattern", "arguments": { "pattern": "s??r?", "meaning_hint": "celestial", "max": 25 } }
{ "tool": "find_related_words", "arguments": { "word": "music", "relation_type": "triggers", "max": 15 } }
{ "tool": "get_word_info", "arguments": { "word": "serendipity" } }
{ "tool": "autocomplete", "arguments": { "prefix": "astro", "max": 10 } }
Claude Desktop 配置
将以下内容添加到 claude_desktop_config.json:
{
"mcpServers": {
"datamuse": {
"command": "node",
"args": ["/absolute/path/to/datamuse-mcp/dist/index.js"]
}
}
}
暴露的工具
find_synonymsfind_antonymsfind_rhymesfind_similar_soundingfind_by_patternfind_related_wordsfind_adjectives_for_nounfind_nouns_for_adjectiveget_word_infoautocomplete
安全与限制
- 服务通过
stdio运行(建议本地使用)。 - 出站请求发送至
https://api.datamuse.com。 - 使用本地内存缓存(TTL 为 5 分钟),不写入磁盘。
- Datamuse 可能会限制请求次数或配额。
发布
有关 npm 和 MCP Registry 部署的信息,请参阅 PUBLISHING.md。
贡献
请参阅 CONTRIBUTING.md。
许可证
MIT — 请参阅 LICENSE。
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。