
NAS容器上的MCP
概览
一个MCP服务器运行在Synology NAS上的容器中,允许代理(Claude Code、Claude Desktop)读取和管理一个NAS文件夹内的文件,这个文件夹。root之外的内容是看不到的。 - 工具:列表、统计、阅读(文本、PDF 文本、图片)、搜索(名称 glob + 可选内容 grep)、写入、编辑、mkdir、移动、删除。- 传输:可流式 HTTP http:// :/mcp,仅限局域网(通过 Tailscale 远程访问),一个静态承载令牌(ADR-0002)。- 代理从不真正删除任何内容:删除和覆盖的内容会进入根目录中的垃圾桶(ADR-0001)。- 词汇表(根、路径、垃圾、隐藏条目、破坏操作):GLOSSARY.md。 目标:DS220+(英特尔,linux/amd64),DSM 7.4.1,容器管理器。 你需要:DSM管理员权限,同一局域网上的Mac,以及NAS的LAN地址(控制面板>网络>网络接口)。这个README使用192.168.1.10作为占位符;在所有地方都替换你NAS的实际IP。不要使用路由器/默认网关IP(通常是x.x)。
概述(AI 翻译)
一个MCP服务器运行在Synology NAS的容器中,允许代理(Claude Code、Claude Desktop)读取和管理一个或多个NAS共享文件夹内的文件。每个都是挂载:每个路径起始的Root顶层文件夹(例如documents/notes/plan.md)。挂载可以是只读的。NAS上的其他内容都不可见。
- 工具:
list、stat、read(文本、PDF文本、图片)、search(名称块+可选内容grep)、write、edit、mkdir、move、delete。 - 传输:可在
http:// : /mcp进行可流式HTTP,仅限局域网(通过Tailscale远程访问),一个静态承载令牌(ADR-0002)。 - 代理从未真正删除任何内容:删除和覆盖的内容会进入其挂载(ADR-0001)中的垃圾桶文件夹。挂载:ADR-0003。
- 词汇(根、坐、路径、垃圾、隐藏入口、破坏性操作):GLOSSARY.md。
- 从 v1 升级(一个文件夹作为根节点):参见从 v1 迁移。
目标:DS220+(英特尔,linux/amd64),DSM 7.4.1,容器管理器。
Synology 的设置
你需要:DSM管理员权限,同一局域网的Mac,以及NAS的局域网IP地址(控制面板>网络>网络接口)。这个说明文件使用’192.168.1’。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
dreambig-nas-mcp
An MCP server that runs in a container on a Synology NAS and lets agents (Claude Code, Claude Desktop) read and manage files inside one or more NAS shared folders. Each is a Mount: a top-level folder of the Root that every Path starts with (e.g. documents/notes/plan.md). A Mount can be read-only. Nothing else on the NAS is visible.
- Tools:
list,stat,read(text, PDF text, images),search(name glob + optional content grep),write,edit,mkdir,move,delete. - Transport: Streamable HTTP at
http://:/mcp, LAN only (remote access via Tailscale), one static bearer token (ADR-0002). - Nothing is ever really deleted by an agent: deleted and overwritten content goes to a Trash folder inside its Mount (ADR-0001). Mounts: ADR-0003.
- Vocabulary (Root, Mount, Path, Trash, Hidden Entry, Destructive Operation): GLOSSARY.md.
- Upgrading from v1 (one folder as the Root): see Migrating from v1.
Target: DS220+ (Intel, linux/amd64), DSM 7.4.1, Container Manager.
Synology setup
You need: DSM admin access, a Mac on the same LAN, and the NAS’s LAN IP address (Control Panel > Network > Network Interface). This README uses 192.168.1.10 as a placeholder; substitute your NAS’s actual IP everywhere. Don’t use the router/default gateway IP (often x.x.x.1); it isn’t the NAS. Below, agents (read/write) and photos (read-only) are the example shared folders used as Mounts and nas-mcp the example DSM user; use your own names.
1. Choose or create the shared folders (Mounts)
For each folder agents should see:
- DSM > Control Panel > Shared Folder.
- Either pick an existing shared folder, or click Create > Create Shared Folder, name it (e.g.
agents), pick the volume (e.g. Volume 1), and finish the wizard (you can leave encryption and advanced options off). - Note its NAS path:
/volume1/agents(volume number + folder name). You can also use a sub-folder, e.g./volume1/agents/claude; the agent sees only what is mounted. - Decide its Mount name (the top-level folder agents see, e.g.
agents; letters, digits,-/_; not starting with.) and whether agents may change it (read/write) or only read it (read-only).
2. Create a dedicated DSM user
- Control Panel > User & Group > User > Create.
- Name:
nas-mcp. Set a long random password (nobody needs to log in as this user). Tick Disallow the user to change account password. Next. - Join groups: leave only
users. Next. - Assign shared folders permissions: tick Read/Write for each read/write Mount (e.g.
agents) and Read only for each read-only Mount (e.g.photos); tick No access for every other shared folder. Next. - Assign user quota: skip. Next.
安装
npx -y mcp-remote@latest http://192.168.1.10:8080/mcp --transport http-only --allow-http --header Authorization:${AUTH_HEADER}配置
{
"mcpServers": {
"nas": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"http://192.168.1.10:8080/mcp",
"--transport",
"http-only",
"--allow-http",
"--header",
"Authorization:${AUTH_HEADER}"
],
"env": {
"AUTH_HEADER": "Bearer <token>"
}
}
}
}