Metadata-Version: 2.4
Name: zhihu-mcp
Version: 0.3.0
Summary: MCP server for Zhihu — one typed tool per CLI command, plus the zhihu_help and zhihu_run escape hatches. A thin alias for zhihu-toolkit[mcp].
Author-email: KrisTHL181 <KrisTHL181@outlook.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/KrisTHL181/zhihu-cli
Project-URL: Repository, https://github.com/KrisTHL181/zhihu-cli
Project-URL: Issues, https://github.com/KrisTHL181/zhihu-cli/issues
Keywords: zhihu,知乎,mcp,mcp-server,ai-agent,claude
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: zhihu-toolkit[mcp]

# zhihu-mcp

<!-- mcp-name: io.github.KrisTHL181/zhihu-mcp -->

An [MCP](https://modelcontextprotocol.io) server that exposes [Zhihu](https://www.zhihu.com) — China's largest Q&A platform — to AI agents over stdio.

This package is a thin alias: it installs [`zhihu-toolkit[mcp]`](https://pypi.org/project/zhihu-toolkit/) and provides the `zhihu-mcp` executable. The server itself is implemented in `zhihu-toolkit`.

## Install

```bash
uvx zhihu-mcp          # run without installing
pip install zhihu-mcp  # or install it
```

Requires **Python 3.10+**.

## Use

Add the server to any MCP client (Claude Code, Claude Desktop, Cursor, …):

```json
{
  "mcpServers": {
    "zhihu": {
      "command": "zhihu-mcp"
    }
  }
}
```

Then ask, for example:

> Search Zhihu for articles about Rust async, pick three, and download them as Markdown.

The server exposes one typed tool per CLI command, each with a JSON Schema derived from that command's own parameters, plus the `zhihu_help` and `zhihu_run` escape hatches. The full surface consumes a lot of context; `zhihu-mcp --groups browse,search` narrows it to selected command subtrees.

Authentication is shared with the `zhihu` CLI. Log in once with `zhihu auth login`, `zhihu auth paste`, or `zhihu auth import`, and the MCP server uses the same profile.

## MCP Registry

The repository's `server.json` is the manifest for the [official MCP Registry](https://registry.modelcontextprotocol.io). Don't hand-edit its two `version` strings: the `publish-mcp.yml` workflow rewrites them from the tag-derived build version and uploads the result as the `mcp-registry-manifest` artifact. Publish from that artifact:

```bash
mcp-publisher login github
mcp-publisher publish
```

The version in the manifest must match a release that actually exists on PyPI, or the registry rejects the entry.

## Links

- Source, documentation, and the full command reference: <https://github.com/KrisTHL181/zhihu-cli>
- The underlying toolkit: [`zhihu-toolkit`](https://pypi.org/project/zhihu-toolkit/)

MIT licensed. Unofficial project, not affiliated with Zhihu.
