mrwyndham pocketbase mcp

mrwyndham pocketbase mcp avatar

by mrwyndham

MCP server for building PocketBase apps really quickly - Need a front end quick consider FastPocket

What is mrwyndham pocketbase mcp

PocketBase MCP Server

A very much in progress MCP server based off of the Dynamics one that I have been testing and refining. 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).

Why This And Not DynamicsEndpoints?

This has actually been tested on the latest version. Currently 26.1 of PocketBase and is built off of the type definitions in the JS-SDK and not the arbitrary and wrong definitions found in the Dynamics one. Many of the methods don't even work.

Setup MCP Server Locally (Only Way Supported for Now)

To set up the MCP server locally, you'll need to configure it within your cline_mcp_settings.json or whatever you use (claude, cursor, the config looks identical you just need to find where it is stored) file. Here's how:

  1. Locate your cline_mcp_settings.json file: This file is usually located 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. The key should be a unique name for your server (e.g., "pocketbase-server"), and the value should be an object containing the server's configuration.

    {
      "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: An array of arguments to pass to the command. This should point to the compiled JavaScript file of your MCP server (e.g., build/index.js). Make sure the path is correct.
    • env: An object containing environment variables.
      • POCKETBASE_URL: The URL of your PocketBase instance. This is required.
      • POCKETBASE_ADMIN_EMAIL: The admin email for your PocketBase instance (optional, but needed for some operations).
      • POCKETBASE_ADMIN_PASSWORD: The admin password for your PocketBase instance (optional, but needed for some operations).
    • disabled: Whether to disable to server on startup.
    • autoApprove: list of tools to auto approve.
    • Adjust the values in the env object to match your PocketBase instance's settings.
  3. Start the server: After configuring the cline_mcp_settings.json file, you can start using the MCP server with the configured tools.

Features

Collection Management

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

Record Operations

  • CRUD operations for records
  • Relationship expansion support
  • Pagination and cursor-based navigation

User Management

  • User authentication and token management
  • User account creation and management
  • Password management

Database Operations

  • Database backup

Available Tools

Collection Management

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

Record Operations

  • create_record: Create a new record in a collection
  • list_records: List records with optional filters and pagination
  • update_record: Update an existing record
  • delete_record: Delete a record

User Management

  • authenticate_user: Authenticate a user and get auth token
  • create_user: Create a new user account

Database Operations

  • backup_database: Create a backup of the PocketBase database with format options

Configuration

The server requires the following environment variables:

Optional environment variables:

  • POCKETBASE_ADMIN_EMAIL: Admin email for certain 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 with password
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. Create a Pull Request

Leave a Comment

Frequently Asked Questions

What is MCP?

MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.

What are MCP Servers?

MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.

How do MCP Servers work?

MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.

Are MCP Servers secure?

Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.

Related MCP Servers

chrisdoc hevy mcp avatar

chrisdoc hevy mcp

mcp
sylphlab pdf reader mcp avatar

sylphlab pdf reader mcp

An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.

pdf-parsetypescriptnodejs
aashari mcp server atlassian bitbucket avatar

aashari mcp server atlassian bitbucket

Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.

atlassianrepositorymcp
aashari mcp server atlassian confluence avatar

aashari mcp server atlassian confluence

Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.

atlassianmcpconfluence
prisma prisma avatar

prisma prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

cockroachdbgomcp
Zzzccs123 mcp sentry avatar

Zzzccs123 mcp sentry

mcp sentry for typescript sdk

mcptypescript
zhuzhoulin dify mcp server avatar

zhuzhoulin dify mcp server

mcp
zhongmingyuan mcp my mac avatar

zhongmingyuan mcp my mac

mcp
zhixiaoqiang desktop image manager mcp avatar

zhixiaoqiang desktop image manager mcp

MCP 服务器,用于管理桌面图片、查看详情、压缩、移动等(完全让Trae实现)

mcp
zhixiaoqiang antd components mcp avatar

zhixiaoqiang antd components mcp

An MCP service for Ant Design components query | 一个减少 Ant Design 组件代码生成幻觉的 MCP 服务,包含系统提示词、组件文档、API 文档、代码示例和更新日志查询

designantdapi

Submit Your MCP Server

Share your MCP server with the community

Submit Now