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

pocketbase-cursor-mcp

v0.1.13

Published

PocketBase MCP Server for integration with Cursor AI IDE

Readme

PocketBase MCP Server for Cursor AI

Integration of PocketBase with Cursor AI through the Model Context Protocol (MCP). This server allows Cursor AI to directly interact with PocketBase databases, supporting collection management, record operations, and many other functionalities.

Features

Collection Management

  • Create and manage collections with custom schemas
  • Migrate collection schemas with data preservation capabilities
  • Advanced index management (create, delete, list)

Record Operations

  • CRUD operations (Create, Read, Update, Delete) for records
  • Advanced querying with filtering, sorting, and aggregation
  • Bulk import/export capabilities

Cursor AI Integration

  • Generate PocketBase schemas from TypeScript interfaces
  • Generate TypeScript interfaces from PocketBase collections
  • Analyze collection data and provide insights

Installation

1. Install the npm package

npm install -g pocketbase-cursor-mcp

or

pnpm add -g pocketbase-cursor-mcp

2. Configuration

You can configure the PocketBase MCP Server using environment variables or command line arguments:

Using environment variables

Create a .env file in the root directory of your project:

POCKETBASE_URL=http://127.0.0.1:8090
[email protected]  # Optional
POCKETBASE_ADMIN_PASSWORD=your-password        # Optional

Using command line arguments

pocketbase-cursor-mcp --url=http://127.0.0.1:8090 [email protected] --admin-password=your-password

Available options

| Command line arg | Environment variable | Description | |------------------------|-----------------------------|----------------------------------------| | --url, -u | POCKETBASE_URL | PocketBase server URL (required) | | --admin-email, -e | POCKETBASE_ADMIN_EMAIL | Admin email (optional) | | --admin-password, -p | POCKETBASE_ADMIN_PASSWORD| Admin password (optional) | | --data-dir, -d | POCKETBASE_DATA_DIR | Custom data directory path (optional) | | --port | PORT | HTTP server port (optional) | | --host | HOST | HTTP server host (optional) |

Use pocketbase-cursor-mcp --help to view all options.

Cursor AI Configuration

Configure MCP in Cursor AI

  1. Open Cursor AI
  2. Open Settings (or press Cmd+, on macOS, Ctrl+, on Windows/Linux)
  3. Select the "AI" tab
  4. Scroll down to "Model Context Protocol Servers"
  5. Add a new configuration with the following information:

Name: pocketbase
Command: npx
Args: pocketbase-cursor-mcp --url=http://127.0.0.1:8090

Or directly provide the path to the executable:

Command: Path to node executable (e.g., /usr/bin/node)
Args: Path to the executable file along with parameters (e.g., /usr/local/bin/pocketbase-cursor-mcp --url=http://127.0.0.1:8090)

Usage in Cursor AI

After configuration, you can use PocketBase MCP in Cursor AI by adding commands like the following to the editing interface:

Create a PocketBase collection from the following TypeScript interface:

interface User {
  username: string;
  email: string;
  isActive: boolean;
  age?: number;
  profile: UserProfile;
}

interface UserProfile {
  bio: string;
  avatar?: string;
  socialLinks: string[];
}

or

Generate TypeScript interfaces from the collections in my PocketBase database.

or

Analyze the data in the "products" collection and provide insights.

Available Tools

Basic PocketBase Tools

  • create_collection: Create a new collection
  • create_record: Create a new record
  • list_records: List records with optional filters
  • update_record: Update an existing record
  • delete_record: Delete a record
  • get_collection_schema: Get detailed schema for a collection
  • ... and many more tools

Cursor AI Specific Tools

  • generate_pb_schema: Generate PocketBase schema from TypeScript interfaces
  • generate_typescript_interfaces: Generate TypeScript interfaces from PocketBase collections
  • analyze_collection_data: Analyze data in a collection

Usage Examples

Creating a collection from TypeScript interface

const schema = await mcp.use_tool("pocketbase", "generate_pb_schema", {
  sourceCode: `
    interface Product {
      name: string;
      price: number;
      description: string;
      isAvailable: boolean;
      tags: string[];
    }
  `,
  options: {
    includeTimestamps: true
  }
});

const collection = await mcp.use_tool("pocketbase", "create_collection", {
  name: "products",
  schema: schema[0].schema
});

Generating TypeScript interfaces from PocketBase collections

const interfaces = await mcp.use_tool("pocketbase", "generate_typescript_interfaces", {
  options: {
    includeRelations: true
  }
});

// Interfaces can be used in your TypeScript project

Analyzing collection data

const analysis = await mcp.use_tool("pocketbase", "analyze_collection_data", {
  collection: "products",
  options: {
    sampleSize: 500
  }
});

// View insights about your data
console.log(analysis.insights);

Contributing

Contributions are always welcome! Please create an issue or pull request.

License

MIT