pi-zai-mcp
Unofficial pi package that exposes Z.ai MCP server tools for web search, URL reading, repository reading, and vision workflows.
Package details
Install pi-zai-mcp from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-zai-mcp- Package
pi-zai-mcp- Version
0.2.6- Published
- Oct 13, 2026
- Downloads
- 1,367/mo · 697/wk
- Author
- fitchmultz
- License
- MIT
- Types
- extension
- Size
- 415 KB
- Dependencies
- 2 dependencies · 4 peers
Pi manifest JSON
{
"extensions": [
"./extensions/zai-mcp-search.ts",
"./extensions/zai-mcp-reader.ts",
"./extensions/zai-mcp-zread.ts",
"./extensions/zai-mcp-vision.ts",
"./extensions/zai-mcp-status.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-zai-mcp
pi-zai-mcp gives Pi four Z.AI tools: web search, page reader, public repository reader, and image/video analysis. Mitch Fultz maintains this unofficial Z.AI integration.

Install and start
Use Pi 1.0.0 or later. You need Node.js 22.19 or newer and a Z.AI API key with a compatible GLM Coding Plan.
pi install npm:pi-zai-mcp
export Z_AI_API_KEY="your_z_ai_api_key"
pi
You can also use a key stored through Pi's /login command. The extension accepts ZAI_API_KEY and ZAI_CODING_CN_API_KEY. Environment variables take precedence over stored keys. Global keys use Z.AI; the China alias, zai-coding-cn login and BigModel provider aliases use the separate BigModel services.
In Pi, enter:
Use z_ai_search to find the latest Node.js release notes.
Run /zai-mcp-status to check each service. Before first use, status is lazy_not_connected_until_first_use; it also distinguishes connecting, failed and disconnected services. Dropped or expired connections reconnect on the next explicit call, never by replaying the failed request. Each service connects lazily. Pi startup makes no paid tool calls.
See other install options for a temporary session or a GitHub install.
Tools
| Tool | Use |
|---|---|
z_ai_search |
Search the web with domain and recency filters. |
z_ai_reader |
Read a URL as Markdown or text. |
z_ai_zread |
Search public GitHub repositories, read files, or list directories. |
z_ai_vision |
Analyze screenshots, text, diagrams, charts, UI comparisons, images, or videos. |
See GLM model setup to configure the coding model.
Run pi config to enable or disable each tool. Keep extensions/zai-mcp-status.ts enabled for /zai-mcp-status.
Pi shows progress and compact results. Press Ctrl+O to expand a result. Large results and failure messages stop at 50 KB or 2,000 lines, plus a notice pointing to the full text in a private temporary file. Remove saved files when you no longer need them.
Limits and cost
Vision needs a local file path or HTTP/HTTPS URL. Relative paths resolve against the current Pi session directory, including in SDK sessions. Local images must be JPG, JPEG or PNG and at most 5 MiB. UI comparisons need both reference and actual screenshots. Local videos must use MP4, MOV or M4V format and be at most 8 MiB.
Zread can reject repositories that Z.AI has not indexed. Real tool calls require network access and consume your plan allowance. Check Z.AI's usage policy for current pricing.
Vision defaults to glm-5.3-flash with a 131,072-token output ceiling. Large outputs can increase cost. Set Z_AI_VISION_MODEL_MAX_TOKENS to reduce this ceiling.
If a call fails, run /zai-mcp-status. Check lastError, your API key, plan entitlement, and network connection. See the configuration reference for timeouts and vision settings.
Privacy
Pi extensions run with your user permissions. Review the code before installation. These tools send requests and visual input to Z.AI.
The extension stores no credentials. It passes only the selected Z.AI key, safe platform variables, and allowed settings to the vision server.
The vision server logs prompts and image paths under ~/.zai by default. Its stderr is discarded to prevent undrained logging from blocking or filling memory; this does not disable vendor file logging. Set ZAI_MCP_LOG_PATH to a private or non-persisting destination when needed. Cancellation closes the local vision process, but cannot guarantee stopped remote computation or billing. Treat retrieved pages and repository text as untrusted content.
Reference
- Tool and configuration reference: arguments, settings, data flow, and service limits.
- Development and maintenance: local setup, tests, code-quality policy, and releases.
- Changelog and dated Pi qualification results.
- Report a problem.
License
MIT — Mitch Fultz.