Skip to main content
Glama
PocketBase MCP Server

PocketBase MCP Server

by fadlee

dynamic-pocketbase-mcp

Dynamischer Model Context Protocol (MCP)-Server für PocketBase. Verbinden Sie Ihren KI-Client einmal und verwalten Sie dann Sammlungen und Datensätze in jedem PocketBase-Projekt mithilfe von Laufzeit-Tools.

Warum dieser Server anders ist

Viele PocketBase MCP-Server sind statisch: Sie kodieren sammlungsspezifisches Verhalten fest oder erfordern benutzerdefinierte Tool-Definitionen pro Schema.

dynamic-pocketbase-mcp ist dynamisch:

  • Verwendet sammlungsunabhängige Tools (list_collections, list_records, create_record usw.)

  • Funktioniert über bestehende und neu erstellte Sammlungen hinweg, ohne den Server-Code neu generieren zu müssen

  • Stellt Live-PocketBase-Sammlungen als MCP-Ressourcen bereit

Related MCP server: PocketBase MCP Server

Funktionen

  • 18 MCP-Tools für Status, Authentifizierung, Sammlungen, Regeln und Datensätze

  • Lebenszyklus-Operationen für Sammlungen (erstellen, aktualisieren, löschen, inspizieren)

  • Datensatz-CRUD mit Filtern, Sortierung, Paginierung und Feldauswahl

  • Sitzungsbasierte Authentifizierung über Tools (auth_admin, auth_user, get_auth_status, logout)

  • Integrierte Referenzen für Feldschema und Regel-Syntax

Installation

npm install dynamic-pocketbase-mcp
# or
bun install dynamic-pocketbase-mcp

Konfiguration in einem KI-Client

Claude Desktop

Fügen Sie dies zu Ihrer Claude Desktop-Konfiguration hinzu (~/Library/Application Support/Claude/claude_desktop_config.json unter macOS):

{
  "mcpServers": {
    "dynamic-pocketbase": {
      "command": "npx",
      "args": ["-y", "dynamic-pocketbase-mcp"]
    }
  }
}

Wenn POCKETBASE_URL nicht gesetzt ist, verwendet der Server standardmäßig http://localhost:8090.

Direkte Verwendung

# Use default URL (http://localhost:8090)
npx -y dynamic-pocketbase-mcp

# Use custom PocketBase URL
POCKETBASE_URL=https://pb.example.com \
bunx dynamic-pocketbase-mcp

Einfaches Tutorial: Chatten mit KI unter Verwendung dieses MCP

Nachdem Sie Ihren MCP-Client konfiguriert haben, öffnen Sie einen Chat und versuchen Sie Prompts wie diese:

  1. "Setze die PocketBase-URL auf https://pb.example.com."

  2. "Überprüfe den Status meines PocketBase-Servers."

  3. "Liste alle PocketBase-Sammlungen auf."

  4. "Authentifiziere dich als Admin mit E-Mail <your-email> und Passwort <your-password>."

  5. "Erstelle eine Sammlung namens notes mit einem erforderlichen title Textfeld."

  6. "Erstelle einen Datensatz in notes mit dem Titel Erste Notiz."

  7. "Zeige alle Datensätze in notes an, die neuesten zuerst."

  8. "Melde dich von der PocketBase-Authentifizierungssitzung ab."

Wenn diese Schritte erfolgreich sind, kann Ihre KI nun Schema und Daten über diesen MCP-Server verwalten.

Authentifizierungsablauf (über Tools)

  1. auth_admin oder auth_user

  2. get_auth_status

  3. logout

Verfügbare Tools

Status und Referenzen

  • health - Überprüfe den Status des PocketBase-Servers

  • set_base_url - Aktualisiere die PocketBase-URL für die aktuelle MCP-Sitzung und lösche das Authentifizierungs-Token

  • get_field_schema_reference - Dokumentation zu Feldtypen abrufen

  • get_rules_reference - Referenz zur API-Regel-Syntax abrufen

Authentifizierung

  • auth_admin - Authentifizierung als Admin/Superuser

  • auth_user - Authentifizierung als Benutzer einer Auth-Sammlung (E-Mail/Benutzername)

  • get_auth_status - Aktuellen Authentifizierungsstatus überprüfen

  • logout - Authentifizierungssitzung beenden

Sammlungen

  • list_collections - Alle Sammlungen auflisten

  • view_collection - Sammlung nach Name oder ID anzeigen

  • create_collection - Neue Sammlung erstellen (fügt automatisch created und updated Datumsfelder für Basis-/Auth-Sammlungen hinzu, sofern nicht anders angegeben)

  • update_collection - Sammlungsschema/-einstellungen aktualisieren

  • delete_collection - Sammlung löschen

  • update_collection_rules - Zugriffskontrollregeln aktualisieren

Datensätze

  • list_records - Datensätze auflisten/suchen mit Filtern, Sortierung, Paginierung

  • view_record - Einzelnen Datensatz nach ID anzeigen

  • create_record - Neuen Datensatz erstellen

  • update_record - Bestehenden Datensatz aktualisieren

  • delete_record - Datensatz löschen

Entwicklung

# Install dependencies
bun install

# Run in development mode
bun run dev

# Type check
bun run typecheck

# Run tests (builds dist first)
bun run test

# Run all checks (typecheck + tests)
bun run check

# Interactive release helper (bump, check, publish, push tag)
bun run release

# Build for production
bun run build

Umgebungsvariablen

Variable

Erforderlich

Beschreibung

POCKETBASE_URL

Nein

PocketBase-Server-URL (Standard: http://localhost:8090)

Lizenz

MIT

Available Tools

22 tools
analyze_collection_dataC

Analyze data patterns and provide insights about a collection

Inputs: collection (required), options.

authenticate_userC

Authenticate a user and get auth token

Inputs: email (required), password (required), autoRefreshThreshold, collection.

backup_databaseC

Create a backup of the PocketBase database

Inputs: format.

create_collectionC

Create a new collection in PocketBase

Inputs: fields (required), name (required), createRule, deleteRule, +7 more.

create_recordC

Create a new record in a collection

Inputs: collection (required), data (required), expand, fields.

create_userC

Create a new user account

Inputs: email (required), password (required), passwordConfirm (required), additionalData, +3 more.

delete_collectionB

Delete a collection from PocketBase

Inputs: collection (required).

delete_recordC

Delete a record

Inputs: collection (required), id (required).

download_fileC

Download a file from a record in PocketBase

Inputs: collection (required), fileField (required), recordId (required).

generate_pb_schemaB

Generate a PocketBase schema based on TypeScript interfaces or database diagram

Inputs: sourceCode (required), options.

generate_typescript_interfacesB

Generate TypeScript interfaces from PocketBase collections

Inputs: collections, options.

get_collection_schemaC

Get schema details for a collection

Inputs: collection (required).

import_dataC

Import data into a collection

Inputs: collection (required), data (required), mode.

list_collectionsC

List all collections with optional sorting

Inputs: sort.

list_recordsC

List records from a collection with optional filters

Inputs: collection (required), expand, fields, filter, +4 more.

manage_indexesC

Manage collection indexes

Inputs: action (required), collection (required), index.

migrate_collectionC

Add, remove, or modify fields from a collection

Inputs: collection (required), fields (required), createRule, dataTransforms, +5 more.

query_collectionC

Advanced query with filtering, sorting, and aggregation

Inputs: collection (required), aggregate, expand, filter, +1 more.

truncate_collectionB

Delete all records associated with the specified collection

Inputs: collection (required).

update_recordC

Update an existing record

Inputs: collection (required), data (required), id (required), expand, +1 more.

upload_fileB

Upload a file to a record in PocketBase

Inputs: collection (required), fileContent (required), fileField (required), fileName (required), +1 more.

upload_file_from_urlC

Upload a file from URL to a record in PocketBase

Inputs: collection (required), fileField (required), recordId (required), url (required), +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 22 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific resources and actions, but some potential confusion exists: 'list_records' and 'query_collection' both retrieve records, though 'query_collection' offers advanced features; 'upload_file' and 'upload_file_from_url' are closely related but differentiated by source. Overall, descriptions help clarify boundaries, but minor overlaps could cause occasional misselection.

    Naming Consistency5/5

    Tool names follow a highly consistent verb_noun pattern throughout, such as 'create_collection', 'delete_record', and 'list_records'. All tools use snake_case with clear, descriptive verbs aligned with their actions, making the set predictable and easy to navigate without any deviations in style.

    Tool Count4/5

    With 22 tools, the count is slightly high for a typical MCP server scope, but it is reasonable given the comprehensive coverage of PocketBase operations. It includes CRUD, schema management, data handling, and utilities, which justifies the number, though it might feel heavy compared to more focused servers.

    Completeness5/5

    The tool set provides complete coverage for PocketBase operations, including full CRUD for collections and records, user authentication, schema management, data import/export, file handling, and utilities like backup and analysis. There are no obvious gaps, ensuring agents can handle all core workflows without dead ends.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      D
      quality
      Not graded
      maintenance
      A comprehensive MCP server that provides sophisticated tools for interacting with PocketBase databases. This server enables advanced database operations, schema management, and data manipulation through the Model Context Protocol (MCP).
      14
      164 npm
      70
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      MCP server that allows interaction with PocketBase databases, enabling record operations (fetch, list, create, update), file management, and schema migrations through natural language.
      22
      43
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants and MCP clients to interact with PocketBase databases for authentication, data management, and administrative operations.
      65
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables creating and managing collections, performing record CRUD operations with pagination and expansions, handling user authentication, and backing up PocketBase databases through MCP tools.
      18 npm
      ISC