rustpad-mcp
Enables an AI assistant to read and collaboratively edit Rustpad pads via the Model Context Protocol, using operational transformation for clean concurrent edits with human collaborators.
README
rustpad-mcp
A Model Context Protocol server for Rustpad, the efficient, minimal, self-hosted collaborative text editor.
It gives an AI assistant read and write access to the pads of a Rustpad
instance. Reads go through Rustpad's HTTP API; writes speak the
operational-transformation WebSocket protocol, so targeted edits
(append_to_document, replace_in_document) merge cleanly with what human
collaborators type at the same time instead of overwriting it. While the
server edits a pad, it is visible to everyone in the pad as a collaborator
named rustpad-mcp.
📖 Full documentation at rustpad-mcp.ni-c.de

<picture> <source media="(prefers-color-scheme: dark)" srcset="https://rustpad-mcp.ni-c.de/architecture-dark.svg" /> <source media="(prefers-color-scheme: light)" srcset="https://rustpad-mcp.ni-c.de/architecture-light.svg" /> <img alt="Architecture: an MCP client talks to rustpad-mcp over stdio; rustpad-mcp reads pads over HTTPS and writes them over the WebSocket OT protocol" src="https://rustpad-mcp.ni-c.de/architecture.svg" /> </picture>
Requirements
- A reachable Rustpad instance (self-hosted; the server is stateless and needs no credentials — Rustpad has no authentication)
- Node.js >= 22, or Docker
Configuration
| Variable | Required | Description |
|---|---|---|
RUSTPAD_URL |
yes | Base URL of the instance, e.g. https://rustpad.example.net |
RUSTPAD_READ_ONLY |
no | true registers only the read tools |
RUSTPAD_INSECURE_TLS |
no | true accepts self-signed certificates (scoped to this connection only) |
The same URL serves the HTTP API, the WebSocket endpoint and the share links
returned by the tools (<RUSTPAD_URL>/#<pad-id>). Booleans must be exactly
true. The server starts and lists its tools without configuration; every
call then fails with setup instructions.
Keep in mind what Rustpad is: pads are ephemeral (lost on server restart
and after 24 hours of inactivity, unless the instance is run with
SQLITE_URI) and anyone who knows a pad id can read and write it. Do not
put secrets in pads.
Installation
Claude Code
claude mcp add rustpad --env RUSTPAD_URL=https://rustpad.example.net -- npx rustpad-mcp
Claude 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
Tools
| Tool | Description |
|---|---|
get_document |
Read the plain-text content of a pad |
get_document_info |
Content length, revision, language and the users editing right now |
get_stats |
Server statistics (uptime, number of documents) |
create_document |
Create a pad (random or chosen id), optionally with content and language |
set_document |
Replace the entire content — non-empty pads require a confirmation token |
append_to_document |
Append text; concurrent edits elsewhere survive |
replace_in_document |
Exact search & replace via OT; unique match required unless replace_all |
set_language |
Set the Monaco syntax-highlighting language |
With RUSTPAD_READ_ONLY=true only the first three are registered.
Safety
- Pad content is world-writable and therefore untrusted: every read result is prefixed with a marker telling the model to treat it as data, never as instructions.
- Replacing a non-empty pad is irreversible and guarded by a single-use confirmation token that only ever appears in a previous tool result.
- Tool results are size-capped; upstream error bodies are sanitized before they reach the model.
RUSTPAD_INSECURE_TLSrelaxes certificate validation only for the configured connection, never process-wide.
Development
npm install
npm run lint && npm run build && npm test
The test suite talks to an in-memory fake of rustpad-server (including OT
transformation of concurrent edits) over the real MCP protocol; no live
instance is needed. The architecture diagram and social card are generated —
edit docs/assets/architecture.source.svg and run npm run assets, never the
rendered copies.
Releasing
Releases are tag-driven. Bump package.json, move the [Unreleased] notes in
CHANGELOG.md under the new version, commit, then:
git tag -s vX.Y.Z -m "vX.Y.Z"
git push origin main vX.Y.Z
The release workflow publishes to npm via Trusted Publishing (OIDC, with provenance), pushes the multi-arch container image to GHCR, creates the GitHub release from the CHANGELOG section, and updates the entry in the official MCP registry.
License
MIT © Willi Thiel
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。