使用说明
猫事实mcp
MCP(模型上下文协议)服务器,提供来自 API.
特性
- get_cat_fact:从meowfacts API获取一个随机的cat事实
安装
pip install -e .
用法
使用VSCode
- 安装VSCode的MCP扩展
- 从添加配置
.vscode-settings.example.json到您的VSCode设置(.vscode/settings.json或用户设置) - 更新
cwd如果需要,指向安装目录的路径 - 重新启动VSCode或重新加载MCP服务器
- 您现在可以使用
get_cat_factMCP服务器上的工具
手动运行服务器
python -m cat_facts_mcp.server
服务器通过stdio进行通信,并期望收到MCP协议消息。
API
服务器提供了一个工具:
- get_cat_fact:不接受任何参数,并返回一个随机的猫事实作为文本。
示例响应
meowfacts API以以下格式返回数据:
{
"data": ["Cats have individual preferences for scratching surfaces and angles. Some are horizontal scratchers while others exercise their claws vertically."]
}
MCP服务器提取事实并以纯文本形式返回。
需求
- Python 3.10+
- mcp>=0.9.0
- httpx>=0.27.0
许可证
有关详细信息,请参阅LICENSE文件。