这是一个简单的局域网文件托管服务,允许在局域网内轻松共享和下载文件。特别适合用于下载和托管 Swagger/OpenAPI 文档等文本文件。
要通过 Smithery 为 Claude 桌面用户自动安装本地网络:
npx -y @smithery/cli install @prodzhang/localnetwork --client claude
npm install -g @prodzhang/localnetwork-mcp
npm install @prodzhang/localnetwork-mcp
- 文件上传和下载
- 从URL下载文件(特别适合Swagger/OpenAPI文档)
- 文件列表查看
- 文件删除
- 支持大文件(最大1GB)
- 跨域支持
- 简单的API接口
npx @prodzhang/localnetwork-mcp
或者如果全局安装了:
localnetwork-mcp
const server = require('@prodzhang/localnetwork-mcp');
// 服务器会自动在 23999 端口启动
服务器默认运行在 http://0.0.0.0:23999
GET /api/files
POST /api/upload
Content-Type: multipart/form-data
POST /api/download-url
Content-Type: application/json
{
"url": "http://example.com/file.json"
}
GET /api/files/:filename/content
GET /files/:filename
DELETE /api/files/:filename
curl -X POST -H "Content-Type: application/json" \
-d '{"url":"http://swagger.in.codoon.com/doc/online_race.json"}' \
http://localhost:23999/api/download-url
curl -F "file=@/path/to/your/file.txt" http://localhost:23999/api/upload
curl http://localhost:23999/api/files/file.json/content
curl -O http://localhost:23999/files/file.txt
直接访问 http://localhost:23999/files/filename 即可下载文件
- 默认端口为23999,可通过环境变量 PORT 修改
- 文件存储在项目根目录的 uploads 文件夹中
- 支持的最大文件大小为1GB
- URL下载功能支持任意文本文件,特别适合下载JSON、Swagger等文档
MIT