lan-media-server

TotalClaw 作者 totalclaw

通过 HTTP 将 AI 工作区中的图像、屏幕截图和文件共享给本地网络上的用户。当代理需要向用户显示图像、浏览器屏幕截图或任何文件并且当前频道不支持内联媒体(例如网络聊天、CLI)时使用。在 LAN 上启动一个轻量级 Node.js 静态文件服务器,由 systemd 管理。将文件拖放到共享目录中并向用户发送可单击的 URL。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~nagellack5c-lan-media-server
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~nagellack5c-lan-media-server/file -o nagellack5c-lan-media-server.md
## 概述(中文)

通过 HTTP 将 AI 工作区中的图像、屏幕截图和文件共享给本地网络上的用户。当代理需要向用户显示图像、浏览器屏幕截图或任何文件并且当前频道不支持内联媒体(例如网络聊天、CLI)时使用。在 LAN 上启动一个轻量级 Node.js 静态文件服务器,由 systemd 管理。将文件拖放到共享目录中并向用户发送可单击的 URL。

## 原文

# LAN Media Server

Lightweight HTTP file server for sharing agent-generated media (screenshots, images, documents) with users on the local network.

## Why

Many AI assistant channels (webchat, CLI, SSH) can't display inline images. This skill solves that by serving files over HTTP on your LAN — drop a file, send a link.

## Quick Start

```bash
bash scripts/setup.sh
```

This creates the shared directory, installs the server script, creates a systemd user service, and starts it.

**Default config:**
- Port: `18801`
- Serve directory: `$HOME/projects/shared-media`
- Accessible at: `http://<LAN_IP>:18801/<filename>`

Override with environment variables:
```bash
MEDIA_PORT=9090 MEDIA_ROOT=/tmp/media bash scripts/setup.sh
```

## Usage Pattern

When you need to show an image or file to the user:

1. Save/copy the file to the shared media directory
2. Send the user a link: `http://<server-LAN-IP>:<port>/<filename>`

Example for browser screenshots:
```bash
cp /path/to/screenshot.jpg ~/projects/shared-media/my-screenshot.jpg
# Then send: http://192.168.1.91:18801/my-screenshot.jpg
```

Use descriptive filenames — the directory is flat and user-visible.

## Management

```bash
# Check status
systemctl --user status media-server

# Restart
systemctl --user restart media-server

# View logs
journalctl --user -u media-server -f

# Stop and disable
systemctl --user stop media-server
systemctl --user disable media-server
```

## Security Notes

- Serves files only on LAN (0.0.0.0 but typically behind NAT)
- No authentication — don't put sensitive files in the shared directory
- Path traversal is blocked (files must be under MEDIA_ROOT)
- No directory listing — must know the exact filename