PocketBase MCP server

Provides a TypeScript-based server for interacting with PocketBase, enabling flexible database management and configuration through natural language interfaces.
Back to servers
Provider
Imre Borbás
Release date
Mar 07, 2025
Language
TypeScript
Stats
1 star

The PocketBase MCP Server is a TypeScript-based implementation of the Model Context Protocol (MCP) that integrates with PocketBase databases. It provides tools for listing and interacting with PocketBase collections, allowing AI assistants like Claude to access your database information.

Installation

Basic Setup

  1. Install the package dependencies:
npm install
  1. Build the server:
npm run build

Configuration for Claude Desktop

To use this MCP server with Claude Desktop, you need to add the server configuration to Claude's config file:

On MacOS:

~/Library/Application Support/Claude/claude_desktop_config.json

On Windows:

%APPDATA%/Claude/claude_desktop_config.json

Add the following configuration to the JSON file:

{
  "mcpServers": {
    "pocketbase-mcp-server": {
      "command": "/path/to/pocketbase-mcp-server/build/index.js --pb-url=http://localhost:8090 [email protected] --pb-admin-password=your-secure-password"
    }
  }
}

PocketBase Configuration

Required Parameters

To connect to your PocketBase instance, you must provide these configuration parameters either as command-line arguments or environment variables:

Parameter Command Line Environment Variable Description
PocketBase URL --pb-url=<url> PB_URL URL of your PocketBase instance
Admin Email --pb-admin-email=<email> PB_ADMIN_EMAIL Admin email for authentication
Admin Password --pb-admin-password=<password> PB_ADMIN_PASSWORD Admin password for authentication

Using Environment Variables

If you prefer using environment variables:

export PB_URL=http://localhost:8090
export [email protected]
export PB_ADMIN_PASSWORD=your-secure-password

Using Command Line Arguments

Alternatively, provide the parameters directly:

node build/index.js --pb-url=http://localhost:8090 [email protected] --pb-admin-password=your-secure-password

Using the MCP Server

Available Tools

Currently, the server provides the following tools:

  • pocketbase_list_collections: Lists all collections from your PocketBase instance and returns them in JSON format

Debugging

Since MCP servers communicate over standard input/output, debugging can be challenging. Use the MCP Inspector to help with debugging:

npm run inspector

This will provide a URL to access debugging tools in your browser, allowing you to monitor communication between Claude and your MCP server.

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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