Skip to main content
Glama
ntanhprt

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: vnsh-mcp

安装

只需克隆本仓库——无需下载整个 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".

ParametersJSON Schema
NameRequiredDescriptionDefault
pathsYesAbsolute file or folder paths on this machine to upload. Folders are uploaded recursively.
titleNoTitle shown on the share card
passwordNoPassword required to open the share link
senderNameNoName of the sender shown to recipients
ttlMinutesNoMinutes until the share expires; omit for no expiry
descriptionNoDescription shown on the share card

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It clearly states the upload side-effect and the nature of the return value, but it does not disclose potential caveats such as file size limits, authentication requirements, or whether an existing share is reused or a new one is created. The UI-equivalence note adds value, but behavioral disclosure remains basic.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that immediately states the action and outcome. Every phrase earns its place, and there is zero filler or repetition of schema field names.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema, so the description's mention of the returned share link is valuable for understanding what to expect. With six parameters well-documented in the schema and a straightforward purpose, the description is complete enough for an agent to use the tool, though it could add edge-case behavior (e.g., handling of inaccessible paths).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the description rightfully leaves parameter details to the schema. The only parameter-related hint in the description is 'one or more files/folders', which mirrors the 'paths' array. This adds no meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb ('Uploads'), a clear resource ('one or more files/folders from this machine to Pshare'), and a concrete outcome ('returns the same share link a user would get'). It fully distinguishes the tool's purpose even without sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context by equating the tool's output to the UI 'Share' action, implying when to use it: whenever a user would upload files via the Pshare interface. It does not explicitly mention exclusions or alternatives, but with no sibling tools, this is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 1 tool updatev1.0.0
    • First observedpshare_upload

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

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    Enables AI assistants to manage Microsoft SharePoint documents and folders through natural language, supporting operations like listing, reading, uploading, updating, deleting, and creating Office files.
    13
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables sharing and reading encrypted files (text, images, logs) for AI workflows, with automatic 24-hour expiration and host-blind security.
    74 npm
    156
    MIT
  • 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
  • F
    license
    A
    quality
    B
    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
    -