PocketBase MCP Server
Manage PocketBase collections, records, users, authentication, backups, and data imports.
Create, update, get, list, and delete collections with custom schemas and API rules.
Perform CRUD operations on records with filtering, sorting, pagination, and relationship expansion.
Import data into collections in create, update, or upsert modes.
Manage user accounts: create users, authenticate via email/password, OAuth2, or OTP, refresh tokens, and impersonate users (admin only).
Handle account flows: email verification, password reset, and email change requests/confirmations.
List available authentication methods.
Create database backups.
Provides sophisticated tools for interacting with PocketBase databases, enabling collection management, record operations (CRUD with relationship support), user authentication, and database backup capabilities.
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 MCP Server list the last 10 users created in the past week"
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.
PocketBase MCP Server
A very much in progress MCP server based off of the Dynamics one that I have been testing and refining. That provides sophisticated tools for interacting with PocketBase databases. This server enables advanced database operations, schema management, and data manipulation through the Model Context Protocol (MCP).
Here is a video of me using it: https://www.youtube.com/watch?v=ZuTIO3I7rTM&t=345s
Why This And Not DynamicsEndpoints?
This has actually been tested on the latest version. Currently 26.1 of PocketBase and is built off of the type definitions in the JS-SDK and not the arbitrary and wrong definitions found in the Dynamics one. Many of the methods don't even work.
Related MCP server: PocketBase MCP Server
Setup MCP Server Locally (Only Way Supported for Now)
To set up the MCP server locally, you'll need to configure it within your cline_mcp_settings.json or whatever you use (claude, cursor, the config looks identical you just need to find where it is stored) file. Here's how:
Locate your
cline_mcp_settings.jsonfile: This file is usually located in your Cursor user settings directory. For example:/Users/yourusername/Library/Application Support/Cursor/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.jsonConfigure the server: Add a new entry to the
mcpServersobject in yourcline_mcp_settings.jsonfile. The key should be a unique name for your server (e.g., "pocketbase-server"), and the value should be an object containing the server's configuration.{ "mcpServers": { "pocketbase-server": { "command": "node", "args": ["build/index.js"], "env": { "POCKETBASE_URL": "http://127.0.0.1:8090", "POCKETBASE_ADMIN_EMAIL": "admin@example.com", "POCKETBASE_ADMIN_PASSWORD": "admin_password" }, "disabled": false, "autoApprove": ["create_record", "create_collection"] } } }command: The command to start the server (usuallynode).args: An array of arguments to pass to the command. This should point to the compiled JavaScript file of your MCP server (e.g.,build/index.js). Make sure the path is correct.env: An object containing environment variables.POCKETBASE_URL: The URL of your PocketBase instance. This is required.POCKETBASE_ADMIN_EMAIL: The admin email for your PocketBase instance (optional, but needed for some operations).POCKETBASE_ADMIN_PASSWORD: The admin password for your PocketBase instance (optional, but needed for some operations).
disabled: Whether to disable to server on startup.autoApprove: list of tools to auto approve.Adjust the values in the
envobject to match your PocketBase instance's settings.
Setup in vscode is similar , find or create
.vscode/mcp.jsonand add
{
"inputs": [
{
"type": "promptString",
"id": "pocketbase-admin-email",
"description": "PocketBase Admin Email",
"password": false
},
{
"type": "promptString",
"id": "pocketbase-admin-password",
"description": "PocketBase Admin Password",
"password": true
}
],
"servers": {
"pocketbaseServer": {
"type": "stdio",
"command": "node",
// replace this with the path to your compiled MCP server (git clone the repo and run `npm run build` to compile)
"args": ["~/Desktop/code/mcp/pocketbase-mcp/build/index.js"],
"env": {
"POCKETBASE_URL": "http://127.0.0.1:8090",
"POCKETBASE_ADMIN_EMAIL": "${input:pocketbase-admin-email}",
"POCKETBASE_ADMIN_PASSWORD": "${input:pocketbase-admin-password}"
}
}
}
}Start the server: After configuring the
cline_mcp_settings.jsonfile, you can start using the MCP server with the configured tools.
Setup MCP Server with Docker
You can run the PocketBase MCP server using Docker. A Dockerfile is included in the repository.
Building the Docker Image
# Build the Docker image
docker build -t pocketbase-mcp .Running the Docker Container
# Run the container with environment variables
docker run -d \
--name pocketbase-mcp \
-e POCKETBASE_URL=http://127.0.0.1:8090 \
-e POCKETBASE_ADMIN_EMAIL=your_admin@example.com \
-e POCKETBASE_ADMIN_PASSWORD=your_admin_password \
pocketbase-mcpDocker MCP Configuration
To use the Dockerized MCP server with your AI assistant (Cursor, Claude, etc.), configure it in your MCP settings:
For Cline/Cursor (cline_mcp_settings.json):
{
"mcpServers": {
"pocketbase-docker": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"POCKETBASE_URL=http://host.docker.internal:8090",
"-e",
"POCKETBASE_ADMIN_EMAIL=your_admin@example.com",
"-e",
"POCKETBASE_ADMIN_PASSWORD=your_admin_password",
"pocketbase-mcp"
],
"disabled": false,
"autoApprove": ["list_collections", "list_records", "get_collection"]
}
}
}For VS Code (.vscode/mcp.json):
{
"inputs": [
{
"type": "promptString",
"id": "pocketbase-admin-email",
"description": "PocketBase Admin Email",
"password": false
},
{
"type": "promptString",
"id": "pocketbase-admin-password",
"description": "PocketBase Admin Password",
"password": true
}
],
"servers": {
"pocketbaseDocker": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"POCKETBASE_URL=http://host.docker.internal:8090",
"-e",
"POCKETBASE_ADMIN_EMAIL=${input:pocketbase-admin-email}",
"-e",
"POCKETBASE_ADMIN_PASSWORD=${input:pocketbase-admin-password}",
"pocketbase-mcp"
]
}
}
}Docker Configuration Notes
-i: Interactive mode (required for stdio communication)--rm: Automatically remove container when it exitshost.docker.internal: Use this to access PocketBase running on your host machine from within DockerEnvironment Variables: Replace placeholder values with your actual PocketBase credentials
Network: If your PocketBase is also running in Docker, use Docker networking (e.g.,
--network hostor custom bridge network)
Docker Compose (Optional)
Create a docker-compose.yml for easier management:
version: "3.8"
services:
pocketbase-mcp:
build: .
environment:
- POCKETBASE_URL=http://host.docker.internal:8090
- POCKETBASE_ADMIN_EMAIL=your_admin@example.com
- POCKETBASE_ADMIN_PASSWORD=your_admin_password
stdin_open: true
tty: trueThen configure your MCP settings to use:
{
"mcpServers": {
"pocketbase-docker": {
"command": "docker-compose",
"args": ["run", "--rm", "pocketbase-mcp"],
"disabled": false
}
}
}Features
Collection Management
Create and manage collections with custom schemas
Retrieve collection schemas and metadata
Record Operations
CRUD operations for records
Relationship expansion support
Pagination and cursor-based navigation
User Management
User authentication and token management
User account creation and management
Password management
Database Operations
Database backup
Available Tools
Collection Management
create_collection: Create a new collection with custom schemaget_collection: Get schema details for a collection
Record Operations
create_record: Create a new record in a collectionlist_records: List records with optional filters and paginationupdate_record: Update an existing recorddelete_record: Delete a record
User Management
authenticate_user: Authenticate a user and get auth tokencreate_user: Create a new user account
Database Operations
backup_database: Create a backup of the PocketBase database with format options
Configuration
The server requires the following environment variables:
POCKETBASE_URL: URL of your PocketBase instance (e.g., "http://127.0.0.1:8090")
Optional environment variables:
POCKETBASE_ADMIN_EMAIL: Admin email for certain operationsPOCKETBASE_ADMIN_PASSWORD: Admin passwordPOCKETBASE_DATA_DIR: Custom data directory path
Usage Examples
// Create a new collection
await mcp.use_tool("pocketbase", "create_collection", {
name: "posts",
schema: [
{
name: "title",
type: "text",
required: true,
},
{
name: "content",
type: "text",
required: true,
},
],
});
// Authenticate with password
await mcp.use_tool("pocketbase", "authenticate_user", {
email: "user@example.com",
password: "securepassword",
collection: "users",
});Contributing
Fork the repository
Create a feature branch
Commit your changes
Push to the branch
Create a Pull Request
Sponsors
Available Tools
24 toolsauthenticate_userC
Authenticate a user with email and password
Inputs: email (required), password (required), collection, isAdmin.
authenticate_with_oauth2C
Authenticate a user with OAuth2
Inputs: provider (required), code (required), codeVerifier (required), redirectUrl (required), +1 more.
authenticate_with_otpC
Authenticate a user with one-time password
Inputs: email (required), collection.
auth_refreshC
Refresh authentication token
Inputs: collection.
backup_databaseC
Create a backup of the PocketBase database
Inputs: name.
confirm_email_changeC
Confirm email change with token
Inputs: token (required), password (required), collection.
confirm_password_resetC
Confirm password reset with token
Inputs: token (required), password (required), passwordConfirm (required), collection.
confirm_verificationC
Confirm email verification with token
Inputs: token (required), collection.
create_collectionC
Create a new collection in PocketBase note never use created and updated because these are already created
Inputs: name (required), fields (required), type, createRule, +6 more.
create_recordC
Create a new record in a collection
Inputs: collection (required), data (required).
create_userC
Create a new user account
Inputs: email (required), password (required), passwordConfirm (required), name, +1 more.
delete_collectionB
Delete a collection from PocketBase (admin only)
Inputs: collectionIdOrName (required).
delete_recordC
Delete a record
Inputs: collection (required), id (required).
get_collectionC
Get details for a collection
Inputs: collectionIdOrName (required), fields.
impersonate_userC
Impersonate another user (admin only)
Inputs: id (required), collectionIdOrName, duration.
import_dataC
Import data into a collection
Inputs: collection (required), data (required), mode.
list_auth_methodsC
List all available authentication methods
Inputs: collection.
list_collectionsB
List all collections in PocketBase
Inputs: filter, sort.
list_recordsB
List records from a collection with optional filters
Inputs: collection (required), filter, sort, page, +1 more.
request_email_changeC
Request email change
Inputs: newEmail (required), collection.
request_password_resetC
Request password reset
Inputs: email (required), collection.
request_verificationC
Request email verification
Inputs: email (required), collection.
update_collectionC
Update an existing collection in PocketBase (admin only)
Inputs: collectionIdOrName (required), name, type, fields, +7 more.
update_recordC
Update an existing record
Inputs: collection (required), id (required), data (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Most tools have distinct purposes, but there is some overlap between authentication tools (authenticate_user, authenticate_with_oauth2, authenticate_with_otp) that could cause confusion, though their descriptions clarify the methods. Other tools like create_record and update_record are clearly differentiated by their actions on records.
Tool names follow a consistent verb_noun pattern throughout, such as authenticate_user, create_collection, list_records, and update_record. There are no deviations in naming conventions, making the set predictable and easy to understand.
With 24 tools, the count is on the higher side for a typical MCP server, which might feel heavy and could overwhelm agents. However, given PocketBase's scope covering authentication, collections, records, and admin functions, it is borderline but still within a reasonable range for the domain.
The tool set provides comprehensive coverage for PocketBase operations, including full CRUD for collections and records, authentication methods (user, OAuth2, OTP), user management, and admin functions like backup and impersonation. No obvious gaps are present, ensuring agents can handle complete workflows.
Maintenance
Related MCP Connectors
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
MCP server for interacting with the Supabase platform
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables advanced database operations on PocketBase instances, including schema and collection management, record CRUD, user authentication, and backups through the Model Context Protocol.18 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables advanced database operations, schema management, record CRUD, user authentication, and backups through the Model Context Protocol for PocketBase instances.18 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables sophisticated interaction with PocketBase databases through the Model Context Protocol, including collection and schema management, record CRUD with filtering and pagination, user authentication, and database backups.18 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables sophisticated database operations, schema management, record CRUD, user authentication, and backups for PocketBase instances through the Model Context Protocol.18 npmISC