### TypeScript Example: Create PocketBase Collection via MCP Source: https://github.com/mrwyndham/pocketbase-mcp/blob/main/README.md TypeScript code snippet demonstrating how to use the MCP client to create a new collection in PocketBase. It shows the required parameters for collection name and schema definition. ```typescript await mcp.use_tool("pocketbase", "create_collection", { name: "posts", schema: [ { name: "title", type: "text", required: true, }, { name: "content", type: "text", required: true, }, ], }); ``` -------------------------------- ### TypeScript Example: Authenticate PocketBase User via MCP Source: https://github.com/mrwyndham/pocketbase-mcp/blob/main/README.md TypeScript code snippet illustrating how to authenticate a PocketBase user using the MCP client. It requires the user's email, password, and the relevant collection name. ```typescript await mcp.use_tool("pocketbase", "authenticate_user", { email: "user@example.com", password: "securepassword", collection: "users", }); ``` -------------------------------- ### MCP Settings for Docker Compose PocketBase Source: https://github.com/mrwyndham/pocketbase-mcp/blob/main/README.md JSON configuration for MCP settings to utilize a PocketBase server managed by Docker Compose. It specifies 'docker-compose run' as the command to start the service. ```json { "mcpServers": { "pocketbase-docker": { "command": "docker-compose", "args": ["run", "--rm", "pocketbase-mcp"], "disabled": false } } } ``` -------------------------------- ### Get PocketBase Collection Details using TypeScript Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Retrieves detailed schema information for a specific PocketBase collection, including all its fields and API rules. It can fetch all details or specific fields like 'id', 'name', and 'fields'. ```typescript // Get full collection details await mcp.use_tool("pocketbase-server", "get_collection", { collectionIdOrName: "posts" }); // Get only specific fields await mcp.use_tool("pocketbase-server", "get_collection", { collectionIdOrName: "posts", fields: "id,name,fields" }); // Response: { "id": "abc123", "name": "posts", "type": "base", "fields": [ { "name": "title", "type": "text", "required": true }, { "name": "content", "type": "editor", "required": true } ], "listRule": "", "viewRule": "", "createRule": "@request.auth.id != ''", "updateRule": "@request.auth.id = author", "deleteRule": "@request.auth.id = author" } ``` -------------------------------- ### Configure PocketBase Docker MCP for VS Code Source: https://github.com/mrwyndham/pocketbase-mcp/blob/main/README.md JSON configuration for VS Code's MCP integration. It defines input prompts for credentials and the Docker command to run the PocketBase MCP server, utilizing environment variables for sensitive information. ```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" ] } } } ``` -------------------------------- ### Create User Account Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Creates a new user record in a specified auth collection. Requires email, password, and confirmation fields. ```typescript await mcp.use_tool("pocketbase-server", "create_user", { email: "newuser@example.com", password: "securepassword123", passwordConfirm: "securepassword123", name: "Jane Smith", collection: "users" }); ``` -------------------------------- ### Configure PocketBase Docker MCP for Cline/Cursor Source: https://github.com/mrwyndham/pocketbase-mcp/blob/main/README.md JSON configuration for Cline/Cursor to connect to a Dockerized PocketBase MCP server. It specifies the Docker command, arguments, and auto-approved operations for seamless integration. ```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"] } } } ``` -------------------------------- ### POST /create_user Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Creates a new user account within a specified authentication collection. ```APIDOC ## POST create_user ### Description Creates a new user account in an auth collection. ### Method POST ### Endpoint create_user ### Parameters #### Request Body - **email** (string) - Required - User email address - **password** (string) - Required - User password - **passwordConfirm** (string) - Required - Confirmation of password - **name** (string) - Optional - User display name - **collection** (string) - Required - The auth collection name ### Request Example { "email": "newuser@example.com", "password": "securepassword123", "passwordConfirm": "securepassword123", "name": "Jane Smith", "collection": "users" } ### Response #### Success Response (200) - **id** (string) - User unique identifier - **email** (string) - User email - **name** (string) - User name - **verified** (boolean) - Verification status #### Response Example { "id": "user_new123", "email": "newuser@example.com", "name": "Jane Smith", "verified": false } ``` -------------------------------- ### List Auth Methods Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Retrieves all configured authentication methods for a specific collection, including OAuth2 providers and password settings. ```typescript await mcp.use_tool("pocketbase-server", "list_auth_methods", { collection: "users" }); ``` -------------------------------- ### POST /backup_database Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Triggers a backup of the entire PocketBase database. Requires administrative privileges. ```APIDOC ## POST backup_database ### Description Creates a backup of the entire PocketBase database. Requires admin authentication. ### Method POST ### Endpoint backup_database ### Parameters #### Request Body - **name** (string) - Optional - Custom name for the backup file ### Request Example { "name": "backup_2024_01_16" } ``` -------------------------------- ### Docker Compose for PocketBase MCP Server Source: https://github.com/mrwyndham/pocketbase-mcp/blob/main/README.md A Docker Compose file to define and manage the PocketBase MCP service. It specifies the build context, environment variables for PocketBase connection, and enables interactive TTY for the container. ```yaml 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: true ``` -------------------------------- ### POST /authenticate_with_oauth2 Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Authenticates a user using an external OAuth2 provider such as Google or GitHub. ```APIDOC ## POST authenticate_with_oauth2 ### Description Authenticates a user using OAuth2 provider (Google, GitHub, Facebook, etc.). ### Method POST ### Endpoint authenticate_with_oauth2 ### Parameters #### Request Body - **provider** (string) - Required - Name of the OAuth2 provider - **code** (string) - Required - Authorization code from provider - **codeVerifier** (string) - Required - PKCE code verifier - **redirectUrl** (string) - Required - Callback URL - **collection** (string) - Required - Auth collection name ### Request Example { "provider": "google", "code": "auth_code", "codeVerifier": "pkce_verifier", "redirectUrl": "https://myapp.com/oauth/callback", "collection": "users" } ``` -------------------------------- ### Collection Management Tools Source: https://github.com/mrwyndham/pocketbase-mcp/blob/main/README.md Tools for creating and retrieving PocketBase collection schemas. ```APIDOC ## POST create_collection ### Description Creates a new collection in the PocketBase database with a custom schema. ### Parameters #### Request Body - **name** (string) - Required - The name of the collection. - **schema** (array) - Required - An array of field definitions (name, type, required). ### Request Example { "name": "posts", "schema": [{"name": "title", "type": "text", "required": true}] } ## GET get_collection ### Description Retrieves the schema details and metadata for a specific collection. ### Parameters #### Query Parameters - **collectionName** (string) - Required - The name of the collection to retrieve. ``` -------------------------------- ### Backup Database Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Performs a full database backup. Can be executed with a custom name or an auto-generated one. ```typescript await mcp.use_tool("pocketbase-server", "backup_database", { name: "backup_2024_01_16" }); await mcp.use_tool("pocketbase-server", "backup_database", {}); ``` -------------------------------- ### POST create_collection Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Creates a new collection in PocketBase with a custom schema and API rules. ```APIDOC ## POST create_collection ### Description Creates a new collection in PocketBase with custom schema and API rules. Automatically adds `created` and `updated` timestamp fields to every collection. Requires admin authentication. ### Method POST ### Endpoint create_collection ### Parameters #### Request Body - **name** (string) - Required - Name of the collection - **type** (string) - Required - Type of collection (base, auth, etc.) - **fields** (array) - Required - List of field objects - **listRule** (string) - Optional - API rule for listing records - **viewRule** (string) - Optional - API rule for viewing records - **createRule** (string) - Optional - API rule for creating records - **updateRule** (string) - Optional - API rule for updating records - **deleteRule** (string) - Optional - API rule for deleting records ### Request Example { "name": "posts", "type": "base", "fields": [{"name": "title", "type": "text", "required": true}], "listRule": "" } ### Response #### Success Response (200) - **id** (string) - Unique collection ID - **name** (string) - Collection name - **fields** (array) - Collection schema fields #### Response Example { "id": "abc123", "name": "posts", "fields": [...] } ``` -------------------------------- ### POST list_collections Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Lists all collections in the PocketBase database. ```APIDOC ## POST list_collections ### Description Lists all collections in the PocketBase database with optional filtering and sorting. ### Method POST ### Endpoint list_collections ### Parameters #### Request Body - **sort** (string) - Optional - Sorting field - **filter** (string) - Optional - Filter expression ### Response Example { "page": 1, "items": [{"id": "abc123", "name": "posts"}] } ``` -------------------------------- ### User Management Tools Source: https://github.com/mrwyndham/pocketbase-mcp/blob/main/README.md Tools for handling user authentication and account management. ```APIDOC ## POST authenticate_user ### Description Authenticates a user against a collection and returns an authentication token. ### Request Example { "email": "user@example.com", "password": "securepassword", "collection": "users" } ## POST create_user ### Description Creates a new user account in the specified authentication collection. ``` -------------------------------- ### Create PocketBase Collection using TypeScript Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Creates a new collection in PocketBase with specified fields, type, and API rules. Automatically adds 'created' and 'updated' timestamp fields. Requires admin authentication. ```typescript await mcp.use_tool("pocketbase-server", "create_collection", { name: "posts", type: "base", fields: [ { name: "title", type: "text", required: true }, { name: "content", type: "editor", required: true }, { name: "status", type: "select", values: ["draft", "published", "archived"] }, { name: "author", type: "relation", collectionId: "users_collection_id" } ], listRule: "", viewRule: "", createRule: "@request.auth.id != ''", updateRule: "@request.auth.id = author", deleteRule: "@request.auth.id = author" }); // Response: { "id": "abc123", "name": "posts", "type": "base", "fields": [ { "name": "title", "type": "text", "required": true }, { "name": "content", "type": "editor", "required": true }, { "name": "status", "type": "select", "values": ["draft", "published", "archived"] }, { "name": "author", "type": "relation", "collectionId": "users_collection_id" }, { "name": "created", "type": "autodate", "onCreate": true, "onUpdate": false }, { "name": "updated", "type": "autodate", "onCreate": true, "onUpdate": true } ], "created": "2024-01-15 10:30:00.000Z", "updated": "2024-01-15 10:30:00.000Z" } ``` -------------------------------- ### User Authentication Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt APIs for authenticating users, including regular users and administrators. ```APIDOC ## POST /api/auth/{collection}/request-password-reset ### Description Initiates the password reset process for a user. ### Method POST ### Endpoint `/api/auth/{collection}/request-password-reset` ### Parameters #### Path Parameters - **collection** (string) - Required - The name or ID of the user collection. #### Request Body - **email** (string) - Required - The email address of the user requesting a password reset. ### Request Example ```json { "email": "user@example.com" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message that the password reset email has been sent. #### Response Example ```json "Password reset email sent successfully." ``` ``` ```APIDOC ## POST /api/auth/{collection}/confirm-password-reset ### Description Confirms a password reset using a token received via email. ### Method POST ### Endpoint `/api/auth/{collection}/confirm-password-reset` ### Parameters #### Path Parameters - **collection** (string) - Required - The name or ID of the user collection. #### Request Body - **passwordResetToken** (string) - Required - The password reset token received via email. - **newPassword** (string) - Required - The new password for the user. - **newPasswordConfirm** (string) - Required - Confirmation of the new password. ### Request Example ```json { "passwordResetToken": "your_reset_token_here", "newPassword": "new_secure_password", "newPasswordConfirm": "new_secure_password" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message that the password has been successfully reset. #### Response Example ```json "Password reset successfully." ``` ``` ```APIDOC ## POST /api/collections/{collection}/auth-with-password ### Description Authenticates a user with email and password, returning an auth token. Can authenticate regular users or admins. ### Method POST ### Endpoint `/api/collections/{collection}/auth-with-password` ### Parameters #### Path Parameters - **collection** (string) - Required - The name or ID of the user collection. #### Request Body - **email** (string) - Required - The email address of the user. - **password** (string) - Required - The password of the user. - **isAdmin** (boolean) - Optional - Set to `true` to authenticate as an admin user. ### Request Example ```json { "email": "user@example.com", "password": "securepassword123", "collection": "users" } ``` ### Admin Authentication Example ```json { "email": "admin@example.com", "password": "adminpassword", "isAdmin": true } ``` ### Response #### Success Response (200) - **token** (string) - The authentication token for the user. - **record** (object) - The authenticated user's record object. - **id** (string) - The user's ID. - **email** (string) - The user's email address. - **created** (string) - The timestamp when the user record was created. - **updated** (string) - The timestamp when the user record was last updated. - **[other fields]** - Any other fields defined in the user collection schema. #### Response Example ```json { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "record": { "id": "user_abc123", "email": "user@example.com", "name": "John Doe", "verified": true, "created": "2024-01-10 08:00:00.000Z", "updated": "2024-01-10 08:00:00.000Z" } } ``` ``` -------------------------------- ### List PocketBase Collections using TypeScript Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Lists all collections in a PocketBase database, supporting optional filtering and sorting. It can retrieve all collections, sort them by name, or filter them by a name pattern. ```typescript // List all collections await mcp.use_tool("pocketbase-server", "list_collections", {}); // List collections sorted by name await mcp.use_tool("pocketbase-server", "list_collections", { sort: "name" }); // Filter collections by name pattern await mcp.use_tool("pocketbase-server", "list_collections", { filter: "name ~ 'user'" }); // Response: { "page": 1, "perPage": 100, "totalItems": 5, "totalPages": 1, "items": [ { "id": "abc123", "name": "posts", "type": "base" }, { "id": "def456", "name": "users", "type": "auth" }, { "id": "ghi789", "name": "comments", "type": "base" } ] } ``` -------------------------------- ### List PocketBase Records with Filters and Sorting Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Lists records from a PocketBase collection with support for filtering, sorting, and pagination. It accepts collection name, filter expressions, sort order, and pagination parameters. ```typescript await mcp.use_tool("pocketbase-server", "list_records", { collection: "posts", filter: "status = 'published'", sort: "-created", page: 1, perPage: 20 }); await mcp.use_tool("pocketbase-server", "list_records", { collection: "posts", filter: "status = 'published' && author.verified = true", sort: "-created,title" }); ``` -------------------------------- ### Authenticate via OTP Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Initiates a one-time password authentication process by triggering an email to the user. ```typescript await mcp.use_tool("pocketbase-server", "authenticate_with_otp", { email: "user@example.com", collection: "users" }); ``` -------------------------------- ### Create PocketBase Record Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Creates a new record in a specified PocketBase collection with provided data. The input includes the collection name and a data object containing the record's fields. ```typescript await mcp.use_tool("pocketbase-server", "create_record", { collection: "posts", data: { title: "Getting Started with PocketBase", content: "

PocketBase is an open source backend...

", status: "published", author: "user_id_123" } }); ``` -------------------------------- ### Authenticate via OAuth2 Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Completes the OAuth2 authentication flow using provider-specific authorization codes and PKCE verifiers. ```typescript await mcp.use_tool("pocketbase-server", "authenticate_with_oauth2", { provider: "google", code: "authorization_code_from_provider", codeVerifier: "pkce_code_verifier", redirectUrl: "https://myapp.com/oauth/callback", collection: "users" }); ``` -------------------------------- ### Record Operations Tools Source: https://github.com/mrwyndham/pocketbase-mcp/blob/main/README.md Tools for performing CRUD operations on records within PocketBase collections. ```APIDOC ## POST create_record ### Description Creates a new record within a specified collection. ## GET list_records ### Description Lists records from a collection with support for filtering, pagination, and relationship expansion. ## PUT update_record ### Description Updates an existing record identified by its ID. ## DELETE delete_record ### Description Deletes a specific record from a collection. ``` -------------------------------- ### Manage Password Reset Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Facilitates password recovery by sending reset instructions and applying a new password via a token. ```typescript await mcp.use_tool("pocketbase-server", "request_password_reset", { email: "user@example.com", collection: "users" }); await mcp.use_tool("pocketbase-server", "confirm_password_reset", { token: "reset_token_from_email", password: "newSecurePassword123", passwordConfirm: "newSecurePassword123", collection: "users" }); ``` -------------------------------- ### Record Operations Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt APIs for creating, listing, updating, and deleting records within collections. ```APIDOC ## POST /api/collections/{collection}/records ### Description Creates a new record in a specified collection with provided data. ### Method POST ### Endpoint `/api/collections/{collection}/records` ### Parameters #### Path Parameters - **collection** (string) - Required - The name or ID of the collection to create the record in. #### Request Body - **data** (object) - Required - An object containing the fields and their values for the new record. ### Request Example ```json { "collection": "posts", "data": { "title": "Getting Started with PocketBase", "content": "

PocketBase is an open source backend...

", "status": "published", "author": "user_id_123" } } ``` ### Response #### Success Response (200) - **id** (string) - The unique ID of the newly created record. - **collectionId** (string) - The ID of the collection the record belongs to. - **collectionName** (string) - The name of the collection the record belongs to. - **created** (string) - The timestamp when the record was created. - **updated** (string) - The timestamp when the record was last updated. - **[other fields]** - Any other fields defined in the collection schema. #### Response Example ```json { "id": "record_abc123", "collectionId": "collection_xyz", "collectionName": "posts", "title": "Getting Started with PocketBase", "content": "

PocketBase is an open source backend...

", "status": "published", "author": "user_id_123", "created": "2024-01-15 10:30:00.000Z", "updated": "2024-01-15 10:30:00.000Z" } ``` ``` ```APIDOC ## GET /api/collections/{collection}/records ### Description Lists records from a collection with support for filtering, sorting, and pagination. ### Method GET ### Endpoint `/api/collections/{collection}/records` ### Parameters #### Path Parameters - **collection** (string) - Required - The name or ID of the collection to list records from. #### Query Parameters - **filter** (string) - Optional - A filter expression to apply to the records (e.g., `status = 'published'`). - **sort** (string) - Optional - A field or fields to sort the records by (e.g., `-created` for descending by creation date). - **page** (integer) - Optional - The page number of results to return (defaults to 1). - **perPage** (integer) - Optional - The number of records to return per page (defaults to 20). ### Request Example ```json { "collection": "posts", "filter": "status = 'published'", "sort": "-created", "page": 1, "perPage": 20 } ``` ### Response #### Success Response (200) - **page** (integer) - The current page number. - **perPage** (integer) - The number of records per page. - **totalItems** (integer) - The total number of items matching the query. - **totalPages** (integer) - The total number of pages. - **items** (array) - An array of record objects. - Each item in the array is a record object with its fields. #### Response Example ```json { "page": 1, "perPage": 20, "totalItems": 45, "totalPages": 3, "items": [ { "id": "record_abc123", "title": "Getting Started with PocketBase", "content": "

PocketBase is an open source backend...

", "status": "published", "created": "2024-01-15 10:30:00.000Z" }, { "id": "record_def456", "title": "Advanced PocketBase Features", "content": "

Learn about relations and hooks...

", "status": "published", "created": "2024-01-14 15:20:00.000Z" } ] } ``` ``` ```APIDOC ## PATCH /api/collections/{collection}/records/{id} ### Description Updates an existing record with new data. ### Method PATCH ### Endpoint `/api/collections/{collection}/records/{id}` ### Parameters #### Path Parameters - **collection** (string) - Required - The name or ID of the collection the record belongs to. - **id** (string) - Required - The ID of the record to update. #### Request Body - **data** (object) - Required - An object containing the fields to update and their new values. ### Request Example ```json { "collection": "posts", "id": "record_abc123", "data": { "title": "Updated: Getting Started with PocketBase", "status": "archived" } } ``` ### Response #### Success Response (200) - **id** (string) - The ID of the updated record. - **collectionId** (string) - The ID of the collection the record belongs to. - **collectionName** (string) - The name of the collection the record belongs to. - **created** (string) - The timestamp when the record was created. - **updated** (string) - The timestamp when the record was last updated. - **[other fields]** - Any other fields defined in the collection schema, including updated values. #### Response Example ```json { "id": "record_abc123", "collectionId": "collection_xyz", "collectionName": "posts", "title": "Updated: Getting Started with PocketBase", "content": "

PocketBase is an open source backend...

", "status": "archived", "author": "user_id_123", "created": "2024-01-15 10:30:00.000Z", "updated": "2024-01-16 09:15:00.000Z" } ``` ``` ```APIDOC ## DELETE /api/collections/{collection}/records/{id} ### Description Permanently deletes a record from a collection. ### Method DELETE ### Endpoint `/api/collections/{collection}/records/{id}` ### Parameters #### Path Parameters - **collection** (string) - Required - The name or ID of the collection the record belongs to. - **id** (string) - Required - The ID of the record to delete. ### Request Example ```json { "collection": "posts", "id": "record_abc123" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the record was successfully deleted. #### Response Example ```json "Successfully deleted record record_abc123 from collection posts" ``` ``` ```APIDOC ## POST /api/collections/{collection}/import ### Description Bulk imports multiple records into a collection with support for create, update, or upsert modes. ### Method POST ### Endpoint `/api/collections/{collection}/import` ### Parameters #### Path Parameters - **collection** (string) - Required - The name or ID of the collection to import data into. #### Request Body - **data** (array) - Required - An array of record objects to import. - **mode** (string) - Required - The import mode. Can be `"create"`, `"update"`, or `"upsert"`. ### Request Example ```json { "collection": "posts", "data": [ { "title": "First Post", "content": "Content for first post", "status": "published" }, { "title": "Second Post", "content": "Content for second post", "status": "draft" } ], "mode": "create" } ``` ### Upsert Request Example ```json { "collection": "posts", "data": [ { "id": "existing_id", "title": "Updated Title", "status": "published" }, { "title": "New Post", "content": "This will be created", "status": "draft" } ], "mode": "upsert" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the import process. #### Response Example ```json "Data imported successfully." ``` ``` -------------------------------- ### Manage Account Verification Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Handles the email verification process by requesting a verification link and confirming it with a token. ```typescript await mcp.use_tool("pocketbase-server", "request_verification", { email: "user@example.com", collection: "users" }); await mcp.use_tool("pocketbase-server", "confirm_verification", { token: "verification_token_from_email", collection: "users" }); ``` -------------------------------- ### POST get_collection Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Retrieves detailed schema information for a specific collection. ```APIDOC ## POST get_collection ### Description Retrieves detailed schema information for a specific collection including all fields and API rules. ### Method POST ### Endpoint get_collection ### Parameters #### Request Body - **collectionIdOrName** (string) - Required - ID or name of the collection - **fields** (string) - Optional - Comma-separated list of fields to return ### Response Example { "id": "abc123", "name": "posts", "fields": [...] } ``` -------------------------------- ### Bulk Import PocketBase Data (Create, Update, Upsert) Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Bulk imports multiple records into a PocketBase collection with support for create, update, or upsert modes. It takes the collection name, an array of data objects, and the desired import mode. ```typescript await mcp.use_tool("pocketbase-server", "import_data", { collection: "posts", data: [ { title: "First Post", content: "Content for first post", status: "published" }, { title: "Second Post", content: "Content for second post", status: "draft" } ], mode: "create" }); await mcp.use_tool("pocketbase-server", "import_data", { collection: "posts", data: [ { id: "existing_id", title: "Updated Title", status: "published" }, { title: "New Post", content: "This will be created", status: "draft" } ], mode: "upsert" }); ``` -------------------------------- ### Authenticate PocketBase User (Regular or Admin) Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Authenticates a user with email and password, returning an auth token. This tool can authenticate regular users against a specified collection or authenticate as an admin. ```typescript await mcp.use_tool("pocketbase-server", "authenticate_user", { email: "user@example.com", password: "securepassword123", collection: "users" }); await mcp.use_tool("pocketbase-server", "authenticate_user", { email: "admin@example.com", password: "adminpassword", isAdmin: true }); ``` -------------------------------- ### Collection Operations Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt APIs for managing collections, including deletion. ```APIDOC ## DELETE /api/collections/{collectionIdOrName} ### Description Permanently deletes a collection and all its records. This is an admin-only operation. ### Method DELETE ### Endpoint `/api/collections/{collectionIdOrName}` ### Parameters #### Path Parameters - **collectionIdOrName** (string) - Required - The ID or name of the collection to delete. ### Request Example ```json { "collectionIdOrName": "old_posts" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the collection was successfully deleted. #### Response Example ```json "Successfully deleted collection old_posts" ``` ``` -------------------------------- ### Database Operations Source: https://github.com/mrwyndham/pocketbase-mcp/blob/main/README.md Administrative tools for database maintenance. ```APIDOC ## POST backup_database ### Description Creates a backup of the current PocketBase database instance. ``` -------------------------------- ### Manage Email Change Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Updates a user's email address by requesting a change and confirming it with the current password and a verification token. ```typescript await mcp.use_tool("pocketbase-server", "request_email_change", { newEmail: "newemail@example.com", collection: "users" }); await mcp.use_tool("pocketbase-server", "confirm_email_change", { token: "email_change_token", password: "currentPassword123", collection: "users" }); ``` -------------------------------- ### Impersonate User Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Allows an administrator to assume the identity of another user for a specified duration, useful for debugging. ```typescript await mcp.use_tool("pocketbase-server", "impersonate_user", { id: "user_abc123", collectionIdOrName: "users", duration: 3600 }); ``` -------------------------------- ### Refresh Authentication Token Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Refreshes an existing session token to maintain user authentication status. ```typescript await mcp.use_tool("pocketbase-server", "auth_refresh", { collection: "users" }); ``` -------------------------------- ### POST update_collection Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Updates an existing collection's schema, name, or API rules. ```APIDOC ## POST update_collection ### Description Updates an existing collection's schema, name, or API rules. Admin only operation that replaces existing fields if new fields array is provided. ### Method POST ### Endpoint update_collection ### Parameters #### Request Body - **collectionIdOrName** (string) - Required - ID or name of the collection - **fields** (array) - Optional - New schema fields - **listRule** (string) - Optional - Updated list rule - **viewRule** (string) - Optional - Updated view rule ### Request Example { "collectionIdOrName": "posts", "listRule": "status = 'published'" } ``` -------------------------------- ### Update PocketBase Record Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Updates an existing record in a PocketBase collection with new data. This operation requires the collection name, the record ID, and a data object containing the fields to update. ```typescript await mcp.use_tool("pocketbase-server", "update_record", { collection: "posts", id: "record_abc123", data: { title: "Updated: Getting Started with PocketBase", status: "archived" } }); ``` -------------------------------- ### Update PocketBase Collection using TypeScript Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Updates an existing PocketBase collection by modifying its schema, name, or API rules. This is an admin-only operation that replaces the fields if a new array is provided. It can add new fields or change existing ones. ```typescript // Update collection to add a new field and modify rules await mcp.use_tool("pocketbase-server", "update_collection", { collectionIdOrName: "posts", fields: [ { name: "title", type: "text", required: true }, { name: "content", type: "editor", required: true }, { name: "status", type: "select", values: ["draft", "published", "archived"] }, { name: "author", type: "relation", collectionId: "users_collection_id" }, { name: "featured", type: "bool" }, { name: "publishedAt", type: "date" } ], listRule: "status = 'published' || @request.auth.id = author", viewRule: "status = 'published' || @request.auth.id = author" }); ``` -------------------------------- ### Delete PocketBase Collection by Name or ID Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Permanently deletes a PocketBase collection and all its records. This is an admin-only operation. It requires the collection ID or name as input. ```typescript await mcp.use_tool("pocketbase-server", "delete_collection", { collectionIdOrName: "old_posts" }); await mcp.use_tool("pocketbase-server", "delete_collection", { collectionIdOrName: "abc123" }); ``` -------------------------------- ### Delete PocketBase Record Source: https://context7.com/mrwyndham/pocketbase-mcp/llms.txt Permanently deletes a specific record from a PocketBase collection. This operation requires the collection name and the record ID to be specified. ```typescript await mcp.use_tool("pocketbase-server", "delete_record", { collection: "posts", id: "record_abc123" }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.