@mcpdotdirect/template-mcp-server logo

@mcpdotdirect/template-mcp-server

Community
ssakone

A Model Context Protocol (MCP) server that provides comprehensive access to PocketBase functionality. This server enables AI assistants and other MCP clients to interact with PocketBase databases for…

Publisherssakone
Repositorypb_mcp_server
LanguageTypeScript
Forks
3
Stars
65
Available tools
0
Transport typestdio, streamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    @mcpdotdirect/template-mcp-server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    65 stars and 3 forks from the linked repository.

PocketBase MCP Server

License: MIT TypeScript

A Model Context Protocol (MCP) server that provides comprehensive access to PocketBase functionality. This server enables AI assistants and other MCP clients to interact with PocketBase databases for authentication, data management, and administrative operations.

Features

  • Authentication: Admin and user authentication with session management
  • Session Persistence: Save sessions across tool calls with saveSession parameter
  • Auto-Authentication: Automatically authenticate at startup using environment variables
  • Collection Management: Create, update, delete, and query collections (admin only)
  • Record CRUD: Full create, read, update, delete operations on records
  • User Management: Manage user accounts in auth collections
  • Custom Headers: Send custom HTTP headers with any request
  • Custom HTTP Requests: Send raw HTTP requests to any PocketBase API endpoint
  • Query Support: Filtering, sorting, and pagination for records and users
  • Error Handling: Consistent, informative error responses
  • Multi-Instance: Support for connecting to multiple PocketBase instances
  • TOON Output Format: Optional TOON format for 30-60% token reduction with LLMs

Installation

bash
# Clone the repository
git clone https://github.com/ssakone/pocketbase-mcp-server.git
cd pocketbase-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

Configuration

Environment Variables

Create a .env file or set environment variables:

bash
# PocketBase server URL (default: http://127.0.0.1:8090)
POCKETBASE_URL=http://127.0.0.1:8090

# Admin token for authenticated operations (optional - can be provided per-request)
POCKETBASE_ADMIN_TOKEN=your_admin_token_here

# Auto-authentication at startup (optional)
# If both are provided, the server will authenticate and obtain a token automatically
POCKETBASE_ADMIN_EMAIL=admin@example.com
POCKETBASE_ADMIN_PASSWORD=your_admin_password

# Output format: json (default) or toon
# TOON format reduces token usage by 30-60% when communicating with LLMs
MCP_OUTPUT_FORMAT=json

Configuration File

Alternatively, create a pocketbase.config.json:

json
{
  "pocketbaseUrl": "http://127.0.0.1:8090",
  "pocketbaseAdminToken": "your_admin_token_here"
}

Running the Server

stdio Mode (for MCP clients like Cursor, Kiro)

bash
npm start

HTTP/SSE Mode (for web clients and remote access)

bash
# Default port 3001
npm run start:http

# Custom port
PORT=8080 npm run start:http

The HTTP server exposes an SSE endpoint at http://localhost:3001/sse.

MCP Client Configuration

Cursor/Kiro Configuration

Add to your MCP configuration:

json
{
  "mcpServers": {
    "pocketbase": {
      "command": "npm",
      "args": ["start"],
      "cwd": "/path/to/pocketbase-mcp-server",
      "env": {
        "POCKETBASE_URL": "http://127.0.0.1:8090",
        "POCKETBASE_ADMIN_EMAIL": "admin@example.com",
        "POCKETBASE_ADMIN_PASSWORD": "your_password"
      }
    }
  }
}

Available Tools

Authentication Tools

authenticate_admin

Authenticate as a PocketBase admin with full access to all operations.

json
{
  "email": "admin@example.com",
  "password": "adminpassword",
  "baseUrl": "http://127.0.0.1:8090",
  "saveSession": true
}
ParameterTypeDescription
emailstringAdmin email address
passwordstringAdmin password
baseUrlstringPocketBase URL (optional)
saveSessionbooleanSave session for subsequent requests (default: true)

authenticate_user

Authenticate as a regular user with permissions based on collection rules.

json
{
  "email": "user@example.com",
  "password": "userpassword",
  "collection": "users",
  "baseUrl": "http://127.0.0.1:8090",
  "saveSession": true
}
ParameterTypeDescription
emailstringUser email address
passwordstringUser password
collectionstringAuth collection name (default: "users")
baseUrlstringPocketBase URL (optional)
saveSessionbooleanSave session for subsequent requests (default: true)

logout

Clear the current authentication session.

check_auth_status

Check if there's an active authentication session.

Collection Management Tools (Admin Only)

list_collections

Get all collections with their metadata.

get_collection

Get detailed information about a specific collection.

create_collection

Create a new collection with schema definition.

json
{
  "name": "posts",
  "type": "base",
  "schema": [
    { "name": "title", "type": "text", "required": true },
    { "name": "content", "type": "editor", "required": false },
    { "name": "published", "type": "bool", "required": false }
  ],
  "listRule": "",
  "viewRule": "",
  "createRule": "@request.auth.id != ''",
  "updateRule": "@request.auth.id != ''",
  "deleteRule": "@request.auth.id != ''"
}

update_collection

Update an existing collection's schema or rules.

delete_collection

Delete a collection and all its records.

Record CRUD Tools

All record tools support custom headers via the headers parameter.

list_records

Query records with filtering, sorting, and pagination.

json
{
  "collection": "posts",
  "filter": "published = true && created > '2024-01-01'",
  "sort": "-created,title",
  "page": 1,
  "perPage": 20,
  "expand": "author",
  "headers": { "X-Custom-Header": "value" }
}

get_record

Get a single record by ID.

json
{
  "collection": "posts",
  "id": "record_id_here",
  "expand": "author,comments"
}

create_record

Create a new record in a collection.

json
{
  "collection": "posts",
  "data": {
    "title": "My First Post",
    "content": "Hello, world!",
    "published": true
  }
}

update_record

Update an existing record.

delete_record

Delete a record from a collection.

User Management Tools

User management tools respect PocketBase collection rules. Admin token is optional and only needed for privileged operations.

list_users

List users from an auth collection with filtering.

json
{
  "collection": "users",
  "filter": "verified = true",
  "sort": "-created",
  "page": 1,
  "perPage": 20,
  "headers": { "X-Custom-Header": "value" }
}

get_user

Get a single user by ID.

create_user

Create a new user account.

json
{
  "collection": "users",
  "email": "newuser@example.com",
  "password": "securepassword123",
  "passwordConfirm": "securepassword123",
  "emailVisibility": false,
  "verified": true,
  "name": "John Doe"
}

update_user

Update an existing user.

delete_user

Delete a user account.

Custom HTTP Requests Tool

send_custom_request

Send raw HTTP requests to any PocketBase API endpoint. Supports all authentication types (admin, user, or public) and maintains session state across requests.

json
{
  "method": "GET",
  "endpoint": "/api/collections/posts/records",
  "queryParams": {
    "filter": "status='published'",
    "sort": "-created",
    "perPage": "10"
  },
  "headers": {
    "X-Custom-Header": "value"
  }
}
ParameterTypeDescription
methodstringHTTP method: GET, POST, PUT, PATCH, DELETE
endpointstringAPI endpoint (e.g., '/api/collections/posts/records')
bodyobjectRequest body for POST/PUT/PATCH requests
queryParamsobjectURL query parameters
headersobjectCustom HTTP headers
baseUrlstringPocketBase URL (optional)
adminTokenstringAdmin token for privileged endpoints (optional)

Examples:

Get published posts with custom filtering:

json
{
  "method": "GET",
  "endpoint": "/api/collections/posts/records",
  "queryParams": {
    "filter": "status='published' && created > '2024-01-01'",
    "sort": "-created",
    "expand": "author,category",
    "perPage": "20"
  }
}

Create a new record with custom data:

json
{
  "method": "POST",
  "endpoint": "/api/collections/posts/records",
  "body": {
    "title": "My Custom Post",
    "content": "This was created via custom request",
    "status": "draft",
    "author": "user123"
  }
}

Admin-only settings request:

json
{
  "method": "GET",
  "endpoint": "/api/settings",
  "adminToken": "your_admin_token_here"
}

Custom file upload:

json
{
  "method": "POST",
  "endpoint": "/api/collections/users/records/user123",
  "headers": {
    "Content-Type": "multipart/form-data"
  },
  "body": {
    "avatar": "file_data_here"
  }
}

The send_custom_request tool supports multiple authentication methods:

  • Current Session: Uses existing authentication (admin or user)
  • Environment Token: Falls back to POCKETBASE_ADMIN_TOKEN if set
  • Explicit Token: Provide adminToken parameter for admin operations
  • No Auth: Public endpoints don't require authentication

Custom Request Examples

Advanced Filtering with Aggregation

json
{
  "method": "GET",
  "endpoint": "/api/collections/orders/records",
  "queryParams": {
    "filter": "status='completed' && total > 100",
    "sort": "-total",
    "fields": "id,user,total,status,created",
    "expand": "user",
    "perPage": "50"
  }
}

Batch Operations with Custom Logic

json
{
  "method": "POST",
  "endpoint": "/api/collections/posts/records",
  "body": {
    "title": "Batch Created Post",
    "content": "Created via custom request",
    "tags": ["automated", "custom"],
    "published": true,
    "author": "{{current_user_id}}"
  }
}

Custom Validation Endpoint

json
{
  "method": "POST",
  "endpoint": "/api/collections/users/records/validate",
  "body": {
    "email": "test@example.com",
    "password": "secure123"
  }
}

Health Check with Custom Headers

json
{
  "method": "GET",
  "endpoint": "/api/health",
  "headers": {
    "X-Client-Version": "1.0.0",
    "X-Request-ID": "custom-request-123"
  }
}

Common Parameters

Most tools accept these optional parameters:

ParameterTypeDescription
baseUrlstringPocketBase server URL
adminTokenstringAdmin token for privileged access
headersobjectCustom HTTP headers to send with the request

Error Handling

All tools return consistent error responses:

json
{
  "success": false,
  "error": "Human-readable error message",
  "code": "ERROR_CODE",
  "details": { "field": "specific error details" },
  "suggestion": "How to fix the error"
}

Error Codes

CodeDescription
AUTH_INVALIDInvalid credentials
AUTH_REQUIREDAuthentication required
FORBIDDENInsufficient permissions
NOT_FOUNDResource not found
VALIDATION_ERRORInvalid input data
NETWORK_ERRORConnection issues
UNKNOWN_ERRORUnexpected error

PocketBase Filter Syntax

The filter parameter uses PocketBase's filter syntax:

# Equality
status = 'active'

# Comparison
created > '2024-01-01'
price >= 100

# Logical operators
status = 'active' && published = true
category = 'tech' || category = 'science'

# Contains/Like
title ~ 'hello'      # contains
title !~ 'spam'      # not contains

# Null checks
avatar = null
avatar != null

# Relations
author.name = 'John'

Development

bash
# Run in development mode with auto-reload
npm run dev

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Build for production
npm run build

Author

Abdramane Sakone

License

MIT License - see LICENSE for details.

Installation

TypingMind
{
  "mcpServers": {
    "pb-mcp-server": {
      "command": "npm",
      "args": [
        "start"
      ]
    }
  }
}

Use @mcpdotdirect/template-mcp-server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once @mcpdotdirect/template-mcp-server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add @mcpdotdirect/template-mcp-server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the @mcpdotdirect/template-mcp-server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "pb-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "pocketbase-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the @mcpdotdirect/template-mcp-server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the @mcpdotdirect/template-mcp-server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use @mcpdotdirect/template-mcp-server to help me with this task?
@mcpdotdirect/template-mcp-server
Sure. I read it.
Here is what I found using @mcpdotdirect/template-mcp-server.

Option 2: Add an MCP server URL

Use this when @mcpdotdirect/template-mcp-server is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for @mcpdotdirect/template-mcp-server.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the @mcpdotdirect/template-mcp-server connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the @mcpdotdirect/template-mcp-server tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the @mcpdotdirect/template-mcp-server tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use @mcpdotdirect/template-mcp-server to help me with this task?
@mcpdotdirect/template-mcp-server
Sure. I read it.
Here is what I found using @mcpdotdirect/template-mcp-server.

Frequently asked questions

What is the @mcpdotdirect/template-mcp-server MCP server used for?

@mcpdotdirect/template-mcp-server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use @mcpdotdirect/template-mcp-server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use @mcpdotdirect/template-mcp-server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use @mcpdotdirect/template-mcp-server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With @mcpdotdirect/template-mcp-server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect @mcpdotdirect/template-mcp-server MCP to TypingMind?

@mcpdotdirect/template-mcp-server can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does @mcpdotdirect/template-mcp-server MCP provide in TypingMind?

@mcpdotdirect/template-mcp-server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use @mcpdotdirect/template-mcp-server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If @mcpdotdirect/template-mcp-server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇