---
name: rustpress
description: "Builds, converts and debugs themes and plugins for RustPress, a WordPress-compatible publishing system written in Rust, and runs RustPress sites. Use when asked to create or fix a RustPress theme or plugin (plugin.json, plugin.js, PHP, Python, Rust/WebAssembly), use meta boxes, roles, WP_Query, background jobs or AI tools in a plugin, call the RustPress REST API or MCP server, use the rp command line, host a site, or move a WordPress site to RustPress."
---

# RustPress

The published RustPress docs are the source of truth. Fetch the page for the task before writing code.

- All docs in one file: https://rustpress.witsberry.com/llms-full.txt
- Index: https://rustpress.witsberry.com/llms.txt

## Docs pages

- Docs: https://rustpress.witsberry.com/docs.md  
  RustPress documentation: install and host a site, move from WordPress, build themes and plugins in any language, work with AI agents, MCP and the REST API. Updated for 0.1.5.
- What’s new: https://rustpress.witsberry.com/whats-new.md  
  RustPress 0.1.5 keeps the page cache full on Tailwind themes. 0.1.4 brought plugins that do what WordPress plugins do, dependencies, background jobs, private files, MCP tools and built-in SEO.
- Getting started: https://rustpress.witsberry.com/getting-started.md  
  Install rp with one command, start a site with rp serve, finish the setup wizard and find your way around the site folder and admin.
- Install and update: https://rustpress.witsberry.com/install-and-update.md  
  Install RustPress on Linux, macOS or Windows, choose SQLite, MySQL, MariaDB or PostgreSQL, update without downtime, go back a version, or build from source.
- Moving from WordPress: https://rustpress.witsberry.com/moving-from-wordpress.md  
  Move a WordPress site to RustPress by importing an export file or running on the existing database, plus what happens to themes, plugins and passwords.
- Themes: https://rustpress.witsberry.com/themes.md  
  How RustPress themes work: style.css header, Jinja-style templates, template hierarchy, child themes, theme options, Tailwind v4 and converting WP themes.
- Plugins: https://rustpress.witsberry.com/plugins.md  
  How RustPress plugins work: one JSON protocol, JavaScript, WebAssembly, PHP, Python and HTTP runtimes, permissions, scope, dependencies, plugin tables and Rust builds.
- Plugin API: https://rustpress.witsberry.com/plugin-api.md  
  Reference for RustPress plugins: dependencies, meta boxes, roles, rewrite rules, templates, blocks, scripts, WP_Query, $wpdb, HTTP calls, private files, cookies, hooks between plugins, SEO and cache hooks.
- Background jobs: https://rustpress.witsberry.com/background-jobs.md  
  Scheduled posts, email, WP-Cron events and plugin background jobs run inside rp serve with retries and a breaker. No cron job needed, except on shared hosting.
- AI agents: https://rustpress.witsberry.com/ai-agents.md  
  AI agents in the RustPress admin: providers, abilities, ready-made roles, skills, the chat, guard rails and how agents work as a team.
- MCP and AI tools: https://rustpress.witsberry.com/mcp-and-ai-tools.md  
  Your RustPress site as an MCP server over stdio or HTTP, AI apps connecting with scoped keys or OAuth, plugins adding AI tools, agents using other services’ MCP tools, and supported CLI agents.
- Headless and REST API: https://rustpress.witsberry.com/headless-and-rest-api.md  
  Use RustPress headless with Next.js, Astro or SvelteKit: the WordPress-shaped REST API, auth, headless mode, CORS, signed webhooks and previews.
- Hosting: https://rustpress.witsberry.com/hosting.md  
  Put a RustPress site online: where it runs, a Linux server with systemd and HTTPS (Caddy or nginx), Docker, Render, Railway, Fly.io, shared hosting with FastCGI, Windows and macOS.
- Running a site: https://rustpress.witsberry.com/running-a-site.md  
  Day-to-day RustPress: email, the site address, AI agent setup, logs, backups and restoring, automatic cleanup, the security checklist and troubleshooting.
- Configuration: https://rustpress.witsberry.com/configuration.md  
  Every rp-config.toml setting and environment variable, the site folder layout, databases and connection strings, and the signals a running server understands.
- Performance: https://rustpress.witsberry.com/performance.md  
  How RustPress stays fast: a full-page cache that stays correct, a CDN with Cloudflare purging, Redis, Valkey or Memcached, compression, plugin scope, OPcache and background jobs.
- Safety and limits: https://rustpress.witsberry.com/safety-and-limits.md  
  RustPress security measures, plugin permissions, crash isolation, auto-rollback, safe mode, logs, signed updates and what is not in this version.
- Command reference: https://rustpress.witsberry.com/command-reference.md  
  Every rp command in one place: run and update the site, import and export content, manage themes, plugins, database, cache, users and AI tools.

## Reference files

- Plugin protocol (PROTOCOL.md): https://github.com/Witsberry/RustPress/blob/main/bundled/sdk/PROTOCOL.md
- JavaScript SDK source: https://github.com/Witsberry/RustPress/blob/main/bundled/sdk/js/wp-plugin.js
- README: https://github.com/Witsberry/RustPress/blob/main/README.md
- Releases: https://github.com/Witsberry/RustPress/releases

## How to work

1. Read the docs page for the task before writing code (Plugin API reference for plugin features). Do not guess APIs: if a function is not in the docs or the SDK, it does not exist.
2. Plugins: sandboxed JavaScript (runtime "js") is the default and needs nothing installed. Use PHP for ported WordPress plugins, Node or Python only for outside libraries, and Rust/WebAssembly for code that runs on every page. Sandboxed calls have a time budget: keep heavy work out of page requests (background jobs, or let the core do it).
3. Since 0.1.4 plugins have meta boxes, roles and capabilities, rewrite rules, settings pages drawn by the core, editor blocks, scripts and styles, WP_Query (query_posts), $wpdb and dbDelta (limited to the plugin's own tables and read-only content), HTTP calls, private files and background jobs, in all four SDKs. Large plugins built deep on WordPress internals (WooCommerce, Elementor) still do not run unmodified.
4. Declare the fewest permissions (content:read, content:write, options, users, site, network with a host list) and a scope, so the plugin only runs where it is needed.
5. Declare hard dependencies with "requires" / Requires Plugins (with a minimum version) and check optional ones with isPluginActive. Talk to other plugins only through hooks named with their slug and REST routes, never their tables, options or files.
6. Data that grows goes in plugin tables (wp.db / rp_db_*), not options; always page queries with a limit. Slow or failing work (APIs, bulk sends) goes in background jobs (rp.queue.push / wp_rs_queue_push / Action Scheduler) with attempts and backoff. Files go in private plugin files, handed out only after the plugin's own checks.
7. Escape all output, sanitise all input, and check capability and a nonce before anything changes data. Changing requests with cookies need same-site origin or a CSRF token.
8. AI tools: wp.registerAiTool with risk "read" or "draft" for safe tools and "ask" (the default) for anything that changes the live site; validate input and return only what the agent needs.
9. Themes: MiniJinja templates in templates/ and parts/ (parts/base.html with {% block main %}), the WordPress template hierarchy, theme-options.json for anything the owner should be able to change. Never print meta descriptions, Open Graph, JSON-LD or favicons: the core prints them from Settings › SEO.
10. If the docs do not cover something, say so instead of inventing it, and point to the Plugin protocol reference file.
