Skip to main content
Glama
pshare-share-mcp

pshare-share-mcp

by ntanhprt

pshare-share-mcp

MCP 服务器允许任何 AI(Claude Code、Claude Desktop 或其他 MCP 客户端)将文件/文件夹上传到 Pshare 并获取分享链接——与手动操作完全一致:通过 UI 上传,然后点击 Share 按钮复制链接。

无需任何登录/令牌——与 Pshare 当前的架构保持一致(Web 客户端本身也没有真正的身份验证,只使用一个自动生成的 X-Browser-Id)。

要求:已经有一个 Pshare 实例在某个地方运行(localhost 或局域网内)——本仓库只是一个调用 Pshare REST API 的 MCP 服务器,不会自行运行 Pshare。

提供的工具

pshare_upload

字段

必填

描述

paths

✅

运行 MCP 服务器的机器上的绝对路径数组(文件或文件夹)。文件夹会递归上传,保持子目录结构不变。

title

❌

分享卡片上显示的标题

senderName

❌

显示给接收者的发送者名称

password

❌

打开分享链接所需的密码

description

❌

分享卡片上显示的描述

ttlMinutes

❌

链接存在的分钟数;留空 = 永不过期

返回结果:形如 http://<pshare-host>/?share=<N> 的分享链接,附带文件数量和密码状态。

大于 90MB 的文件会自动切换为分块上传(与 Web 客户端的局域网上传行为一致),无需额外关心。

Related MCP server: mcp_file_manager

安装

只需克隆本仓库——无需下载整个 Pshare:

git clone https://github.com/ntanhprt/Pshare-mcp.git
cd Pshare-mcp
pnpm install
pnpm build      # biên dịch ra dist/

配置(环境变量)

变量

默认值

描述

PSHARE_BASE_URL

http://localhost:5173

MCP 将调用以进行上传/分享的 Pshare 服务器 URL

PSHARE_MCP_HOST

0.0.0.0

运行 HTTP transport 时绑定的主机

PSHARE_MCP_PORT

7317

运行 HTTP transport 时的端口

PSHARE_MCP_ALLOWED_HOSTS

(未设置)

允许的主机列表,用逗号分隔,用于在绑定 0.0.0.0 时启用 DNS 重绑定保护

localhost 仅在 MCP 服务器运行在运行 Pshare 的同一台机器上时才正确。 localhost 始终指向“正在运行该进程的机器本身”——因此,如果你将本 MCP 安装在运行 Pshare 的机器不同的机器/笔记本电脑上(即使在同一局域网内),则必须将其改为运行 Pshare 的机器的真实 IP。例如,如果 Pshare 运行在 IP 为 192.168.3.7 的机器上:

PSHARE_BASE_URL=http://192.168.3.7:5173 claude mcp add pshare-share -- node "$(pwd)/dist/index.js"

仅当你在运行 Pshare 的同一台机器上直接运行 MCP(stdio)时,才保留默认的 localhost。

独立试运行

# stdio (mặc định)
pnpm start

# HTTP/SSE — AI ở máy khác trong LAN cũng gọi được
pnpm start:http
# → nghe tại http://<PSHARE_MCP_HOST>:<PSHARE_MCP_PORT>/mcp

给其他开发者的集成指南

1. 与 Claude Code 一起使用(stdio transport——当 AI 与 Pshare 运行在同一台机器/主机上时推荐)

克隆并构建之后(参见上面的安装部分),在 Pshare-mcp 目录内:

claude mcp add pshare-share -- node "$(pwd)/dist/index.js"

如果希望指向另一台机器上的 Pshare,请通过 -e 传递环境变量(参见配置部分中关于 localhost 的说明):

claude mcp add pshare-share \
  -e PSHARE_BASE_URL=http://192.168.3.7:5173 \
  -- node "$(pwd)/dist/index.js"

检查是否已注册:

claude mcp list

2. 与 Claude Desktop 一起使用(stdio transport)

打开配置文件(macOS 上为 ~/Library/Application Support/Claude/claude_desktop_config.json,Windows 上为 %APPDATA%\Claude\claude_desktop_config.json)并添加:

{
  "mcpServers": {
    "pshare-share": {
      "command": "node",
      "args": ["/đường/dẫn/tuyệt/đối/tới/Pshare-mcp/dist/index.js"],
      "env": {
        "PSHARE_BASE_URL": "http://localhost:5173"
      }
    }
  }
}

重启 Claude Desktop 以获取 pshare_upload 工具。

3. 通过 HTTP/SSE 使用(当 AI 运行在同一局域网内的另一台机器上时)

在托管 Pshare 的机器(或任何可以访问 Pshare 的机器)上运行 MCP 服务器:

PSHARE_BASE_URL=http://localhost:5173 pnpm start:http

在客户端机器上(Claude Code 或任何支持 HTTP transport 的 MCP 客户端),指向:

http://<IP-máy-chạy-mcp>:7317/mcp

例如使用 Claude Code:

claude mcp add --transport http pshare-share http://192.168.3.7:7317/mcp

4. 与任何其他 AI/Agent 框架一起使用

MCP 是标准的 JSON-RPC 协议——任何 MCP 客户端(LangChain MCP adapter、自定义 agent 等)都可以连接,只需:

  • stdio:执行 node dist/index.js 命令并通过 stdin/stdout 通信。

  • HTTP:按照 MCP 的 Streamable HTTP transport 规范调用 POST http://<host>:<port>/mcp。

安全注意事项

此 MCP 服务器不进行身份验证——任何能够调用它的人(通过 stdio,如果有权限运行进程;或通过 HTTP,如果能访问 host:port)都可以将文件上传/分享到真实的 Pshare。这与 Pshare 本身保持一致(上传/分享 API 上没有身份验证),但在将 HTTP transport 暴露到局域网之外时需要特别注意。

Available Tools

1 tool
pshare_uploadUpload to Pshare and get a share linkA

Uploads one or more files/folders from this machine to Pshare (LAN file sharing) and returns the same share link a user would get by uploading through the UI and clicking "Share".

Inputs: paths (required), title, password, senderName, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only a single tool, there is no possibility of confusion or overlap. The tool's purpose is clearly unique by virtue of being the only one.

    Naming Consistency5/5

    A single tool name cannot be inconsistent with itself. 'pshare_upload' uses a clear prefix plus verb structure, and there are no other names to compare against.

    Tool Count2/5

    A one-tool server for a file-sharing service feels too thin. While the tool covers the upload action, the apparent scope of 'share' implies at least download or retrieval functionality, making a single tool insufficient.

    Completeness2/5

    The tool surface is severely limited to uploading. There are no tools for downloading, listing, deleting, or managing shares, which means agents have no way to complete a full sharing workflow.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to securely transfer files between machines via encrypted, expiring share links, with tools for upload, download, status checks, and link management.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents and users to upload and download files via MCP, generating shareable links and identifier codes. Files are automatically deleted after 24 hours.
      9
      MIT
    • F
      license
      A
      quality
      B
      maintenance
      Enables AI agents to split large files, zips, or folders into size-capped parts with SHA-256 checks, verify or regenerate missing parts, and rebuild the original across platforms so handoffs respect strict per-file upload limits.
      8
      1
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to privately store files and create controlled share links with expiry, open limits, recipient restrictions, approval gates, revocation, and access logging.
      MIT