Skip to main content
Glama

WeChat Article Reader MCP Server

by whbfxy
article.py3.95 kB
""" 数据模型定义 """ from dataclasses import dataclass from typing import Any, Dict, List, Optional from datetime import datetime @dataclass class ArticleMetadata: """文章元数据""" title: str author: str publish_time: str account_name: str account_id: str images: List[Dict[str, Any]] read_count: int like_count: int comment_count: int def to_dict(self) -> Dict[str, Any]: """转换为字典""" return { "title": self.title, "author": self.author, "publish_time": self.publish_time, "account_name": self.account_name, "account_id": self.account_id, "images": self.images, "read_count": self.read_count, "like_count": self.like_count, "comment_count": self.comment_count } @dataclass class WeChatArticle: """微信公众号文章数据模型""" url: str title: str author: str publish_time: str account_name: str account_id: str content: Dict[str, str] # 包含markdown和text格式的内容 images: List[Dict[str, Any]] # 图片列表 read_count: int like_count: int comment_count: int content_hash: str # 内容哈希值 extracted_at: str def to_dict(self) -> Dict[str, Any]: """转换为字典""" return { "url": self.url, "title": self.title, "author": self.author, "publish_time": self.publish_time, "account_name": self.account_name, "account_id": self.account_id, "content": self.content, "images": self.images, "read_count": self.read_count, "like_count": self.like_count, "comment_count": self.comment_count, "content_hash": self.content_hash, "extracted_at": self.extracted_at } @dataclass class ArticleContent: """文章内容数据模型""" markdown: str text: str def to_dict(self) -> Dict[str, str]: """转换为字典""" return { "markdown": self.markdown, "text": self.text } @dataclass class ArticleSummary: """文章摘要数据模型""" title: str url: str summary: str def to_dict(self) -> Dict[str, str]: """转换为字典""" return { "title": self.title, "url": self.url, "summary": self.summary } @dataclass class SearchResult: """搜索结果数据模型""" url: str title: str author: str publish_time: str account_name: str account_id: str read_count: int like_count: int comment_count: int def to_dict(self) -> Dict[str, Any]: """转换为字典""" return { "url": self.url, "title": self.title, "author": self.author, "publish_time": self.publish_time, "account_name": self.account_name, "account_id": self.account_id, "read_count": self.read_count, "like_count": self.like_count, "comment_count": self.comment_count } @dataclass class ResponseMetadata: """响应元数据""" success: bool message: str request_id: Optional[str] = None error_code: Optional[str] = None error_type: Optional[str] = None def to_dict(self) -> Dict[str, Any]: """转换为字典""" result = { "success": self.success, "message": self.message } if self.request_id: result["request_id"] = self.request_id if not self.success: if self.error_code: result["error_code"] = self.error_code if self.error_type: result["error_type"] = self.error_type return result

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/whbfxy/MCP101Demo'

If you have feedback or need assistance with the MCP directory API, please join our Discord server