mrwyndham_pocketbase_mcp

mrwyndham_pocketbase_mcp

by mrwyndham
An MCP server for rapid development of PocketBase applications with advanced database operations and schema management.

PocketBase MCP Server: Rapid Development for PocketBase Applications

Overview

The PocketBase MCP Server is a specialized server designed to accelerate the development of PocketBase applications. Built on the Model Context Protocol (MCP), it provides advanced tools for database operations, schema management, and data manipulation. This server is tested on the latest version of PocketBase (currently 26.1) and leverages the type definitions from the JS-SDK for improved accuracy and functionality.

Why Choose PocketBase MCP Server Over DynamicsEndpoints?

Unlike DynamicsEndpoints, this server is actively tested and refined for the latest PocketBase version. It uses correct type definitions from the JS-SDK, ensuring reliable performance. Many methods in DynamicsEndpoints are non-functional, making this server a superior choice for developers.

Setup MCP Server Locally

To set up the MCP server locally, follow these steps:

  1. Locate Your cline_mcp_settings.json File
    This file is typically found in your Cursor user settings directory. For example:
    /Users/yourusername/Library/Application Support/Cursor/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

  2. Configure the Server
    Add a new entry to the mcpServers object in your cline_mcp_settings.json file. Here’s an example configuration:

json { "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"] } } }

  • command: The command to start the server (usually node).
  • args: Arguments pointing to the compiled JavaScript file (e.g., build/index.js).
  • env: Environment variables for your PocketBase instance.
  • disabled: Whether to disable the server on startup.
  • autoApprove: List of tools to auto-approve.

  • Start the Server
    Once configured, the MCP server is ready to use with the specified tools.

Features

Collection Management

  • Create and manage collections with custom schemas.
  • Retrieve collection schemas and metadata.

Record Operations

  • Perform CRUD operations on records.
  • Support for relationship expansion, pagination, and cursor-based navigation.

User Management

  • User authentication and token management.
  • Create and manage user accounts.
  • Password management.

Database Operations

  • Create backups of the PocketBase database.

Available Tools

Collection Management

  • create_collection: Create a new collection with a custom schema.
  • get_collection: Retrieve schema details for a collection.

Record Operations

  • create_record: Add a new record to a collection.
  • list_records: List records with optional filters and pagination.
  • update_record: Modify an existing record.
  • delete_record: Remove a record.

User Management

  • authenticate_user: Authenticate a user and retrieve an auth token.
  • create_user: Create a new user account.

Database Operations

  • backup_database: Create a backup of the PocketBase database.

Configuration

The server requires the following environment variables:

  • Required:
  • POCKETBASE_URL: URL of your PocketBase instance (e.g., http://127.0.0.1:8090).

  • Optional:

  • POCKETBASE_ADMIN_EMAIL: Admin email for specific operations.
  • POCKETBASE_ADMIN_PASSWORD: Admin password.
  • POCKETBASE_DATA_DIR: Custom data directory path.

Usage Examples

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

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

Contributing

  1. Fork the repository.
  2. Create a feature branch.
  3. Commit your changes.
  4. Push to the branch.
  5. Submit a Pull Request.

About

The PocketBase MCP Server is designed to streamline PocketBase app development. For front-end solutions, consider FastPocket.

Topics

License

This project is licensed under the MIT License.

Resources

Features & Capabilities

Categories
mcp_server model_context_protocol javascript docker pocketbase database_management api_integration

Implementation Details

Stats

0 Views
8 GitHub Stars

Repository Info

mrwyndham Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300