z-cli
This server provides a CLI and MCP-based interface for managing files, directories, and storage pools on a zspace NAS, exposing all capabilities to AI assistants via the Model Context Protocol.
File & Directory Management: List, create, rename, copy, move, and delete (to recycle bin) files and folders, with auto-rename on conflict.
File Search (
search_files): Search by name, type, size, and time, with filters for directory-only, hidden files, shared-only, and pagination/sorting.Recent Files (
list_recent_files): Retrieve a paginated list of recently accessed files.Storage Pool Info (
get_pool_info,get_pool_names): View storage pool details and name mappings.General HTTP Requests (
make_request): Send GET, POST, PUT, DELETE, or PATCH requests to any URL, with optional headers and JSON body.AI Assistant Integration: All functionality is exposed via a Model Context Protocol (MCP) server for use with AI assistants.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@z-clilist files in /sata12/my/data"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
概述
z-cli 是 zspace 私有云 NAS 的命令行工具,支持 CLI 和 MCP Server 两种使用方式。通过 MCP 协议接入 AI 助手后,可以用自然语言操控 NAS 上的文件和存储资源。
Related MCP server: zerodrive-mcp-server
功能特性
文件操作 — 列表、创建、重命名、移动、复制、删除(回收站)
目录管理 — 创建文件夹,支持冲突自动重命名
文件搜索 — 按名称/类型/大小/时间搜索,支持分页
存储池查询 — 查看存储池信息和名称映射
最近文件 — 获取最近访问文件列表
MCP Server — 通过 Model Context Protocol 暴露所有能力给 AI 助手
双模式运行 — 开发模式
./dev(热更新)与生产模式zcli
接入 Agent 示例
将 z-cli 的 MCP Server 接入 AI 助手(如 opencode、Claude Code)后,用户可以通过自然语言直接操控 NAS。
下图为自研的 NAS 助手 Agent z-agent 的演示:

快速上手
前置条件
macOS / Windows(认证模块从 zspace 桌面客户端本地数据目录读取凭据)
Python >= 3.10
zspace 桌面客户端已安装、登录,并保持在后台运行
安装
python -m venv .venv
source .venv/bin/activate
# Windows: .venv\Scripts\Activate.ps1
pip install -e .
# 验证
zcli poolCLI 模式
# 存储池
zcli pool
zcli poolname
# 文件操作
zcli list /sata12/my/data
zcli mkdir /sata12/my/data 新建文件夹
zcli create /sata12/my/data/文件.txt
zcli rename /sata12/my/data/旧名称 新名称
zcli copy /sata12/my/data/a /sata12/my/data/b
zcli move /sata12/my/data/a /sata12/my/data/sub/
zcli remove /sata12/my/data/无用文件.txt
# 搜索与最近文件
zcli search 关键词
zcli recent
# 启动 MCP Server
zcli mcpMCP 模式
推荐方式:pipx 全局安装
pipx install -e /path/to/zspace-cli然后在 AI 工具(如 opencode、Claude Code)中配置:
{
"mcp": {
"zspace-cli": {
"type": "local",
"command": ["zcli", "mcp"],
"enabled": true
}
}
}备选方式:项目虚拟环境
{
"mcp": {
"zspace-cli": {
"type": "local",
"command": [".venv/bin/python", "-m", "zspace", "mcp"],
"enabled": true
}
}
}注意:macOS 可能对
.venv下的文件自动设置隐藏标志,导致 Python 3.8+ 跳过__editable__的.pth文件(CPython #113659)。如果遇到ModuleNotFoundError: No module named 'zspace'错误,运行以下命令修复:xattr -rc .venv chflags -R 0 .venv
项目结构
z-cli/
├── .github/workflows/ # CI 配置
├── .claude/ # Claude 技能配置
├── src/zspace/
│ ├── api/ # NAS API 层
│ │ ├── fields.py # 字段映射
│ │ ├── file.py # 文件操作 API
│ │ └── pool.py # 存储池 API
│ ├── commands/ # CLI 子命令
│ │ ├── base.py # Command 基类
│ │ └── ... # 每个命令一个文件
│ ├── mcp/ # MCP 服务器
│ │ ├── base.py # McpTool 基类
│ │ └── tools/ # 每个工具一个文件
│ ├── auth.py # 登录凭据读取
├── tests/ # 测试
├── dev # 热更新运行脚本
├── Makefile # 常用开发命令
├── CHANGELOG.md # 变更日志
└── CONTRIBUTING.md # 贡献指南CLI 命令参考
命令 | 功能 | 示例 |
| 查看存储池信息 |
|
| 查看存储池名称映射 |
|
| 检查与本地代理的连通性 |
|
| 列出目录文件 |
|
| 创建文件夹 |
|
| 创建文件 |
|
| 读取文本文件内容 |
|
| 重命名 |
|
| 复制 |
|
| 移动 |
|
| 删除(回收站) |
|
| 搜索文件 |
|
| 最近文件 |
|
| 管理 AI skills(install/uninstall) |
|
| 启动 MCP Server |
|
MCP 工具列表
工具 | 功能 |
| 查看存储池信息 |
| 查看存储池名称映射 |
| 检查与本地代理的连通性 |
| 列出目录文件 |
| 创建文件夹 |
| 创建文件 |
| 读取文本文件内容 |
| 删除文件/文件夹(移至回收站) |
| 重命名 |
| 复制 |
| 移动 |
| 搜索文件 |
| 最近文件 |
存储池路径规则
访问文件路径格式为 /<pool_name>/my/data,其中 pool_name 是 pool 接口返回的 name 字段(如 sata12、sata14),不是 id 或系统挂载点。
配置
变量 | 说明 |
| 覆盖 zspace 本地代理地址,用于跨网络访问 |
开发
# 安装开发依赖
pip install -e ".[dev]"
# 热更新模式(改源码即生效)
./dev pool
# 代码检查
make lint
# 运行测试
make test致谢
本项目基于 skyzhao1223/zspace-cli 的构思与想法,重新实现并调整了架构。
许可证
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
AlicenseAqualityAmaintenanceCLI Builder AI - MCP server providing AI-powered tools and automation by MEOK AI LabsLast updated424MIT- AlicenseAqualityCmaintenanceA Model Context Protocol (MCP) server for ZeroDrive file management. It enables AI assistants like Claude to interact with ZeroDrive cloud storage through a standardized interface.Last updated28294MIT
- Flicense-qualityDmaintenanceMCP server for file and directory operations with enterprise-grade security, enabling autonomous AI development workflows.Last updated
- FlicenseCqualityCmaintenanceAn MCP server that exposes the Huawei Cloud CLI as a single tool for AI assistants to discover and execute commands interactively via --help navigation, with built-in safety for destructive operations.Last updated91
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/philipxiaoxi/z-cli'
If you have feedback or need assistance with the MCP directory API, please join our Discord server