synology-chat-hermes-mcp
synology-chat-hermes-mcp
一个受限的 FastMCP HTTP 服务器,将固定的 Synology NAS SMB 共享以读/写文件工具的形式暴露给 AI 代理——内置严格的路径隔离、大小限制和活动内容拒绝机制。
最初作为家庭 Hermes 部署(控制代理 → MCP → SMB3 → NAS)的文件通道构建。适用于任何 MCP 客户端(Hermes、Claude 等)。
为什么存在
拥有文件访问权限的 AI 代理只有在访问受限时才是安全的。该服务器:
将每个路径隔离到一个固定共享(
NAS_SHARE)。在任何 SMB 调用之前拒绝路径穿越(..、绝对路径、符号链接/重解析点逃逸)。拒绝公网 WAN 服务器 —
NAS_SERVER必须是私有、链路本地或 Tailscale(100.64.0.0/10)字面 IP。拒绝 DNS 名称和公网 IP。从不存储凭据 — SMB 密码在启动时从 docker secret 文件中读取(
NAS_PASSWORD_FILE),绝不从环境变量或代码中读取。阻止活动内容 — DOCX/XLSX/PDF 写入器仅生成已净化的文档;二进制上传会扫描宏、外部关系和脚本;拒绝扩展名/媒体类型不匹配。
限制一切 — 文件大小、二进制大小、文档字符数、电子表格单元格、图像像素、搜索结果均有硬性限制。
审计操作 — 每个变更操作都会追加到 JSONL 审计日志中。
Related MCP server: MCP File System Server
架构
Hermes (or any MCP client)
→ HTTP :8000/mcp (FastMCP, streamable HTTP)
→ NasService (validation, limits, audit)
→ SMBBackend (smbprotocol, SMB3, encryption+signing required)
→ Synology NAS share工具
工具 | 说明 |
| SMB3 连接检查 |
| 列出共享下的目录 |
| 搜索路径下的文件名 |
| 读取大小受限的 UTF-8 文本文件 |
| 原子 UTF-8 写入(除非 |
| 经校验的 base64 写入(TXT/DOCX/XLSX/PDF/PNG/JPEG) |
| 从标题 + 纯文本/类似 Markdown 的文本生成安全 DOCX |
| 安全 XLSX(拒绝公式) |
| 静态 PDF(无脚本/链接/嵌入文件) |
| 从 TXT/MD/CSV/JSON/YAML/DOCX/XLSX/PDF 提取文本 |
| 创建目录(注意:一次创建一级 — |
| 在共享内移动 |
| 不含内容的元数据 |
已知限制: create_directory 在 makedirs 之前校验父目录,因此如果多级路径的第一个段不存在,即使使用 parents=True 也会返回 not_found。请一次创建一级。
快速开始
cp .env.example .env # set NAS_SERVER (Tailscale/private IP), NAS_USERNAME
# provide the SMB password as a docker secret:
printf '%s' 'YOUR_SMB_PASSWORD' > ./synology_password
chmod 600 ./synology_password
docker build -t nas-mcp .
docker run -d --name nas-mcp \
--env-file .env \
-v "$PWD/synology_password:/run/secrets/synology_password:ro" \
-v nas-mcp-audit:/var/log/nas-mcp \
-p 8000:8000 \
nas-mcp健康检查:
curl -X POST http://127.0.0.1:8000/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"health","arguments":{}}}'Hermes MCP 配置
mcp_servers:
nas-mcp:
type: http
url: http://nas-mcp:8000/mcp运行测试
python -m nas_mcp.smoke # exercises the full tool chain against the live share环境变量参考
变量 | 必填 | 默认值 | 说明 |
| ✅ | — | 仅限私有/Tailscale 字面 IP |
| ✅ | — | 固定共享名称,运行时强制 |
| ✅ | — | 共享级 SMB 用户 |
|
| Docker secret 路径 | |
|
| ||
|
| 需要 SMB3 加密 | |
|
| 需要 SMB3 签名 | |
|
| ||
|
| ||
|
| ||
|
| ||
|
| ||
|
| ||
|
| ||
|
| ||
|
| ||
|
|
安全说明
SMB 密码是系统中唯一的机密,它仅存在于 docker secret 文件中。没有硬编码任何内容;除非机密的调优值外,
.env中不会以明文存储任何内容(且.env已被 git 忽略)。在生产环境中绑定到私有接口;不要公开暴露
:8000。共享名称和 SMB 用户是配置项(
NAS_SHARE、NAS_USERNAME)——按部署设置即可;代码中不假设特定值。
许可证
MIT
This server cannot be installed
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
- Alicense-qualityCmaintenanceProvides a secure, constrained filesystem workspace for LLM agents to manage files, notes, and code artifacts via stdio or remote HTTP. It features granular access controls, including extension whitelisting, storage quotas, and immutable paths for safe automated file operations.BSD 3-Clause
- Flicense-qualityCmaintenanceA secure, sandboxed file system server that enables reading, writing, searching, and managing files through MCP-compatible AI clients with path traversal protection and size limits.
- Alicense-qualityBmaintenanceExposes local file system operations to AI assistants via Streamable HTTP with security features like auth, path whitelisting, and audit logging.2,8841MIT
- FlicenseAqualityBmaintenanceMCP server enabling AI agents to manage and monitor Synology NAS via official DSM API, including file operations, system stats, backups, downloads, and camera lists.15
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
File uploads for AI agents. Upload, list, and manage files. No signup required.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
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/shunnnnn-png/synology-chat-hermes-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server