weibo-hot-search-mcp-server

weibo-hot-search-mcp-server

MCP server that fetches Weibo hot search trends. Supports Stdio, SSE, and Streamable HTTP.

Category
Visit Server

README

MCP Server Example

通过获取前 N 条微博热搜的 MCP 服务进行示例,演示基于 fastmcp 构建,内置 Stdio、本地 SSE、Streamable HTTP 三种MCP运行脚本,适配本地和远程多端场景。


🚀 快速开始

git clone https://github.com/bossdong955/mcp-server-example.git
cd weibo-mcp-server

# 创建并进入 Conda 环境
conda create -n mcp-server-example python=3.11
conda activate mcp-server-example

# 安装依赖(注意:请确认本机已卸载旧版 mcp 包)
pip install -r requirements.txt

requirements.txt 默认包含:

  • fastmcp
  • httpx
  • uvicorn
  • starlette

🧭 运行模式

模式 脚本 典型场景 监听方式
Stdio resou_stdio.py Claude Desktop / VS Code Cline 本地插件 标准输入输出
SSE resou_sse.py 部署在服务器,通过 SSE 远程连接 http://HOST:PORT/sse
Streamable HTTP resou_streamable_http.py 支持 HTTP 长连接的客户端 http://HOST:PORT/mcp

启动任意脚本后都可以调用 hot_search(n=20) 获取热搜,n 为返回条数上限。


1. Stdio(本地推荐)

python resou_stdio.py

VS Code Cline / Claude Desktop mcpServers 示例(将路径替换成你本机的脚本路径):

{
  "mcpServers": {
    "weiboresou": {
      "command": "conda",
      "args": [
        "run",
        "-n",
        "weibo-mcp-server",
        "--no-capture-output",
        "python",
        "E:/your/path/resou_stdio.py"
      ],
      "env": {
        "PYTHONUTF8": "1"
      }
    }
  }
}

已在脚本中调用 mcp.run(transport="stdio"),无需再使用 mcp run ...

Stdio 模式配置步骤


2. SSE(远程流式)

python resou_sse.py --host 0.0.0.0 --port 8006

在 VS Code Cline -> Remote Servers 中设置:

  • URL: http://<host>:8006/sse
  • 可选 Header:Authorization 等自定义认证信息(如有需要)

SSE 模式配置步骤


3. Streamable HTTP

python resou_streamable_http.py --host 0.0.0.0 --port 8005

远程客户端配置示例:

  • URL: http://<host>:8005/mcp
  • 该模式返回可流式消费的 HTTP 响应,适合自定义前端或其他 MCP 客户端。

🛠️ 常见问题

  1. 编码报错(GBK 等):在客户端配置中加入 PYTHONUTF8=1
  2. 依赖冲突:如果之前安装过 mcp 包,请先卸载 pip uninstall mcp,再安装 fastmcp
  3. 网络超时hot_search 默认 10s 超时。可在脚本中调整 httpx.AsyncClienttimeout 参数。

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured