pocketbase-mcp
Allows managing a self-hosted PocketBase instance: list, get, create, update, and delete records (including bulk atomic batches via the Batch API), inspect and modify collection schemas (create/update/delete collections, add or drop fields), and audit collection API rules and field exposure risks by severity. All writes go through a preview-and-confirm two-step process, with a read-only mode available.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pocketbase-mcpaudit the permissions of the users collection"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
An MCP server that lets Claude manage a self-hosted PocketBase instance: query and edit records, inspect and change collection schemas, and audit API rules, with a confirmation step before anything is written.
What you can ask
"In the
postscollection, translate everycontentfield from French to English."
"Audit the permissions of the
userscollection."
"Add a
publishedbool field toarticlesand set it to true for every article created this year."
"Find an illustration of a house and add it to a new
postsrecord as its cover."
"Summarize the PDF attached to invoice
x7k2m9."
Claude reads what it needs, shows you a preview of every change, and only writes once you approve.
Related MCP server: PocketBase MCP Server
Quick start
Requires Node.js 20+ and a PocketBase 0.23+ instance (tested against 0.40). The server authenticates as a superuser.
git clone https://github.com/aymeridev/pocketbase-mcp.git
cd pocketbase-mcp
npm install
npm run buildClaude Desktop
Open Settings → Developer → Edit Config and add:
{
"mcpServers": {
"pocketbase": {
"command": "node",
"args": ["/absolute/path/to/pocketbase-mcp/dist/index.js"],
"env": {
"PB_URL": "https://pb.example.com",
"PB_SUPERUSER_EMAIL": "admin@example.com",
"PB_SUPERUSER_PASSWORD": "your-password"
}
}
}
}Restart Claude Desktop, then ask "Check my PocketBase health" to verify the connection.
Claude Code
claude mcp add pocketbase \
-e PB_URL=https://pb.example.com \
-e PB_SUPERUSER_EMAIL=admin@example.com \
-e PB_SUPERUSER_PASSWORD=your-password \
-- node /absolute/path/to/pocketbase-mcp/dist/index.jsCreate a dedicated superuser for the MCP server so you can revoke it independently.
Safety
Every write goes through three layers:
Read-only mode. With
PB_READ_ONLY=true, write tools are not exposed to the model at all.Client approval. Write tools carry MCP annotations (
readOnlyHint: false,destructiveHintfor deletions and schema changes), so Claude asks before running them.Two-step confirmation. The first call to a write tool changes nothing: it returns a preview (field-by-field diff, records affected, fields that would be dropped) and a single-use
confirmationToken. The operation runs only when the tool is called again with that token and the exact same arguments. Tokens expire after 5 minutes.
File tools only touch one local folder (PB_FILES_DIR, ~/Downloads/pocketbase-mcp by default): uploads from a local path must be inside it, and downloads are saved there without overwriting existing files.
Bulk edits go through pb_batch, so a translation over 50 records is one preview and one approval, not 50.
Tools
Tool | Kind | Description |
| read | Check the instance is reachable and credentials work |
| read | List records with filter, sort, pagination, expand, fields |
| read | Get one record |
| write | Create a record |
| write | Update fields of a record (preview shows before/after) |
| destructive | Delete a record |
| destructive | Many create/update/upsert/delete operations at once |
| read | Collections with their type and fields |
| read | Full schema: fields, indexes, rules, auth options |
| write | Create a collection |
| destructive | Change a collection (preview lists dropped fields) |
| destructive | Delete a collection and its records |
| read | URLs of a record's files, with an access token for protected fields and optional thumbnails |
| read | Show an image, read a text file or PDF, or save any file to the local folder |
| write | Upload files from a local path, a URL or base64, to an existing or new record |
| destructive | Remove files from a file field (the record is kept) |
| read | Rank API rule and field exposure risks by severity |
pb_download_file returns png, jpeg, gif and webp images so Claude can see them, and text files and PDFs as text (up to 5 MB). Other formats and larger files are saved to PB_FILES_DIR instead.
pb_batch runs atomically in one transaction when the PocketBase Batch API is enabled (Settings → Application → Batch API) and the operation count fits its limit. Otherwise it runs operations one by one and reports failures individually; the preview tells you which mode applies.
Configuration
Variable | Default | Description |
| required | Base URL of the PocketBase instance. Use the final URL (e.g. |
| Superuser email | |
| Superuser password | |
| Alternative to email/password: a superuser auth token (not refreshed) | |
|
| Hide every write tool |
|
| Require the two-step confirmation for writes |
|
| Lifetime of a confirmation token |
|
| The only local folder file tools read uploads from and save downloads to |
Development
npm run dev # run from source with tsx
npm run typecheck
npm run test:unit
# integration tests against a throwaway PocketBase on :8090
scripts/test-pocketbase.sh
PB_TEST_URL=http://127.0.0.1:8090 PB_TEST_EMAIL=admin@example.com PB_TEST_PASSWORD=password123456 npm run test:integrationLicense
This server cannot be deployed
Maintenance
Related MCP Connectors
Manage PocketBase Cloud projects, instances, deploys, domains, collections and records.
Manage FireCMS Cloud from an AI agent: Firestore data, collections, schemas and users.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Your Supabase account in natural language: run SQL, apply migrations, manage tables, storage, edge f
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables AI assistants and MCP clients to interact with PocketBase databases for authentication, data management, and administrative operations.8 npm65MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to manage PocketBase databases with comprehensive CRUD, authentication, file management, backup, and hook operations through a standardized protocol.8 npm5MIT
- AlicenseCqualityDmaintenanceEnables Claude to fully manage self-hosted Supabase instances, covering authentication, database, storage, edge functions, and more.423MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform CRUD operations on Pocketbase collections, manage authentication, and query logs via a type-safe API.15 npmISC