猫事实查询服务

一个基于MCP协议的服务器,提供从meowfacts API获取随机猫事实的功能。

  • by mtrmarko
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 mtrmarko/cat-facts-mcp

使用说明

猫事实mcp

MCP(模型上下文协议)服务器,提供来自 API.

特性

  • get_cat_fact:从meowfacts API获取一个随机的cat事实

安装

pip install -e .

用法

使用VSCode

  1. 安装VSCode的MCP扩展
  2. 从添加配置 .vscode-settings.example.json 到您的VSCode设置(.vscode/settings.json 或用户设置)
  3. 更新 cwd 如果需要,指向安装目录的路径
  4. 重新启动VSCode或重新加载MCP服务器
  5. 您现在可以使用 get_cat_fact MCP服务器上的工具

手动运行服务器

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文件。