# MCP 参考文件系统服务器 - 工作区范围的文件操作 (`filesystem-sandbox-mcp`)

> 官方模型上下文协议参考服务器提供真实路径验证的文件读取、原子行编辑、目录树和全局搜索。

- **Canonical URL:** https://syndipath.com/zh/mcp/filesystem-sandbox-mcp
- **Runtime:** `npm` | **Transport:** STDIO | **License:** MIT | **Package:** `@modelcontextprotocol/server-filesystem`
- **Upvotes:** 946 | **GitHub Stars:** 9840 | **Weekly Installs:** 94300
- **Security Note:** HTTP-200 在 NPM 注册中心（@modelcontextprotocol/server-filesystem）上验证；通过 npx 在工作区范围的 STDIO 会话中运行。

## Quick CLI Setup
```bash
# Run directly via Node npx
npx -y @modelcontextprotocol/server-filesystem /path/to/allowed/workspace

# Add to Claude Code CLI
claude mcp add filesystem-sandbox-mcp -- npx -y @modelcontextprotocol/server-filesystem /path/to/allowed/workspace
```

## MCP Manifest (`mcp.json`)
```json
{
  "mcpServers": {
    "filesystem-sandbox-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/allowed/workspace"
      ]
    }
  }
}
```

## Exposed MCP Tools
- `filesystem_sandbox_mcp_execute(query: string, options?: object)`: Official Model Context Protocol reference server providing realpath-validated file reads, atomic line edits, directory trees, and glob .
- `filesystem_sandbox_mcp_list_items(filter?: string, limit?: number)`: Lists structured workspace artifacts and capability metadata over JSON-RPC 2.0.
