Python MCP Cat Facts

by akream
  • Linux
  • Apple

Integrations

  • Provides a FastAPI-based server implementation that exposes cat facts data through SSE transport, complete with automatic OpenAPI documentation.

  • Integrates with Swagger UI to provide interactive API documentation, allowing users to explore and test the cat facts endpoints.

Python MCP Cat 事实

一个 FastAPI 服务器,它使用服务器发送事件 (SSE) 传输实现模型上下文协议 (MCP) 来提供猫事实。

特征

  • 获取一条随机的猫咪事实
  • 订阅每 10 秒推送一次的猫咪知识
  • SSE(服务器发送事件)用于实时通信
  • 具有自动 OpenAPI 文档的 FastAPI 框架

要求

  • Python 3.12+
  • 依赖项:
    • fastapi
    • mcp[cli]
    • uvicorn
    • CMake

安装

克隆存储库

git clone <repository-url> cd python-mcp

创建虚拟环境

python -m venv venv source venv/bin/activate # On Windows, use: venv\Scripts\activate

安装依赖项

pip install -e .

以 SSE 模式启动服务器

使用 uv run 命令启动服务器:

uv run start

服务器运行后,可在以下位置使用:

VS Code 集成

要将此 MCP 服务器与 VS Code 一起使用,您需要将以下配置添加到mcp.json文件:

{ "servers": { "mcp-sse": { "type": "sse", "url": "http://0.0.0.0:8000/sse" } } }

此配置告诉 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)

执照

麻省理工学院

-
security - not tested
F
license - not found
-
quality - not tested

一个 FastAPI 服务器,它使用服务器发送事件 (SSE) 传输实现模型上下文协议 (MCP),以按需或以连续流的形式提供随机猫事实。

  1. 特征
    1. 要求
      1. 安装
        1. 克隆存储库
        2. 创建虚拟环境
        3. 安装依赖项
      2. 以 SSE 模式启动服务器
        1. VS Code 集成
          1. 使用 Cat Facts API
            1. 了解一只猫的概况:
          2. API 端点
            1. 执照

              Related MCP Servers

              • -
                security
                A
                license
                -
                quality
                A 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 -
                5
                Python
                MIT License
              • -
                security
                A
                license
                -
                quality
                A 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 -
                9
                Python
                MIT License
              • -
                security
                F
                license
                -
                quality
                A simple application demonstrating Model Context Protocol (MCP) integration with FastAPI and Streamlit, allowing users to interact with LLMs through a clean interface.
                Last updated -
                3
                Python
                • Linux
              • A
                security
                F
                license
                A
                quality
                An implementation of the Model Context Protocol (MCP) server using Server-Sent Events (SSE) for real-time communication, providing tools for calculations and dynamic resource templates.
                Last updated -
                1
                JavaScript

              View all related MCP servers

              ID: 4sslfgnx26