home / mcp / 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.
Configuration
View docs{
"mcpServers": {
"mabeldata-pocketbase-mcp": {
"command": "node",
"args": [
"/path/to/pocketbase-mcp/build/index.js"
],
"env": {
"POCKETBASE_API_URL": "<YOUR_POCKETBASE_API_URL>",
"POCKETBASE_ADMIN_TOKEN": "<YOUR_POCKETBASE_ADMIN_TOKEN>"
}
}
}
}This MCP Server connects a PocketBase instance to your MCP client, enabling you to fetch, list, create, update, and manage records and files across PocketBase collections. It provides a practical bridge for dynamic data access and management within your MCP workflows.
You interact with the PocketBase MCP Server through your MCP client by selecting the pocketbase-mcp server as a data source. Configure the server with the PocketBase instance URL and an admin token, then use the available tools to manage records, schemas, files, and collections. The server exposes a comprehensive set of operations for working with PocketBase collections without needing to directly call the PocketBase API yourself.
Before you start, ensure the server has access to your PocketBase instance and that you provide the necessary authentication token. You can configure the admin token and the PocketBase URL as environment variables when you add the server to your MCP environment. The server supports operations like fetching a record, listing records with filters, creating and updating records, uploading and downloading files, and inspecting collection schemas.
Prerequisites you need on your system before installing:
Install and build the PocketBase MCP Server using the package manager and commands shown in the setup flow.
# Install via Smithery (automatic integration with Claude Desktop)
npx -y @smithery/cli install @mabeldata/pocketbase-mcp --client claude
```
# Optional: clone the repository if you want to work with the source
git clone <repository_url>
cd pocketbase-mcp
# Install dependencies
npm install
# Build the server
npm run buildThe server requires two environment variables to be set for proper operation with your PocketBase instance. You will provide these values when adding the server to your MCP environment.
- POCKETBASE_API_URL: The URL of your PocketBase instance (for example, http://127.0.0.1:8090). If not set, it defaults to http://127.0.0.1:8090.
- POCKETBASE_ADMIN_TOKEN: An admin authentication token for your PocketBase instance. This token is required for privileged operations. You can generate it from the PocketBase admin UI under API KEYS.
To run this server with Cline, add it to your MCP settings under mcpServers. Use the stdio configuration shown here to start the server and supply the required environment variables.
{
"mcpServers": {
"pocketbase_mcp": {
"command": "node",
"args": ["/path/to/pocketbase-mcp/build/index.js"],
"env": {
"POCKETBASE_API_URL": "<YOUR_POCKETBASE_API_URL>",
"POCKETBASE_ADMIN_TOKEN": "<YOUR_POCKETBASE_ADMIN_TOKEN>"
},
"disabled": false,
"autoApprove": [
"fetch_record",
"list_collections",
"get_collection_schema",
"list_logs",
"get_log",
"get_logs_stats",
"list_cron_jobs",
"run_cron_job"
]
}
}
}- The PocketBase MCP Server provides a broad set of tools for working with PocketBase data and schemas. You can manage records, retrieve collection schemas, handle file uploads, and inspect logs and cron jobs where available.
- The runtime command shown above runs a local, stdio-based MCP server. Ensure the path to the built entry point is correct for your environment. When you run the server, provide the same environment variables you would use in other deployment contexts.
Protect the admin token and limit access to the MCP server. Use strong, rotated admin credentials and restrict access to trusted clients and automation scripts. Only expose the server to trusted networks or environments.
Fetch a single record from a PocketBase collection by ID.
List records from a PocketBase collection with support for pagination, filtering, sorting, and relation expansion.
Create a new record in a PocketBase collection.
Update an existing record in a PocketBase collection.
Get the schema of a PocketBase collection.
Upload a file to a specified file field in a PocketBase collection record.
List all collections in the PocketBase instance.
Get the download URL for a file stored in a PocketBase collection record.
List API request logs from PocketBase.
Get a single API request log by its ID.
Get API request logs statistics with optional filtering.
List all registered app-level cron jobs.
Trigger a single cron job by its ID.
Set the directory where migration files will be created and read from.
Create a new, empty PocketBase migration file with a timestamped name.
Create a migration file for creating a new PocketBase collection.
Create a migration file for adding a field to an existing collection.
List all migration files in the migrations directory.
Apply a specific migration file.
Revert a specific migration file.
Apply all pending migrations.
Revert migrations up to a target point.