Zhihu MCP Server

Zhihu MCP Server

A Model Context Protocol server that enables users to automatically generate articles using large language models and publish them directly to Zhihu (a Chinese Q\&A platform).

Category
Visit Server

README

zh_mcp_server介绍

一种用于知乎发文章的模型上下文协议(MCP)服务器,使用者可以通过该服务与大模型自动生成文章并在知乎发文章。

使用方法

1. 环境配置前提

  • 方式1:

python版本要求 >= 3.10

配置环境要求满足 requirements.txt 文件的要求

  • selenium>=4.0.0
  • requests>=2.25.1
  • mcp>=0.1.0
  • webdriver-manager>=3.8.0 可以通过如下代码安装:
pip install -r requirements.txt

然后安装ChromeDriver,本项目依赖于谷歌浏览器,134.0.6998.166是版本号,需要手动查询使用者电脑上的谷歌浏览器版本

npx @puppeteer/browsers install chromedriver@134.0.6998.166
  • 方式2:

运行setup_environment.py,如果该方式失败则有可能是ChromeDriver版本不正确,建议以方式1重新安装

python setup_environment.py

2. 克隆代码

git https://github.com/Victorzwx/MCP_Server_ZhiHu.git

在该代码文件夹下运行初始化代码,保存个人cookie

python -m MCP_Server_ZhiHu.__login__
  • 注意运行后会自动打开谷歌浏览器
  • 在谷歌浏览器输入使用者的手机账号,然后点击获取验证码
  • 然后,将得到的验证码输入到Terminal,即运行python -m MCP_Server_ZhiHu.__login__的终端,这很重要!

3. 配置MCP服务

通过python的方式运行

"xhs_mcp_server": {
      "command": "python",
      "args": [
        "-m",
        "MCP_Server_ZhiHu"
      ]
 }

然后就可以使用了

如果是通过代码使用该MCP服务,如基于Spring AI的JAVA代码,还需要加上编码方式,以避免生成乱码:

"xhs_mcp_server": {
      "command": "D:\\aconda\\python.exe",
      "args": [
        "-m",
        "xhs_mcp_server",
        "--encoding=utf-8"
      ],
      "env": {
        "PYTHONIOENCODING": "utf-8"
      }
    }

调试

如果需要调试大模型调用该MCP服务时的具体过程或者可视化浏览器的操作,需要关闭无头浏览器模式,如下:

poster = ZhuHuPoster(path, headless=True)##如果要调试,请设置为False

代码位于server.py中

CSDN

本人CSDN账号

微信

image

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