PocketBase MCP server

Provides a bridge between AI systems and PocketBase databases, enabling direct interaction with collections, records, and user authentication for applications that need to manipulate database data within conversations.
Back to servers
Setup instructions
Provider
Dynamic Endpoints
Release date
Mar 22, 2025
Language
TypeScript
Stats
57 stars

The PocketBase MCP Server enables advanced interactions with PocketBase databases through the Model Context Protocol (MCP). It provides tools for database operations, schema management, and data manipulation, all accessible through a structured API.

Installation

To set up the PocketBase MCP Server locally:

  1. Configure your MCP settings file located in your Cursor/Claude user settings directory:

    {
      "mcpServers": {
        "pocketbase-server": {
          "command": "node",
          "args": [
            "build/index.js"
          ],
          "env": {
            "POCKETBASE_URL": "http://127.0.0.1:8090",
            "POCKETBASE_ADMIN_EMAIL": "[email protected]",
            "POCKETBASE_ADMIN_PASSWORD": "admin_password"
          },
          "disabled": false,
          "autoApprove": [
            "create_record",
            "create_collection"
          ]
        }
      }
    }
    
  2. Set the correct environment variables:

    • POCKETBASE_URL: Required - URL of your PocketBase instance
    • POCKETBASE_ADMIN_EMAIL: Optional - Admin email for privileged operations
    • POCKETBASE_ADMIN_PASSWORD: Optional - Admin password
    • POCKETBASE_DATA_DIR: Optional - Custom data directory path

Available Tools

Collection Management

Creating a Collection

await mcp.use_tool("pocketbase", "create_collection", {
  name: "posts",
  schema: [
    {
      name: "title",
      type: "text",
      required: true
    },
    {
      name: "content",
      type: "text",
      required: true
    }
  ]
});

Getting Collection Information

await mcp.use_tool("pocketbase", "get_collection", {
  collection: "posts"
});

Record Operations

Creating Records

await mcp.use_tool("pocketbase", "create_record", {
  collection: "posts",
  data: {
    title: "My First Post",
    content: "This is the content of my first post."
  }
});

Listing Records

await mcp.use_tool("pocketbase", "list_records", {
  collection: "posts",
  filter: "title ~ 'First'",
  sort: "-created",
  limit: 10
});

Updating Records

await mcp.use_tool("pocketbase", "update_record", {
  collection: "posts",
  id: "record_id_here",
  data: {
    title: "Updated Post Title",
    content: "This content has been updated."
  }
});

Deleting Records

await mcp.use_tool("pocketbase", "delete_record", {
  collection: "posts",
  id: "record_id_here"
});

User Management

Authenticating Users

await mcp.use_tool("pocketbase", "authenticate_user", {
  email: "[email protected]",
  password: "securepassword",
  collection: "users"
});

Creating Users

await mcp.use_tool("pocketbase", "create_user", {
  email: "[email protected]",
  password: "securepassword",
  passwordConfirm: "securepassword",
  name: "New User"
});

Database Operations

Creating Database Backups

await mcp.use_tool("pocketbase", "backup_database", {
  format: "json" // or other supported formats
});

Configuration Options

When setting up the server in your MCP settings file, you can configure these options:

  • command: The command to start the server (typically node)
  • args: Arguments to pass to the command (path to the compiled JS file)
  • env: Environment variables for configuration
  • disabled: Whether to disable the server on startup
  • autoApprove: List of tools to automatically approve without prompting

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "pocketbase-server" '{"command":"node","args":["build/index.js"],"env":{"POCKETBASE_URL":"http://127.0.0.1:8090","POCKETBASE_ADMIN_EMAIL":"[email protected]","POCKETBASE_ADMIN_PASSWORD":"admin_password"},"disabled":false,"autoApprove":["create_record","create_collection"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "pocketbase-server": {
            "command": "node",
            "args": [
                "build/index.js"
            ],
            "env": {
                "POCKETBASE_URL": "http://127.0.0.1:8090",
                "POCKETBASE_ADMIN_EMAIL": "[email protected]",
                "POCKETBASE_ADMIN_PASSWORD": "admin_password"
            },
            "disabled": false,
            "autoApprove": [
                "create_record",
                "create_collection"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "pocketbase-server": {
            "command": "node",
            "args": [
                "build/index.js"
            ],
            "env": {
                "POCKETBASE_URL": "http://127.0.0.1:8090",
                "POCKETBASE_ADMIN_EMAIL": "[email protected]",
                "POCKETBASE_ADMIN_PASSWORD": "admin_password"
            },
            "disabled": false,
            "autoApprove": [
                "create_record",
                "create_collection"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later