rustpad-mcp
rustpad-mcp
一个 Model Context Protocol 服务器,用于 Rustpad —— 一款高效、极简、自托管的协作式文本编辑器。
它让 AI 助手能够读取和写入某个 Rustpad 实例中的便签(pad)。读取操作通过 Rustpad 的 HTTP API 进行;写入操作则使用操作变换(OT)WebSocket 协议,因此定向编辑(append_to_document、replace_in_document)能够与人类协作者同时输入的内容干净地合并,而不是将其覆盖。当服务器编辑某个便签时,它会以名为 rustpad-mcp 的协作者身份出现在该便签中,对所有人可见。

系统要求
一个可访问的 Rustpad 实例(自托管;该 MCP 服务器无状态,且不需要任何凭据——Rustpad 没有认证机制)
Node.js >= 22,或 Docker
Related MCP server: SSH MCP Server
配置
变量 | 必填 | 说明 |
| 是 | 实例的基础 URL,例如 |
| 否 | 为 |
| 否 | 为 |
同一个 URL 同时用于 HTTP API、WebSocket 端点和工具返回的分享链接(<RUSTPAD_URL>/#<pad-id>)。布尔值必须严格为 true。服务器无需配置即可启动并列出其工具;此后每次调用都会失败并返回设置指引。
请牢记 Rustpad 的本质:便签是临时的(服务器重启后会丢失,闲置 24 小时后也会丢失,除非实例通过 SQLITE_URI 运行),并且任何知道便签 id 的人都可以读取和写入它。不要将机密信息放进便签中。
安装
Claude Code
claude mcp add rustpad --env RUSTPAD_URL=https://rustpad.example.net -- npx rustpad-mcpClaude Desktop
{
"mcpServers": {
"rustpad": {
"command": "npx",
"args": ["rustpad-mcp"],
"env": {
"RUSTPAD_URL": "https://rustpad.example.net"
}
}
}
}Codex
~/.codex/config.toml:
[mcp_servers.rustpad]
command = "npx"
args = ["-y", "rustpad-mcp"]
[mcp_servers.rustpad.env]
RUSTPAD_URL = "https://rustpad.example.net"Docker
docker run -i --rm -e RUSTPAD_URL=https://rustpad.example.net ghcr.io/ni-c/rustpad-mcp工具
工具 | 说明 |
| 读取便签的纯文本内容 |
| 内容长度、修订版本、语言以及当前正在编辑的用户 |
| 服务器统计信息(运行时间、文档数量) |
| 创建一个便签(随机或指定的 id),可选指定内容和语言 |
| 替换整个内容——非空便签需要确认令牌 |
| 追加文本;其他位置的并发编辑不会被覆盖 |
| 通过 OT 进行精确查找与替换;除非使用 |
| 设置 Monaco 语法高亮语言 |
当 RUSTPAD_READ_ONLY=true 时,只会注册前三个工具。
安全
便签内容对所有人可写,因此不可信:每个读取结果都会带有前缀标记,告知模型将其视为数据,绝不视为指令。
替换非空便签是不可逆的,受一次性确认令牌保护;该令牌只会出现在之前的工具结果中。
工具结果有大小上限;上游错误响应在到达模型之前会被净化处理。
RUSTPAD_INSECURE_TLS仅对配置的连接放宽证书校验,绝不会影响整个进程。
开发
npm install
npm run lint && npm run build && npm test测试套件通过真实的 MCP 协议与 rustpad-server 的内存版模拟实现(包括对并发编辑的 OT 变换)进行交互,无需真实实例。架构图和社会卡片(social card)都是生成的——请编辑 docs/assets/architecture.source.svg 并运行 npm run assets,切勿直接修改渲染后的副本。
发布
发布由标签(tag)驱动。更新 package.json 的版本号,将 CHANGELOG.md 中 [Unreleased] 的记录移到新版本下,提交,然后:
git tag -s vX.Y.Z -m "vX.Y.Z"
git push origin main vX.Y.Z发布工作流通过 Trusted Publishing(OIDC,带 provenance)发布到 npm,将多架构容器镜像推送到 GHCR,根据 CHANGELOG 中的对应部分创建 GitHub release,并更新官方 MCP 注册表中的条目。
许可证
MIT © Willi Thiel
Maintenance
Related MCP Servers
- Alicense-qualityAmaintenanceA Model Context Protocol server that enables AI assistants like Claude to read from, append to, and format text in Google Documents programmatically.3,704637MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to execute SSH commands and perform token-efficient file operations on remote servers via the Model Context Protocol.58111MIT
- AlicenseBqualityDmaintenanceEnables AI-powered document automation and data manipulation with Coda.io through the Model Context Protocol, supporting document, page, table, row, and formula operations.266MIT
- FlicenseBqualityCmaintenanceEnables AI agents to interact with Overleaf projects directly, including creating projects, managing files, and editing documents in real-time using Overleaf's native Operational Transformation protocol.10
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
The team layer for AI coding agents: shared contracts, collision alerts, E2EE sessions.
MCP-native collaborative markdown editor with real-time AI document editing
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ni-c/rustpad-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server