The Hot Topic Aggregation MCP Server is a Python-based implementation of the Model Context Protocol (MCP) designed to fetch trending topics from various platforms. This server allows users to retrieve real-time hot topics from platforms like Sina Weibo, Zhihu, and more. It is particularly useful for developers and analysts who need to monitor trending content across multiple social media platforms.
HotTopicBase
class.The project is organized into the following directories and files:
hot-topic-mcp/
├── items/ # Contains platform-specific hot topic implementations
├── tests/ # Unit tests for the project
├── .gitignore # Specifies files to ignore in Git
├── .python-version # Specifies the Python version
├── README.md # Project documentation
├── main.py # Entry point for the MCP server
├── pyproject.toml # Project configuration file
└── uv.lock # Dependency lock file
To add support for a new platform, follow these steps:
HotTopicBase
: Create a new class that inherits from HotTopicBase
.get_hot_topics
: Implement the get_hot_topics
method to fetch hot topics from the new platform.@register_hot_topic
decorator to register the platform with a unique platform_name
.Example:
from hot_topic_base import HotTopicBase, register_hot_topic
@register_hot_topic(platform_name="sina_weibo_hot_topic")
class SinaWeiboHotTopic(HotTopicBase):
def get_hot_topics(self):
# Implementation to fetch Sina Weibo hot topics
pass
To start the MCP server, run the following command:
python main.py
Contributions are welcome! If you'd like to add support for a new platform or improve the existing codebase, please fork the repository and submit a pull request.
This project is open-source and available under the MIT License. See the LICENSE file for more details.