pocketbase-mcp-bridge
v1.0.0Complete Model Context Protocol (MCP) server for PocketBase — collections, records, auth, files, logs, settings, backups, crons and more.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
health_check Health check
Check the PocketBase API health status. Does not require authentication. Returns the server code, message and health data.
auth_info Authentication info
Return information about the current MCP authentication: PocketBase URL, the auth collection used, whether the token is valid, and the identity (id/email) of the authenticated superuser or user. The raw token is never exposed.
list_collections List collections
List collections (database tables / schemas) with pagination, filtering and sorting. Includes system collections such as _superusers, _authOrigins, etc. Filter example: 'type = "auth"'. Sort example: '-created'.
| Parameter | Type | Description |
|---|---|---|
fields | string | Comma-separated list of fields to return. |
filter | string | PocketBase filter expression, e.g. 'type = "base"'. |
page | integer | Page number (default 1). |
perPage | integer | Items per page (default 100). |
sort | string | Sort expression, e.g. '-created,name'. |
get_collection Get collection
Fetch a single collection by its id or name, including its full field schema, rules and indexes.
| Parameter | Type | Description |
|---|---|---|
idOrName * | string | Collection id or name. |
fields | string | Comma-separated list of fields to return. |
get_collection_scaffolds Get collection scaffolds
Return default collection templates (scaffolds) for each collection type (base, auth, view). Useful as a starting point before calling create_collection — copy a scaffold, adjust the name and fields, then create it.
create_collection Create collection
Create a new collection. Provide `name` and `type` ('base', 'auth' or 'view'). Use `data` for the rest of the collection payload: `fields` (array of field definitions), API rules (listRule, viewRule, createRule, updateRule, deleteRule — string or null), `indexes` (array of CREATE INDEX statements), `viewQuery` (for view collections), and auth options for auth collections. Tip: call get_collection_scaffolds first to see the expected shape. Example field: { "name": "title", "type": "text", "required": true }. IMPORTANT (PocketBase 0.23+): 'created'/'updated' timestamps are NOT added automatica…
| Parameter | Type | Description |
|---|---|---|
name * | string | Collection name. |
data | object | Rest of the collection payload (fields, rules, indexes, viewQuery, auth options...). |
type | string | Collection type (default 'base'). |
update_collection Update collection
Update an existing collection by id or name. Provide the fields to change in `data`. To modify the schema, pass the full `fields` array (existing field ids must be preserved to keep data). You can also update rules, indexes and options.
| Parameter | Type | Description |
|---|---|---|
data * | object | Partial collection payload with the properties to update. |
idOrName * | string | Collection id or name. |
delete_collection Delete collection
Permanently delete a collection and ALL of its records. This cannot be undone.
| Parameter | Type | Description |
|---|---|---|
idOrName * | string | Collection id or name to delete. |
import_collections Import collections
Bulk import collections from an array of collection definitions (as exported from the PocketBase admin UI). When `deleteMissing` is true, collections not present in the import list are deleted — use with caution. This is the recommended way to apply a full schema in one call.
| Parameter | Type | Description |
|---|---|---|
collections * | array | Array of collection definition objects. |
deleteMissing | boolean | If true, delete collections not present in the list (default false). |
truncate_collection Truncate collection
Delete ALL records of a collection while keeping the collection/schema itself. Cannot be undone.
| Parameter | Type | Description |
|---|---|---|
idOrName * | string | Collection id or name to truncate. |
list_records List records
List records of a collection with pagination, filtering, sorting and relation expansion. Filter supports operators like =, !=, >, <, ~ (contains), and functions. Example filter: 'status = "active" && created > "2024-01-01"'. Use `expand` to inline related records (e.g. 'author,comments_via_post'). Set `skipTotal` to true for faster queries when you don't need the total count.
| Parameter | Type | Description |
|---|---|---|
collection * | string | Collection id or name. |
expand | string | Comma-separated relations to expand. |
fields | string | Comma-separated fields to return (supports :excerpt modifiers). |
filter | string | PocketBase filter expression. |
page | integer | Page number (default 1). |
perPage | integer | Items per page (default 30). |
skipTotal | boolean | Skip counting total items for performance. |
sort | string | Sort expression, e.g. '-created,title'. |
get_full_record_list Get full record list
Fetch ALL records matching a filter, auto-paginating in batches. Use for exports or small/medium collections. Prefer list_records with pagination for large datasets to avoid huge responses.
| Parameter | Type | Description |
|---|---|---|
collection * | string | Collection id or name. |
batch | integer | Records per underlying request (default 200). |
expand | string | Comma-separated relations to expand. |
fields | string | Comma-separated fields to return. |
filter | string | PocketBase filter expression. |
sort | string | Sort expression. |
get_record Get record
Fetch a single record by id, optionally expanding relations and selecting specific fields.
| Parameter | Type | Description |
|---|---|---|
collection * | string | Collection id or name. |
id * | string | Record id. |
expand | string | Comma-separated relations to expand. |
fields | string | Comma-separated fields to return. |
get_first_record Get first matching record
Return the first record matching a filter expression (throws if none found). Convenient for lookups like 'email = "a@b.com"'.
| Parameter | Type | Description |
|---|---|---|
collection * | string | Collection id or name. |
filter * | string | PocketBase filter expression to match. |
expand | string | Comma-separated relations to expand. |
fields | string | Comma-separated fields to return. |
create_record Create record
Create a new record in a collection. Pass field values in `data`. For auth collections, include 'password' and 'passwordConfirm' (and usually 'email'). To upload files, list them in `files` (each maps a field name to a local file path). Relation fields accept a record id or an array of ids.
| Parameter | Type | Description |
|---|---|---|
collection * | string | Collection id or name. |
data | object | Field values for the new record. |
expand | string | Comma-separated relations to expand in the response. |
fields | string | Comma-separated fields to return. |
files | array | Optional list of local files to upload into file fields. |
update_record Update record
Update an existing record by id. Only the fields present in `data` are changed. To append to a multi-relation/file/select field use the '+' modifier as a key (e.g. { "tags+": "id" }); to remove use 'field-'. Upload files via `files`.
| Parameter | Type | Description |
|---|---|---|
collection * | string | Collection id or name. |
id * | string | Record id to update. |
data | object | Field values to update. |
expand | string | Comma-separated relations to expand in the response. |
fields | string | Comma-separated fields to return. |
files | array | Optional list of local files to upload into file fields. |
delete_record Delete record
Permanently delete a single record by id. Cannot be undone.
| Parameter | Type | Description |
|---|---|---|
collection * | string | Collection id or name. |
id * | string | Record id to delete. |
batch Batch operations (transactional)
Execute multiple record operations in a single transactional request. All operations succeed or all are rolled back. Each operation has an `action` ('create' | 'update' | 'delete' | 'upsert'), a target `collection`, and depending on the action a `data` object and/or record `id`. For 'upsert', include the record 'id' inside `data` (creates if missing, updates if present). Note: the Batch API must be enabled in PocketBase settings (Settings > Batch API).
| Parameter | Type | Description |
|---|---|---|
operations * | array | List of operations to run atomically. |
auth_with_password Authenticate a user (password)
Authenticate an end user against an auth collection with their identity (email/username) and password. Returns the auth token and the user record. Does not affect the MCP's own superuser session. Useful to obtain a token to act on behalf of a user or to verify credentials.
| Parameter | Type | Description |
|---|---|---|
identity * | string | Email or username. |
password * | string | User password. |
collection | string | Auth collection (default 'users'). |
expand | string | Comma-separated relations to expand on the record. |
list_auth_methods List auth methods
List the available authentication methods for an auth collection: whether password/OTP auth is enabled and the configured OAuth2 providers (Google, GitHub, etc.).
| Parameter | Type | Description |
|---|---|---|
collection | string | Auth collection (default 'users'). |
impersonate Impersonate a user
Generate an auth token for an existing user without their password (superuser only). Returns a non-refreshable token valid for the given duration, useful to make API calls on behalf of a user.
| Parameter | Type | Description |
|---|---|---|
recordId * | string | Id of the user record to impersonate. |
collection | string | Auth collection (default 'users'). |
duration | integer | Token lifetime in seconds (default: collection auth token duration). |
request_verification Request email verification
Send a verification email to a user of an auth collection (requires SMTP configured).
| Parameter | Type | Description |
|---|---|---|
email * | string | User email address. |
collection | string | Auth collection (default 'users'). |
confirm_verification Confirm email verification
Confirm a user's email verification using the token from the verification email.
| Parameter | Type | Description |
|---|---|---|
token * | string | Verification token. |
collection | string | Auth collection (default 'users'). |
request_password_reset Request password reset
Send a password reset email to a user (requires SMTP configured).
| Parameter | Type | Description |
|---|---|---|
email * | string | User email address. |
collection | string | Auth collection (default 'users'). |
confirm_password_reset Confirm password reset
Set a new password using the reset token from the password reset email.
| Parameter | Type | Description |
|---|---|---|
password * | string | New password. |
passwordConfirm * | string | New password confirmation (must match). |
token * | string | Password reset token. |
collection | string | Auth collection (default 'users'). |
request_otp Request OTP (one-time password)
Send a one-time password email to a user and return the otpId needed to complete auth_with_otp (requires SMTP and OTP auth enabled on the collection).
| Parameter | Type | Description |
|---|---|---|
email * | string | User email address. |
collection | string | Auth collection (default 'users'). |
auth_with_otp Authenticate with OTP
Complete OTP authentication using the otpId (from request_otp) and the code the user received.
| Parameter | Type | Description |
|---|---|---|
code * | string | The one-time code received by the user. |
otpId * | string | The otpId returned by request_otp. |
collection | string | Auth collection (default 'users'). |
confirm_email_change Confirm email change
Confirm a user's email change using the token from the confirmation email and the user's password.
| Parameter | Type | Description |
|---|---|---|
password * | string | The user's current password. |
token * | string | Email change token. |
collection | string | Auth collection (default 'users'). |
list_external_auths List external auth providers
List the OAuth2 providers linked to a specific user record (superuser only).
| Parameter | Type | Description |
|---|---|---|
recordId * | string | User record id. |
collection | string | Auth collection (default 'users'). |
unlink_external_auth Unlink external auth provider
Remove a linked OAuth2 provider from a user record (superuser only).
| Parameter | Type | Description |
|---|---|---|
provider * | string | Provider name (e.g. 'google', 'github'). |
recordId * | string | User record id. |
collection | string | Auth collection (default 'users'). |
list_superusers List superusers
List superuser (admin) accounts from the built-in _superusers collection.
| Parameter | Type | Description |
|---|---|---|
filter | string | Filter expression, e.g. 'email ~ "@example.com"'. |
page | integer | Page number (default 1). |
perPage | integer | Items per page (default 100). |
sort | string | Sort expression, e.g. '-created'. |
create_superuser Create superuser
Create a new superuser (admin) account. Provide email and password. The new superuser has full administrative access to the instance.
| Parameter | Type | Description |
|---|---|---|
email * | string | Superuser email. |
password * | string | Superuser password (min 8 chars). |
passwordConfirm | string | Password confirmation (defaults to password). |
update_superuser Update superuser
Update a superuser account (e.g. change email or reset the password). To change the password, include both 'password' and 'passwordConfirm' in `data`.
| Parameter | Type | Description |
|---|---|---|
data * | object | Fields to update (email, password, passwordConfirm, ...). |
id * | string | Superuser record id. |
delete_superuser Delete superuser
Delete a superuser (admin) account by id. At least one superuser must always remain.
| Parameter | Type | Description |
|---|---|---|
id * | string | Superuser record id to delete. |
get_file_url Get file URL
Build the public URL for a file stored in a record's file field. For image files you may request a thumbnail via `thumb` (e.g. '100x100', '100x100t', '0x100'). For protected files (collection with a non-public file field), set `protected` to true to embed a short-lived access token.
| Parameter | Type | Description |
|---|---|---|
collection * | string | Collection id or name. |
filename * | string | Stored file name (the value of the file field). |
recordId * | string | Record id. |
download | boolean | Force a download (Content-Disposition attachment). |
protected | boolean | Embed a file access token for protected files. |
thumb | string | Thumbnail size, e.g. '100x100', '0x100', '100x100t'. |
get_file_token Get file access token
Generate a short-lived file access token used to access protected files by appending it as a `?token=...` query parameter to a file URL.
download_file Download file
Download a record file to a local path on the machine running this MCP server. Handles protected files automatically by requesting an access token.
| Parameter | Type | Description |
|---|---|---|
collection * | string | Collection id or name. |
destPath * | string | Local filesystem path to write the downloaded file to. |
filename * | string | Stored file name. |
recordId * | string | Record id. |
protected | boolean | Set true for protected files (embeds a token). |
thumb | string | Optional thumbnail size for images. |
list_logs List logs
List application request/activity logs with pagination, filtering and sorting (superuser only). Filter example: 'level >= 4 && data.status >= 400'. Sort defaults to newest first.
| Parameter | Type | Description |
|---|---|---|
filter | string | Filter expression over log fields (level, message, data.*). |
page | integer | Page number (default 1). |
perPage | integer | Items per page (default 50). |
sort | string | Sort expression (default '-created'). |
get_log Get log
Fetch a single log entry by its id (superuser only).
| Parameter | Type | Description |
|---|---|---|
id * | string | Log entry id. |
get_logs_stats Get logs statistics
Return hourly aggregated log statistics, optionally filtered. Useful to chart request volume or error rates. Filter example: 'level = 0'.
| Parameter | Type | Description |
|---|---|---|
filter | string | Filter expression to scope the statistics. |
get_settings Get settings
Fetch all instance settings (app name/url, SMTP, S3 storage, S3 backups, batch API, rate limits, trusted proxy, OAuth2 secrets are redacted). Superuser only.
update_settings Update settings
Bulk update instance settings. Provide only the sections you want to change in `data`. Examples: { "meta": { "appName": "My App", "appURL": "https://example.com" } }, { "smtp": { "enabled": true, "host": "smtp.example.com", "port": 587, "username": "...", "password": "..." } }, { "batch": { "enabled": true, "maxRequests": 50 } }. Superuser only.
| Parameter | Type | Description |
|---|---|---|
data * | object | Partial settings object with the sections to update. |
test_s3 Test S3 connection
Perform an S3 filesystem connection test for either 'storage' or 'backups'. Superuser only.
| Parameter | Type | Description |
|---|---|---|
filesystem | string | Which S3 filesystem to test (default 'storage'). |
test_email Send a test email
Send a test email to verify SMTP configuration. Choose a template: 'verification', 'password-reset' or 'email-change'. Superuser only. Requires SMTP to be configured.
| Parameter | Type | Description |
|---|---|---|
toEmail * | string | Recipient email address. |
collection | string | Auth collection to use for the template (default 'users'). |
template | string | Email template to test (default 'verification'). |
generate_apple_client_secret Generate Apple client secret
Generate a new Apple OAuth2 client secret (JWT) from your Apple developer credentials. Superuser only.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Apple Services ID (client id). |
duration * | integer | Secret validity duration in seconds (max ~15777000). |
keyId * | string | Apple private key id. |
privateKey * | string | Apple private key contents (PEM). |
teamId * | string | Apple Developer Team ID. |
list_backups List backups
List all available backup files (key, size, modified date). Superuser only.
create_backup Create backup
Create a new backup (zip snapshot of the database and storage). If `basename` is omitted, PocketBase auto-generates a timestamped name. Returns the backup name. Superuser only.
| Parameter | Type | Description |
|---|---|---|
basename | string | Optional backup file name, e.g. 'pb_backup_2024.zip' (auto-generated if omitted). |
upload_backup Upload backup
Upload an existing local backup zip file into the instance's backups. Superuser only.
| Parameter | Type | Description |
|---|---|---|
path * | string | Local filesystem path to the backup .zip file to upload. |
delete_backup Delete backup
Delete a single backup file by its key/name. Cannot be undone. Superuser only.
| Parameter | Type | Description |
|---|---|---|
key * | string | Backup file key/name (as returned by list_backups). |
restore_backup Restore backup
Restore the instance from an existing backup file. THIS OVERWRITES ALL CURRENT DATA and restarts the application. Use with extreme caution. Superuser only.
| Parameter | Type | Description |
|---|---|---|
key * | string | Backup file key/name to restore from. |
get_backup_download_url Get backup download URL
Build a download URL for a backup file using a fresh superuser file token. Superuser only.
| Parameter | Type | Description |
|---|---|---|
key * | string | Backup file key/name. |
download_backup Download backup
Download a backup file to a local path on the machine running this MCP server. Superuser only.
| Parameter | Type | Description |
|---|---|---|
destPath * | string | Local filesystem path to write the .zip to. |
key * | string | Backup file key/name to download. |
list_crons List cron jobs
List all registered cron jobs with their id and cron expression (e.g. the automatic backups job, log/token cleanup, plus any custom jobs registered via hooks). Superuser only.
run_cron Run cron job
Manually trigger a registered cron job by its id (as returned by list_crons). Superuser only.
| Parameter | Type | Description |
|---|---|---|
jobId * | string | The cron job id to run. |
send_raw_request Send raw API request
Escape hatch: send an arbitrary authenticated HTTP request to any PocketBase API endpoint. Use this for endpoints not covered by a dedicated tool, custom routes added via hooks, or new API features. The Authorization header (superuser token) is attached automatically. `path` is relative to the server root and must start with '/api/...' (e.g. '/api/collections'). Returns the parsed JSON response.
| Parameter | Type | Description |
|---|---|---|
path * | string | Request path, e.g. '/api/health' or '/api/collections/posts/records'. |
body | object | JSON request body for POST/PATCH/PUT. |
headers | object | Extra request headers. |
method | string | HTTP method (default GET). |
query | object | Query parameters as a key/value object. |