pocketbase-mcp-bridge

by nestebe

Not rated
GitHub

About

MCP server for PocketBase Browse Pocketbase Bridge MCP Server for Claude, Cursor, VS Code, and other AI agents.

Details

Author
nestebe
Categories
Developer Tools

Setup

Install pocketbase-mcp-bridge in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/nestebe/pocketbase-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

AcompleteModel Context Protocolserver forPocketBase. It exposes the full PocketBase management surface — collections, records, authentication, files, logs, settings, backups and crons — as MCP tools that an AI assistant (Claude Desktop, Claude Code, Cursor, etc.) can call directly.

Built and validated againstPocketBase v0.39.6using the officialpocketbaseJS SDK.

55 toolsacross every part of the PocketBase API:

- Auto-authenticationas a superuser from environment variables, with transparent re-auth when the token expires.
- File uploads/downloadsto/from the local filesystem (multipart handled for you).
- Transactional batchoperations (create/update/delete/upsert) in one request.
- Non-destructive user auth— authenticating as an end user never clobbers the MCP's own superuser session.
- send_raw_requestguarantees completeness: anything the dedicated tools don't cover (custom routes, new API features) is still reachable.

The server reads its connection settings from environment variables:

Required unlessPOCKETBASE_TOKENis provided.

Add the server to your MCP client (Claude Desktopclaude_desktop_config.json, Claude Code, Cursor, …). The recommended, zero-install form usesnpx:

{ "mcpServers": { "pocketbase": { "command": "npx", "args": ["-y", "pocketbase-mcp-bridge"], "env": { "POCKETBASE_URL": "", "POCKETBASE_ADMIN_EMAIL": "", "POCKETBASE_ADMIN_PASSWORD": "" } } } }

Fill the threeenvvalues with your instance URL and superuser credentials (keep secrets inenv, never inargs). The-yflag lets clients launch the server non-interactively.

{ "mcpServers": { "pocketbase": { "command": "node", "args": ["/absolute/path/to/pocketbase-mcp/dist/index.js"], "env": { "POCKETBASE_URL": "", "POCKETBASE_ADMIN_EMAIL": "", "POCKETBASE_ADMIN_PASSWORD": "" } } } }
{ "mcpServers": { "pocketbase": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "POCKETBASE_URL", "-e", "POCKETBASE_ADMIN_EMAIL", "-e", "POCKETBASE_ADMIN_PASSWORD", "pocketbase-mcp-bridge" ], "env": { "POCKETBASE_URL": "http://host.docker.internal:8090", "POCKETBASE_ADMIN_EMAIL": "", "POCKETBASE_ADMIN_PASSWORD": "" } } } }

The published package works out of the box withnpx -y pocketbase-mcp-bridge(see above) — no manual install needed once it is on npm.

git clone https://github.com/nestebe/pocketbase-mcp.git cd pocketbase-mcp npm install npm run build # compiles TypeScript to dist/

The entry point isdist/index.js(a stdio MCP server with a#!/usr/bin/env nodeshebang, also exposed as thepocketbase-mcp-bridgebin).

docker build -t pocketbase-mcp-bridge . docker run -i --rm \ -e POCKETBASE_URL=http://host.docker.internal:8090 \ -e POCKETBASE_ADMIN_EMAIL=admin@example.com \ -e POCKETBASE_ADMIN_PASSWORD=secret \ pocketbase-mcp-bridge

The image is a stdio server — run it with-i(interactive) so the MCP client can talk to it over stdin/stdout.

A ready-to-run PocketBase is provided for development and validation:

docker compose -f docker-test/docker-compose.yml up -d

- Dashboard:http://localhost:8090/_/
- REST API:
http://localhost:8090/api/
- Superuser (auto-created on first boot):

- email:admin@yourdomain.com
- password:your-secure-password-here

docker compose -f docker-test/docker-compose.yml down # stop docker compose -f docker-test/docker-compose.yml down -v # stop + wipe data

Settings encryption is intentionallydisabledin this local setup. For production, enable it with a32-characterkey via--encryptionEnv(see the comments indocker-test/docker-compose.yml).

node scripts/smoke-test.mjs # collections, records, batch, settings, logs, crons... node scripts/smoke-test-files-auth.mjs # users auth, file upload/download, impersonation, backups

Both spawn the compiled server over stdio and exercise the tools against the live instance.

- PocketBase 0.23+ removed implicitcreated/updatedfields.New base collections have no timestamp columns unless you add them. To sort by creation date, addautodatefields when creating the collection:

{ "name": "created", "type": "autodate", "onCreate": true }, { "name": "updated", "type": "autodate", "onCreate": true, "onUpdate": true }
src/ index.ts # stdio entry point + eager auth server.ts # builds the McpServer and registers every tool group config.ts # env parsing pocketbase.ts # SDK client singleton, auth, withAuth() retry helper util.ts # tool result / error helpers formdata.ts # multipart body builder for file uploads tools/ health.ts collections.ts records.ts auth.ts superusers.ts files.ts logs.ts settings.ts backups.ts crons.ts raw.ts
npm run build # tsc -> dist/ npm run watch # tsc --watch npm run dev # run from TS via tsx (no build step)

The package is distributed onnpmand listed in the officialMCP Registry. Both are automated by.github/workflows/release.yml, triggered when you publish a GitHub Release.

- Create an npmAutomation(or granular, read+write) access token and add it as the repository secretNPM_TOKEN. (Later you can migrate to tokenlessTrusted Publishing / OIDCand drop the secret.)
- The MCP Registry step usesGitHub OIDC(id-token: write) — no secret needed. It publishes under theio.github.nestebe/
namespace, verified by themcpNamefield inpackage.jsonmatching thenameinserver.json.

npm version patch # or minor / major — bumps package.json + creates a git tag # keep server.json "version" in sync with package.json, then commit it git push --follow-tags gh release create v1.0.0 --generate-notes # publishing the release fires the workflow

The workflow then: builds →npm publish --provenance --access public→ publishes theserver.jsonmetadata to the registry.

npm publish --access public # npm (must include the mcpName field) # then, from the repo root: mcp-publisher login github # interactive GitHub OAuth (owner of "nestebe") mcp-publisher publish # pushes server.json to registry.modelcontextprotocol.io

Before releasing, verify the tarball and package health:

npm publish --dry-run # inspect exactly what ships npx publint # lint package.json/exports/bin for publish issues

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Create crafted UI components inspired by the best 21st.dev design engineers.

Bring agent evaluations, observability, and synthetic test set generation directly into your IDE for free with Galileo's new MCP server

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

MCP server for AI Diagram Maker — generate beautiful software engineering diagrams directly inside Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI agent

ALAPI MCP Tools,Call hundreds of API interfaces via MCP

AI-powered SVG animation generator that transforms static files into animated SVG components using the Allyson platform

MCP server that gives AI assistants on-demand access to 1,500+ amCharts docs, ~300 code examples, and 1000+ class API references.

APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.

One shared context layer for AI agents and humans — live API specs, DB schemas, and versioned contracts across repos so every agent and teammate works from the same source of truth.

Build and deploy full-stack Next.js apps with 98 tools for React, AWS, and MongoDB

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.