npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gaspechak-pocketbase-mcp

v1.0.0

Published

MCP server for PocketBase — full database management from any AI assistant

Downloads

100

Readme

pocketbase-mcp

MCP server for PocketBase — full database management from any AI assistant.

Connect Claude, GitHub Copilot, Cursor, Windsurf, or any MCP-compatible AI tool directly to your PocketBase instance. Manage collections, records, auth, backups, and more through natural language.

Quick Start

npx pocketbase-mcp

Set environment variables to connect to your PocketBase instance:

PB_URL=http://127.0.0.1:8090 [email protected] PB_PASSWORD=yourpassword npx pocketbase-mcp

| Variable | Description | Default | |---------------|--------------------------------------|--------------------------| | PB_URL | PocketBase instance URL | http://127.0.0.1:8090 | | PB_EMAIL | Superuser email for auto-login | — | | PB_PASSWORD | Superuser password | — | | PB_TOKEN | Pre-existing auth token (alternative)| — |

Tools (25)

Authentication

| Tool | Description | |------|-------------| | auth_superuser | Login as superuser | | auth_user | Login as a regular user to test API rules |

Schema Introspection

| Tool | Description | |------|-------------| | schema_full | Get complete database schema with relationship map | | schema_collection | Get single collection details |

Schema Management

| Tool | Description | |------|-------------| | collection_create | Create collection with fields, rules, indexes | | collection_update | Modify existing collection | | collection_delete | Delete collection and all its records | | collections_import | Batch import/upsert collections |

Record Operations

| Tool | Description | |------|-------------| | record_list | Query with filtering, sorting, expanding relations | | record_get | Get single record by id | | record_create | Create a record | | record_update | Update a record (PATCH semantics) | | record_delete | Delete a record | | record_create_bulk | Create up to 200 records in parallel | | record_update_bulk | Update up to 200 records in parallel | | record_delete_bulk | Delete up to 200 records in parallel |

API Rule Testing

| Tool | Description | |------|-------------| | record_test_as_user | Test API rules as a specific authenticated user | | record_test_public | Test API rules without authentication |

Utilities

| Tool | Description | |------|-------------| | db_stats | Record count per collection | | health_check | Verify PocketBase connectivity and version | | backup_create | Create a database backup | | backup_list | List available backups | | logs_list | Query request logs | | file_url | Generate file URLs with optional protected file tokens |

Integration

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "pocketbase": {
      "command": "npx",
      "args": ["-y", "pocketbase-mcp"],
      "env": {
        "PB_URL": "http://127.0.0.1:8090",
        "PB_EMAIL": "[email protected]",
        "PB_PASSWORD": "yourpassword"
      }
    }
  }
}

VS Code / GitHub Copilot

Add to .vscode/mcp.json:

{
  "servers": {
    "pocketbase": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "pocketbase-mcp"],
      "env": {
        "PB_URL": "http://127.0.0.1:8090",
        "PB_EMAIL": "[email protected]",
        "PB_PASSWORD": "yourpassword"
      }
    }
  }
}

Cursor

Add to Cursor Settings → MCP Servers:

{
  "mcpServers": {
    "pocketbase": {
      "command": "npx",
      "args": ["-y", "pocketbase-mcp"],
      "env": {
        "PB_URL": "http://127.0.0.1:8090",
        "PB_EMAIL": "[email protected]",
        "PB_PASSWORD": "yourpassword"
      }
    }
  }
}

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "pocketbase": {
      "command": "npx",
      "args": ["-y", "pocketbase-mcp"],
      "env": {
        "PB_URL": "http://127.0.0.1:8090",
        "PB_EMAIL": "[email protected]",
        "PB_PASSWORD": "yourpassword"
      }
    }
  }
}

Development

git clone https://github.com/Gaspechak/pocketbase-mcp.git
cd pocketbase-mcp
npm install
npm run build

Run locally:

PB_URL=http://127.0.0.1:8090 [email protected] PB_PASSWORD=secret node dist/index.js

Project Structure

src/
├── index.ts              Entry point (stdio transport)
├── server.ts             MCP server creation and tool registration
├── config.ts             Environment variable configuration
├── http.ts               HTTP client helpers
├── helpers.ts            Response formatting utilities
├── schemas/
│   └── fields.ts         Zod schemas for PocketBase field types
└── tools/
    ├── auth.ts           Authentication tools
    ├── schema.ts         Schema introspection tools
    ├── collections.ts    Collection management tools
    ├── records.ts        Record CRUD and bulk operations
    ├── testing.ts        API rule testing tools
    └── utilities.ts      Stats, health, backups, logs, file URLs

License

MIT