Integrations
Provides tools for interacting with a PocketBase instance, including record management (fetching, listing, creating, updating), file operations (uploading, downloading), collection management (listing, schema retrieval), log management, and migration management for database schema changes.
PocketBase MCP Server
This is an MCP server that interacts with a PocketBase instance. It allows you to fetch, list, create, update, and manage records and files in your PocketBase collections.
Installation
Installing via Smithery
To install PocketBase MCP Server for Claude Desktop automatically via Smithery:
- Clone the repository (if you haven't already):Copy
- Install dependencies:Copy
- Build the server:This compiles the TypeScript code to JavaScript in theCopy
build/
directory and makes the entry point executable.
Configuration
This server requires the following environment variables to be set:
POCKETBASE_API_URL
: The URL of your PocketBase instance (e.g.,http://127.0.0.1:8090
). Defaults tohttp://127.0.0.1:8090
if not set.POCKETBASE_ADMIN_TOKEN
: An admin authentication token for your PocketBase instance. This is required. You can generate this from your PocketBase admin UI, see API KEYS.
These variables need to be configured when adding the server to Cline (see Cline Installation section).
Available Tools
The server provides the following tools, organized by category:
Record Management
- fetch_record: Fetch a single record from a PocketBase collection by ID.
- Input Schema:Copy
- Input Schema:
- list_records: List records from a PocketBase collection. Supports pagination, filtering, sorting, and expanding relations.
- Input Schema:Copy
- Input Schema:
- create_record: Create a new record in a PocketBase collection.
- Input Schema:Copy
- Input Schema:
- update_record: Update an existing record in a PocketBase collection.
- Input Schema:Copy
- Input Schema:
- get_collection_schema: Get the schema of a PocketBase collection.
- Input Schema:Copy
- Input Schema:
- upload_file: Upload a file to a specific field in a PocketBase collection record.
- Input Schema:Copy
- Input Schema:
- list_collections: List all collections in the PocketBase instance.
- Input Schema:Copy
- Input Schema:
- download_file: Get the download URL for a file stored in a PocketBase collection record.
- Input Schema:Note: This tool returns the file URL. The actual download needs to be performed by the client using this URL.Copy
- Input Schema:
Collection Management
- list_collections: List all collections in the PocketBase instance.
- Input Schema:Copy
- Input Schema:
- get_collection_schema: Get the schema of a PocketBase collection.
- Input Schema:Copy
- Input Schema:
Log Management
Note: The Logs API requires admin authentication and may not be available in all PocketBase instances or configurations. These tools interact with the PocketBase Logs API as documented at https://pocketbase.io/docs/api-logs/.
- list_logs: List API request logs from PocketBase with filtering, sorting, and pagination.
- Input Schema:Copy
- Input Schema:
- get_log: Get a single API request log by ID.
- Input Schema:Copy
- Input Schema:
- get_logs_stats: Get API request logs statistics with optional filtering.
- Input Schema:Copy
- Input Schema:
Cron Job Management
Note: The Cron Jobs API requires admin authentication and may not be available in all PocketBase instances or configurations. These tools interact with the PocketBase Cron Jobs API.
- list_cron_jobs: Returns list with all registered app level cron jobs.
- Input Schema:Copy
- Input Schema:
- run_cron_job: Triggers a single cron job by its id.
- Input Schema:Copy
- Input Schema:
Migration Management
- set_migrations_directory: Set the directory where migration files will be created and read from.
- Input Schema:Copy
- Input Schema:
- create_migration: Create a new, empty PocketBase migration file with a timestamped name.
- Input Schema:Copy
- Input Schema:
- create_collection_migration: Create a migration file specifically for creating a new PocketBase collection.
- Input Schema:Copy
- Input Schema:
- add_field_migration: Create a migration file for adding a field to an existing collection.
- Input Schema:Copy
- Input Schema:
- list_migrations: List all migration files found in the PocketBase migrations directory.
- Input Schema:Copy
- Input Schema:
- apply_migration: Apply a specific migration file.
- Input Schema:Copy
- Input Schema:
- revert_migration: Revert a specific migration file.
- Input Schema:Copy
- Input Schema:
- apply_all_migrations: Apply all pending migrations.
- Input Schema:Copy
- Input Schema:
- revert_to_migration: Revert migrations up to a specific target.
- Input Schema:Copy
- Input Schema:
Migration System
The PocketBase MCP Server includes a comprehensive migration system for managing database schema changes. This system allows you to:
- Create migration files with timestamped names
- Generate migrations for common operations (creating collections, adding fields)
- Apply and revert migrations individually or in batches
- Track which migrations have been applied
Migration File Format
Migration files are JavaScript files with a timestamp prefix and descriptive name:
Each migration has an "up" function for applying changes and a "down" function for reverting them.
Usage Examples
Setting a custom migrations directory:
Creating a basic migration:
Creating a collection migration:
Adding a field to a collection:
Applying migrations:
Reverting migrations:
Cline Installation
To use this server with Cline, you need to add it to your MCP settings file (cline_mcp_settings.json
).
- Locate your Cline MCP settings file:
- Typically found at
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
on Linux/macOS. - Or
~/Library/Application Support/Claude/claude_desktop_config.json
if using the Claude desktop app on macOS.
- Typically found at
- Edit the file and add the following configuration under the
mcpServers
key. Replace/path/to/pocketbase-mcp
with the actual absolute path to this project directory on your system. Also, replace<YOUR_POCKETBASE_API_URL>
and<YOUR_POCKETBASE_ADMIN_TOKEN>
with your actual PocketBase URL and admin token.Copy - Save the settings file. Cline should automatically detect the changes and connect to the server. You can then use the tools listed above.
Dependencies
@modelcontextprotocol/sdk
pocketbase
typescript
ts-node
(dev dependency)@types/node
(dev dependency)
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
MCP server that allows interaction with PocketBase databases, enabling record operations (fetch, list, create, update), file management, and schema migrations through natural language.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA 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).Last updated -1330JavaScriptMIT License
- AsecurityAlicenseAqualityAn MCP server that provides tools for interacting with Supabase databases, storage, and edge functions.Last updated -1441JavaScriptMIT License
- AsecurityFlicenseAqualityAn MCP server implementation that enables interaction with the Unstructured API, providing tools to list, create, update, and manage sources, destinations, and workflows.Last updated -3925
- -securityAlicense-qualityA comprehensive server that enables advanced database operations with PocketBase, providing tools for collection management, record operations, user management, and database administration through the Model Context Protocol.Last updated -JavaScriptMIT License