PocketBase

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.
  • typescript

31

GitHub Stars

typescript

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

Prerequisites you need on your system before installing:

  • Node.js (version compatible with the project)
  • npm (comes with Node.js)
  • git (to clone the repository, if you plan to obtain the source)

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 build

## Configuration

The 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.

## Cline Installation

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" ] } } }

## Notes and tips

- 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.

## Security considerations

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.

## Available tools

### fetch\_record

Fetch a single record from a PocketBase collection by ID.

### list\_records

List records from a PocketBase collection with support for pagination, filtering, sorting, and relation expansion.

### create\_record

Create a new record in a PocketBase collection.

### update\_record

Update an existing record in a PocketBase collection.

### get\_collection\_schema

Get the schema of a PocketBase collection.

### upload\_file

Upload a file to a specified file field in a PocketBase collection record.

### list\_collections

List all collections in the PocketBase instance.

### download\_file

Get the download URL for a file stored in a PocketBase collection record.

### list\_logs

List API request logs from PocketBase.

### get\_log

Get a single API request log by its ID.

### get\_logs\_stats

Get API request logs statistics with optional filtering.

### list\_cron\_jobs

List all registered app-level cron jobs.

### run\_cron\_job

Trigger a single cron job by its ID.

### set\_migrations\_directory

Set the directory where migration files will be created and read from.

### create\_migration

Create a new, empty PocketBase migration file with a timestamped name.

### create\_collection\_migration

Create a migration file for creating a new PocketBase collection.

### add\_field\_migration

Create a migration file for adding a field to an existing collection.

### list\_migrations

List all migration files in the migrations directory.

### apply\_migration

Apply a specific migration file.

### revert\_migration

Revert a specific migration file.

### apply\_all\_migrations

Apply all pending migrations.

### revert\_to\_migration

Revert migrations up to a target point.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational