pocketbase-mcp-server
A comprehensive MCP server 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).
register_user_with_automation
: Complete user registration with email and Stripe customer creationcreate_subscription_flow
: End-to-end subscription setup with email notificationsprocess_payment_webhook_with_email
: Webhook processing with automated email notificationssetup_complete_saas_backend
: One-click SaaS backend initializationcancel_subscription_with_email
: Subscription cancellation with customer notificationsget_saas_backend_status
: Comprehensive status reporting for production readinessupdateTemplate()
and testConnection()
methodscreatePaymentIntent()
, retrieveCustomer()
, updateCustomer()
, cancelSubscription()
methodsstripe_products
, stripe_customers
, stripe_subscriptions
, stripe_payments
, email_templates
, email_logs
This release transforms the Advanced PocketBase MCP Server into a complete full-stack SaaS backend solution, providing everything needed for user management, payment processing, email communications, and business automation through the Model Context Protocol.
src/types/pocketbase.d.ts
to match actual SDK API
authenticate_with_otp
to use requestOTP()
for initiating OTP flowauthenticate_with_oauth2
to use authWithOAuth2Code()
with proper parametersauthWithOtp
to authWithOTP
to match SDKmodel
property to correct record
propertyget_collection_scaffolds
tool (used non-existent collections.getScaffolds()
)import_collections
tool (used non-existent collections.import()
)createBatch()
API calls with sequential execution in batch operation toolsExtendedPocketBase
interface, using standard PocketBase
type directlyThis release ensures the Advanced PocketBase MCP Server is fully compatible with the latest SDK versions and follows modern development patterns.
stream_collection_changes
tool with MCP notification systembatch_update_records
tool for updating multiple records at once.batch_delete_records
tool for deleting multiple records at once.subscribe_to_collection
tool for real-time event subscriptions (requires eventsource
polyfill).authenticate_user
to allow admin authentication via environment variables without explicit email/password.eventsource
dependency and polyfill to enable real-time subscriptions in Node.js.impersonate_user
toolcreate_collection
: Create a new collection with custom schemaget_collection_schema
: Get schema details for a collectionmigrate_collection
: Migrate collection schema with data preservationmanage_indexes
: Create, delete, or list collection indexescreate_record
: Create a new record in a collectionlist_records
: List records with optional filters and paginationupdate_record
: Update an existing recorddelete_record
: Delete a recordquery_collection
: Advanced query with filtering, sorting, and aggregationbatch_update_records
: Update multiple records in a single callbatch_delete_records
: Delete multiple records in a single callsubscribe_to_collection
: Subscribe to real-time changes in a collection (requires eventsource
package in Node.js environment)import_data
: Import data into a collection with create/update/upsert modesauthenticate_user
: Authenticate a user and get auth tokencreate_user
: Create a new user accountlist_auth_methods
: List all available authentication methodsauthenticate_with_oauth2
: Authenticate a user with OAuth2authenticate_with_otp
: Authenticate a user with one-time passwordauth_refresh
: Refresh authentication tokenrequest_verification
: Request email verificationconfirm_verification
: Confirm email verification with tokenrequest_password_reset
: Request password resetconfirm_password_reset
: Confirm password reset with tokenrequest_email_change
: Request email changeconfirm_email_change
: Confirm email change with tokenimpersonate_user
: Impersonate another user (admin only)backup_database
: Create a backup of the PocketBase database with format optionsimport_data
: Import data with various modes (create/update/upsert)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// 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
}
]
});
// Manage indexes
await mcp.use_tool("pocketbase", "manage_indexes", {
collection: "posts",
action: "create",
index: {
name: "title_idx",
fields: ["title"],
unique: true
}
});
// Query with filtering, sorting, and aggregation
await mcp.use_tool("pocketbase", "query_collection", {
collection: "posts",
filter: "created >= '2024-01-01'",
sort: "-created",
aggregate: {
totalLikes: "sum(likes)",
avgRating: "avg(rating)"
},
expand: "author,categories"
});
// Import data with upsert mode
await mcp.use_tool("pocketbase", "import_data", {
collection: "posts",
data: [
{
title: "First Post",
content: "Hello World"
},
{
title: "Second Post",
content: "More content"
}
],
mode: "upsert"
});
// Backup database
await mcp.use_tool("pocketbase", "backup_database", {
format: "json" // or "csv"
});
// Migrate collection schema
await mcp.use_tool("pocketbase", "migrate_collection", {
collection: "posts",
newSchema: [
{
name: "title",
type: "text",
required: true
},
{
name: "content",
type: "text",
required: true
},
{
name: "tags",
type: "json",
required: false
}
],
dataTransforms: {
// Optional field transformations during migration
tags: "JSON.parse(oldTags)"
}
});
// Batch update records
await mcp.use_tool("pocketbase", "batch_update_records", {
collection: "products",
records: [
{ id: "record_id_1", data: { price: 19.99 } },
{ id: "record_id_2", data: { status: "published" } }
]
});
// Batch delete records
await mcp.use_tool("pocketbase", "batch_delete_records", {
collection: "products",
recordIds: ["record_id_3", "record_id_4"]
});
// Subscribe to collection changes (logs events to server console)
// Note: Requires 'eventsource' package installed in the Node.js environment running the server.
await mcp.use_tool("pocketbase", "subscribe_to_collection", {
collection: "products"
});
// Subscribe to a specific record
await mcp.use_tool("pocketbase", "subscribe_to_collection", {
collection: "products",
recordId: "specific_product_id"
});
// List available authentication methods
await mcp.use_tool("pocketbase", "list_auth_methods", {
collection: "users"
});
// Authenticate with password
await mcp.use_tool("pocketbase", "authenticate_user", {
email: "[email protected]",
password: "securepassword",
collection: "users"
});
// Authenticate with OAuth2
await mcp.use_tool("pocketbase", "authenticate_with_oauth2", {
provider: "google",
code: "auth_code_from_provider",
codeVerifier: "code_verifier_from_pkce",
redirectUrl: "https://your-app.com/auth/callback",
collection: "users"
});
// Request password reset
await mcp.use_tool("pocketbase", "request_password_reset", {
email: "[email protected]",
collection: "users"
});
// Confirm password reset
await mcp.use_tool("pocketbase", "confirm_password_reset", {
token: "verification_token",
password: "new_password",
passwordConfirm: "new_password",
collection: "users"
});
// Refresh authentication token
await mcp.use_tool("pocketbase", "auth_refresh", {
collection: "users"
});
All tools include comprehensive error handling with detailed error messages. Errors are properly typed and include:
The server includes TypeScript definitions for all operations, ensuring type safety when using the tools. Each tool's input schema is strictly typed and validated.
npm install
.env.example
to .env
and configurenpm run build
To install PocketBase Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install pocketbase-server --client claude
No configuration available
Related projects feature coming soon
Will recommend related projects based on sub-categories