Python MCP Cat 事实
一个 FastAPI 服务器,它使用服务器发送事件 (SSE) 传输实现模型上下文协议 (MCP) 来提供猫事实。
特征
获取一条随机的猫咪事实
订阅每 10 秒推送一次的猫咪知识
SSE(服务器发送事件)用于实时通信
具有自动 OpenAPI 文档的 FastAPI 框架
要求
Python 3.12+
依赖项:
fastapi
mcp[cli]
uvicorn
CMake
安装
克隆存储库
创建虚拟环境
安装依赖项
以 SSE 模式启动服务器
使用 uv run 命令启动服务器:
服务器运行后,可在以下位置使用:
API 文档: http://localhost:8000/docs
VS Code 集成
要将此 MCP 服务器与 VS Code 一起使用,您需要将以下配置添加到mcp.json文件:
此配置告诉 VS Code 如何使用 SSE 传输连接到您的 MCP 服务器。
使用 Cat Facts API
了解一只猫的概况:
连接到 SSE 端点并请求单个猫咪信息。响应始终以“Hi!”开头。
API 端点
GET /: 主页GET /about:关于应用程序的信息GET /status:当前服务器状态GET /sse:MCP 通信的 SSE 端点GET /docs:API 文档(Swagger UI)GET /redoc:备用 API 文档(ReDoc)
执照
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
一个 FastAPI 服务器,它使用服务器发送事件 (SSE) 传输实现模型上下文协议 (MCP),以按需或以连续流的形式提供随机猫事实。
Related MCP Servers
- -security-license-qualityA high-performance FastAPI server supporting Model Context Protocol (MCP) for seamless integration with Large Language Models, featuring REST, GraphQL, and WebSocket APIs, along with real-time monitoring and vector search capabilities.Last updated -9MIT License
 - -security-license-qualityA Server-Sent Events implementation using FastAPI framework that integrates Model Context Protocol (MCP), allowing AI models to access external tools and data sources like weather information.Last updated -50MIT License
 - -security-license-qualityA server for Model Context Protocol (MCP) that uses Server-Sent Events (SSE) for streaming communication, enabling tools like the HackerNews API to be accessed through a secure HTTP+SSE transport.Last updated -24
 - -security-license-qualityA FastAPI server implementing the Model Context Protocol (MCP) for structured tool use, providing utility tools including random number generation, image generation via Azure OpenAI DALL-E, and AI podcast generation.Last updated -