PocketBase MCP Server
Provides full administrative control over a PocketBase instance via its admin API: managing collections (create, update, delete, truncate, import, scaffolds), CRUD and batch operations on records, authentication flows (password auth, impersonation, email verification, password reset, email change), file token/URL generation, request logs and statistics, application settings and email/S3 tests, backups (create, restore, download, upload), cron job listing and triggering, health checks, and a raw request escape hatch for any PocketBase endpoint.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
PocketBase MCP Server
A Model Context Protocol (MCP) server for managing a PocketBase instance from chat. Works with Claude Desktop, Cursor, OpenCode, and any MCP-compatible client.
Features
Auto-login: Authenticates as superuser on startup and refreshes tokens automatically
30+ tools covering the full PocketBase admin API:
Collections: list, get, create, update, delete, truncate, import, scaffolds
Records: list, get, create, update, delete, batch operations
Auth: password auth, impersonation, verification, password reset, email change
Files: file token generation, URL building
Logs: list, get, stats, truncate
Settings: get/update settings, test email, test S3
Backups: list, create, delete, restore, download, upload
Crons: list, run
System: health check
Raw request: escape hatch for any PocketBase API endpoint
Token refresh: Automatically re-authenticates on 401/403 errors
Local test setup: Docker-based PocketBase instance with e2e tests
Related MCP server: PocketBase MCP Server
Quick Start
1. Install dependencies
npm install2. Build the server
npm run build3. Configure your MCP client
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"pocketbase": {
"command": "node",
"args": ["/absolute/path/to/pocketbase-mcp/dist/index.js"],
"env": {
"POCKETBASE_URL": "http://127.0.0.1:8090",
"POCKETBASE_SUPERUSER_EMAIL": "admin@example.com",
"POCKETBASE_SUPERUSER_PASSWORD": "your-password"
}
}
}
}Cursor
Create .cursor/mcp.json in your project:
{
"mcpServers": {
"pocketbase": {
"command": "node",
"args": ["/absolute/path/to/pocketbase-mcp/dist/index.js"],
"env": {
"POCKETBASE_URL": "http://127.0.0.1:8090",
"POCKETBASE_SUPERUSER_EMAIL": "admin@example.com",
"POCKETBASE_SUPERUSER_PASSWORD": "your-password"
}
}
}
}OpenCode
Add to opencode.json in your project or ~/.config/opencode/config.json globally:
{
"mcp": {
"pocketbase": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/pocketbase-mcp/dist/index.js"],
"env": {
"POCKETBASE_URL": "http://127.0.0.1:8090",
"POCKETBASE_SUPERUSER_EMAIL": "admin@example.com",
"POCKETBASE_SUPERUSER_PASSWORD": "your-password"
}
}
}
}VS Code
Create .vscode/mcp.json:
{
"inputs": [
{
"type": "promptString",
"id": "pocketbase-email",
"description": "PocketBase superuser email",
"password": false
},
{
"type": "promptString",
"id": "pocketbase-password",
"description": "PocketBase superuser password",
"password": true
}
],
"servers": {
"pocketbase": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/pocketbase-mcp/dist/index.js"],
"env": {
"POCKETBASE_URL": "http://127.0.0.1:8090",
"POCKETBASE_SUPERUSER_EMAIL": "${input:pocketbase-email}",
"POCKETBASE_SUPERUSER_PASSWORD": "${input:pocketbase-password}"
}
}
}
}Environment Variables
Variable | Required | Description |
| Yes | PocketBase instance URL (e.g. |
| Yes | Superuser email for auto-login |
| Yes | Superuser password |
| No | Request timeout in milliseconds (default: |
Available Tools
Collections
list_collections— List all collections (paginated)get_collection— Get a single collection by name or IDcreate_collection— Create a new collection (base, auth, or view)update_collection— Update an existing collectiondelete_collection— Delete a collection and all its recordstruncate_collection— Delete all records (keeps schema)import_collections— Bulk import collectionslist_collection_scaffolds— Get default collection templates
Records
list_records— List records with filtering, sorting, paginationget_record— Get a single record by IDcreate_record— Create a new recordupdate_record— Update an existing recorddelete_record— Delete a recordbatch_records— Batch create/update/upsert/delete in one transaction
Authentication
list_auth_methods— List allowed auth methods for a collectionauth_with_password— Authenticate a user with email/username + passwordimpersonate_user— Impersonate an auth record (superuser only)request_verification— Send email verification requestconfirm_verification— Confirm email verificationrequest_password_reset— Send password reset emailconfirm_password_reset— Confirm password resetrequest_email_change— Request email changeconfirm_email_change— Confirm email change
Files
get_file_token— Generate a short-lived file access tokenbuild_file_url— Build a public file URL for a record's file field
Logs
list_logs— List request logs (paginated)get_log— Get a single log entrylog_stats— Get hourly aggregated log statisticstruncate_logs— Delete all logs
Settings
get_settings— Get all application settings (secrets redacted)update_settings— Update application settingstest_email— Send a test emailtest_s3— Test S3 storage connection
Backups
list_backups— List all backup filescreate_backup— Create a new backupdelete_backup— Delete a backuprestore_backup— Restore a backup (restarts PocketBase)get_backup_download_url— Generate a download URLupload_backup— Upload a backup file
Crons
list_crons— List all registered cron jobsrun_cron— Manually trigger a cron job
System
health_check— Check PocketBase API health
Raw
raw_request— Send a raw HTTP request to any PocketBase API endpoint
Local Development
Run with MCP Inspector
npm run inspectThen open http://localhost:5173 in your browser to interactively test tools.
Run the server directly
POCKETBASE_URL=http://127.0.0.1:8090 \
POCKETBASE_SUPERUSER_EMAIL=admin@test.local \
POCKETBASE_SUPERUSER_PASSWORD=password123 \
npm run devLocal Test Setup
The test/local/ directory contains a Docker-based PocketBase instance for testing:
cd test/local
docker compose up -d
./setup.shThis starts PocketBase on http://127.0.0.1:8090 with:
Email: admin@test.local
Password: SuperSecret123!
Run the e2e test suite:
cd ../..
npm run test:e2eSee test/local/README.md for details.
Docker
Build and run with Docker:
docker build -t pocketbase-mcp .
docker run -i --rm \
-e POCKETBASE_URL=http://host.docker.internal:8090 \
-e POCKETBASE_SUPERUSER_EMAIL=admin@example.com \
-e POCKETBASE_SUPERUSER_PASSWORD=your-password \
pocketbase-mcpUse host.docker.internal to access PocketBase running on your host machine.
Architecture
TypeScript + Node 22 — modern, type-safe
@modelcontextprotocol/server v2 — latest MCP SDK with
registerTool()APINative fetch — no PocketBase SDK dependency, explicit token management
Auto-login + refresh — authenticates on startup, re-auths on 401/403
stdio transport — works with all MCP clients (Claude Desktop, Cursor, OpenCode, etc.)
License
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
Manage PocketBase Cloud projects, instances, deploys, domains, collections and records.
The agent-native cloud: database, functions, AI, storage, computers. 53 tools. OAuth or API key.
Hosted Airtable MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables Claude to manage a self-hosted PocketBase instance: querying and editing records, inspecting and changing collection schemas, handling files, users and backups, and auditing API rules for exposure risks. Writes are gated by a read-only mode plus a two-step confirmation that returns a preview diff and single-use token, so nothing changes until the identical call is approved.18 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to perform advanced database operations and schema management against PocketBase instances via the Model Context Protocol. Supports collection creation, record CRUD, user authentication and management, and database backups.18 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with PocketBase databases through the Model Context Protocol, providing tools for collection management, CRUD record operations, user authentication, and database backups.18 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with PocketBase databases through the Model Context Protocol for collection schema management, record CRUD with filtering and pagination, user authentication, and database backups.18 npmISC