Get the FREE Ultimate OpenClaw Setup Guide →

advanced-pocketbase

pocketbase-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio dynamicendpoints-advanced-pocketbase-mcp-server node dist/index.js \
  --env POCKETBASE_URL="<POCKETBASE_URL, e.g., https://127.0.0.1:8090>" \
  --env POCKETBASE_DATA_DIR="<optional data directory path>" \
  --env POCKETBASE_ADMIN_EMAIL="<admin email, e.g., admin@example.com>" \
  --env POCKETBASE_ADMIN_PASSWORD="<admin password>"

How to use

This MCP server provides a comprehensive set of tools for interacting with a PocketBase database via the Model Context Protocol. It exposes capabilities for managing collections, performing advanced record operations, handling user authentication and authorization, and executing core database tasks such as backup and data migration. You can use the defined tools through the MCP interface to create and migrate collections, query and modify records, manage user accounts and tokens, and perform data import/export workflows. The server is designed to work with a connected PocketBase instance and supports advanced features like schema validation, index management, relationship expansion, and batch operations. To get started, initialize the MCP client against the server and begin invoking tools like create_collection, migrate_collection, manage_indexes, create_record, query_collection, authenticate_user, and backup_database to perform routine and advanced database tasks within your application flow.

How to install

Prerequisites:

  • Node.js (>= 14) and npm/yarn installed
  • A running PocketBase instance accessible from the MCP server
  • Access to manage environment variables for the server
  1. Install dependencies and build
npm install
npm run build
  1. Configure environment
  • Copy the example env file if provided and tailor the values:
cp .env.example .env
  • Set essential variables such as POCKETBASE_URL, POCKETBASE_ADMIN_EMAIL, POCKETBASE_ADMIN_PASSWORD, and optional POCKETBASE_DATA_DIR.
  1. Run the MCP server
npm start
  1. Verify accessibility
  • Ensure the MCP server starts without errors and that it can reach the PocketBase instance at the configured POCKETBASE_URL.
  • Use the MCP client to connect to the server named in mcp_config (e.g., advanced-pocketbase) and begin issuing tools.

Notes:

  • If you are deploying in production, consider additional security steps such as securing environment variables and restricting access to the MCP port.
  • See the README for a list of available tools and their input schemas.

Additional notes

Environment variables:

  • POCKETBASE_URL is required to point to your PocketBase instance.
  • POCKETBASE_ADMIN_EMAIL and POCKETBASE_ADMIN_PASSWORD are used for admin-level operations where appropriate.
  • POCKETBASE_DATA_DIR is optional and determines where PocketBase stores its data.

Debugging tips:

  • Check server logs for connectivity errors to PocketBase (certificates, CORS, or firewall issues).
  • If collection schemas or indexes do not apply as expected, verify that PocketBase endpoint URLs and access permissions are correct.

Configuration options:

  • You can extend mcp_config.env with additional vars if your deployment requires custom settings or integration keys.
  • Ensure the MCP server has network access to PocketBase and any external authentication providers you plan to use.

Related MCP Servers

Sponsor this space

Reach thousands of developers