zh_mcp_server介绍
一种用于知乎发文章的模型上下文协议(MCP)服务器,使用者可以通过该服务与大模型自动生成文章并在知乎发文章。
使用方法
1. 克隆代码
git https://github.com/Victorzwx/zh_mcp_server.git
2. 环境配置前提
建议在Windows环境下运行
python版本要求 >= 3.10
- 方式1:
配置环境要求满足 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
3.保存个人cookie
在该代码文件夹下运行保存cookie的代码:
python -m zh_mcp_server.__login__
- 注意运行后会自动打开谷歌浏览器
- 在谷歌浏览器输入使用者的手机账号,然后点击获取验证码
- 然后,将得到的验证码输入到Terminal,即运行python -m zh_mcp_server.__login__的终端,这很重要!
4. 在MCP客户端(如Cherry Studio)配置MCP服务
通过python的方式运行
"zh_mcp_server": {
"command": "python",
"args": [
"-m",
"zh_mcp_server"
]
}
然后就可以使用了
如果是通过代码使用该MCP服务,如基于Spring AI的JAVA代码,还需要加上编码方式,以避免生成乱码:
"zh_mcp_server": {
"command": "D:\\aconda\\python.exe",
"args": [
"-m",
"zh_mcp_server",
"--encoding=utf-8"
],
"env": {
"PYTHONIOENCODING": "utf-8"
}
}
调试
如果需要调试大模型调用该MCP服务时的具体过程或者可视化浏览器的操作,需要关闭无头浏览器模式,如下:
poster = ZhuHuPoster(path, headless=True)##如果要调试,请设置为False
代码位于server.py中
CSDN
微信
Metadata
Release files for iflow-mcp_zh_mcp_server 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iflow_mcp_zh_mcp_server-0.1.0.tar.gz | 2.9 kB | Without provenance | Details for iflow_mcp_zh_mcp_server-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iflow_mcp_zh_mcp_server-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for iflow_mcp_zh_mcp_server-0.1.0-py3-none-any.whl |
Total release size: 6.0 kB
Release files / iflow_mcp_zh_mcp_server-0.1.0.tar.gz
| Download URL | iflow_mcp_zh_mcp_server-0.1.0.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4bc2ef337465880c13059db154130b01c63917bb3bec1cec67a7ce9f7889fe8
|
|
BLAKE2b-256 checksum How to use checksums |
1ae85cee7c20ddeb7a726386b5e105d06cd9ddbaefa974d9c1f22b17797acaf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.8
|
Release files / iflow_mcp_zh_mcp_server-0.1.0-py3-none-any.whl
| Download URL | iflow_mcp_zh_mcp_server-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
394f495fde67b397c5afc9d4272c1a11c54957d4a9dd509027bd0ed82988a631
|
|
BLAKE2b-256 checksum How to use checksums |
96ba8e2214d5c2a0d5d89c502da80e80f218f03baf26cc05696fb9422fbcf458
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.8
|
Security for iflow-mcp_zh_mcp_server 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.