Skip to main content

MCP Server (SSE) to fetch and parse Chengdu Youth Center activities

Project description

MCP Server · 成都青年之家活动抓取器(Python)

一个基于 Model Context Protocol (MCP) 的服务端,抓取并解析 成都青年之家 的最新「精彩活动」列表,返回结构化活动数组

  • 语言:Python 3.9+
  • 传输:SSE(Server-Sent Events)
  • 框架:Starlette + Uvicorn
  • SDK:mcp(官方 Python SDK)+ FastMCP
  • 解析:httpx + BeautifulSoup4 + lxml

✨ 功能特性

  • 🔍 GET 抓取:请求 https://cdyouth.cdcyl.org.cn/jgc/,直接解析首页 HTML。
  • 📝 结构化输出:活动 ID、标题、标签、分类、时间、地址、状态、浏览量、封面图、详情链接等。
  • 🧩 MCP Toolfetch_chengdu_youth_activities(limit?: int)
  • 🔄 SSE 传输:提供 /sse(建立会话)与 /messages(客户端发消息)端点。
  • ❤️ 健康检查/healthz 返回 200 ok,便于托管/监控。

📦 安装

方式 A:从源代码本地安装(推荐开发用)

# 创建虚拟环境(可用 uv/pipenv/venv,以下以 uv 为例)
uv venv
uv pip install -e .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_cd_youth-1.0.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_cd_youth-1.0.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file mcp_cd_youth-1.0.2.tar.gz.

File metadata

  • Download URL: mcp_cd_youth-1.0.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for mcp_cd_youth-1.0.2.tar.gz
Algorithm Hash digest
SHA256 63d165250cc5140b410a56a655a2142fb7100679426270b45ce30738a76a94c3
MD5 a6a3eb4171d8ee02c0ff13767bc2ff21
BLAKE2b-256 4ef4bd27037c3a952f372964223076873af1989e7114153abff501dd93807c6e

See more details on using hashes here.

File details

Details for the file mcp_cd_youth-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: mcp_cd_youth-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for mcp_cd_youth-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a3da1a8eb867e7dc38d3b33669cd900653a5a9bd06190dfa6ec63b227923d024
MD5 40fe0329c5a443376569a8e37970873f
BLAKE2b-256 9ffe5f2aff99a23528b1820440b34531dd20fb96441bc0dda0751cb71f6c8f16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page