shareone-mcp
shareone-mcp
面向「数据提交」的无状态 Model Context Protocol 服务:把 ShareOne 的文本页 / 二进制 / 远程源 / 元数据更新封装成 4 个 MCP 工具,并附带可被 npx skills 发现的 Agent Skill。
基于 TypeScript + @modelcontextprotocol/sdk + Zod + Express,Node.js 20+,使用原生 fetch / Buffer,内存优先,不引入 Sudowork 代理、交互式绑定、二维码或评论监听。
npm 包:@online2311/shareone-mcp
安装
1) MCP(推荐:npx)
在 Cursor / Claude Desktop / 其他 MCP 客户端的配置里:
{
"mcpServers": {
"shareone": {
"command": "npx",
"args": ["-y", "@online2311/shareone-mcp"],
"env": {
"SHAREONE_API_KEY": "your_api_key_here"
}
}
}
}Cursor 也可显式加上 "type": "stdio"。默认传输为 stdio;仅在需要 HTTP 时设置 MCP_TRANSPORT=http。
可选环境变量:SHAREONE_BASE_URL(默认 https://s.shareone.vip)。
2) Agent Skill(npx skills add)
仓库布局符合 Vercel skills CLI:skills/shareone-mcp/SKILL.md(frontmatter 含 name / description)。
# 从 GitHub(合并到 main 后)
npx skills add online2311/shareone-mcp
# 指定 skill / agent / 非交互
npx skills add online2311/shareone-mcp --skill shareone-mcp -a cursor -y
# 全局安装
npx skills add online2311/shareone-mcp -g --skill shareone-mcp -y也支持本地路径:npx skills add ./path/to/shareone-mcp --skill shareone-mcp -a cursor -y。
3) 两者配合
用上面的
mcp.json拉起@online2311/shareone-mcp,并设置SHAREONE_API_KEY。用
npx skills add online2311/shareone-mcp把使用指引装进 Agent。Agent 按 skill 路由意图,实际动作走 MCP 的 4 个 tools;也可读取 MCP prompt
shareone_usage或 resourceshareone://docs/skill。
Related MCP server: Share HTML
工具
工具 | 作用 |
| 文本/页面通道 |
| 二进制三段式上传(credential → 直传 → confirm),必要时 multipart 回退 |
|
|
| 更新密码 / 水印 / slug / 开关; |
另暴露:
Prompt:
shareone_usageResource:
shareone://docs/skill(与skills/shareone-mcp/SKILL.md同文)
环境变量
变量 | 说明 | 默认 |
| ShareOne API Key(请求头 | 必填(调用工具时) |
| API 根地址 |
|
|
|
|
| HTTP 绑定地址 |
|
| HTTP 端口 |
|
| 可选;设置后 | 空 |
stdio 传输的读缓冲默认提高到 24 MiB(SDK 默认 10 MiB),以便略超 16 MiB 的页面提交能返回 PAYLOAD_TOO_LARGE,而不是直接断开连接。
快速开始(开发)
cp .env.example .env
# 编辑 .env,填入 SHAREONE_API_KEY
npm install
npm run build
npm test
# stdio(默认)
SHAREONE_API_KEY=... npm start
# HTTP
MCP_TRANSPORT=http SHAREONE_API_KEY=... npm run start:httpHTTP 模式
监听:
POST http://127.0.0.1:3100/mcpexpress.jsonlimit:25mb无状态:每个请求新建
McpServer+StreamableHTTPServerTransport(sessionIdGenerator: undefined)
curl -sS http://127.0.0.1:3100/healthz协议要点(已对照 sudoprivacy/shareone-skill)
鉴权头:
X-API-Key页面正文字段名:
html_content(不是content/html)自定义短链字段:
custom_slug文本页扩展:
.html/.md/.txt,UTF-8 最大 16 MiB新建页默认
allow_comments: false(与 skill 脚本一致)二进制:
POST /api/v1/files/credential→ azurePUT(x-ms-blob-type: BlockBlob)或 s3 multipart POST →POST /api/v1/files/confirm有
Idempotency-Key,或直传返回 400 且包含Direct upload is only supported...时,回退POST /api/v1/filesmultipart远程刷新:
POST /api/v1/pages/{share_id}/refresh元数据:先 pages;404 或 skill 中的 400「only for HTML/Markdown…」时回退
/api/v1/files/{share_id}工具失败:
isError: true,并原样透传 ShareOne JSON 错误体(含error_code/detail)
与完整 skill 默认值的差异
项 |
| 本服务 |
默认 |
|
|
能力面 | 发布/下载/评论/账号/协作者/二维码等 | 仅数据提交四通道 + 元数据 |
元数据回退 | 已知前缀策略 | auto:page/裸 ref 先 pages,404 或 400 文案再回退 files |
开发
npm run typecheck
npm test
npm run build测试使用 mock fetch,不发起真实线上调用。
真实 API 冒烟测试
npm run build
export SHAREONE_API_KEY=your_api_key_here
npm run test:liveLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Publish HTML, Markdown, and multi-file sites as shareable URLs instantly via MCP.
Publish permanent static sites via MCP/REST. 28 tools. No account or claim link.
List, share, upload, and manage Slideless HTML presentations from any MCP host.
Remote MCP for JSON repair, hashing, formatting, IDs, dates, units, and other small tools.
Related MCP Servers
AlicenseAqualityAmaintenancePublish content (HTML, files, or URLs) and get a permanent public URL from any MCP-compatible agent, with local and remote connection options.29244 npmMIT- FlicenseNot gradedqualityCmaintenanceEnables sharing self-contained HTML files via public or access-key-protected private links. Provides MCP tools to create shares, retrieve public share metadata, and describe the service.6-
- AlicenseNot gradedqualityBmaintenanceEnables managing unlisted share pages and raw files on Vercel Blob through MCP tools, allowing file uploads, share creation, updates, and deletion via any MCP client.1MIT
- AlicenseAqualityCmaintenanceEnables MCP clients to upload local files, create default 24-hour controlled download links, and list, inspect, or permanently delete owned files and shares via a dedicated API key.51Apache 2.0