pocketbase-mcp
Provides tools for interacting with PocketBase's API, enabling AI assistants to perform CRUD operations on records, manage collections, handle authentication, work with files, and administer database settings through a clean interface.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pocketbase-mcp list all users in the customers collection"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
pocketbase-mcp
A Model Context Protocol (MCP) server for PocketBase — giving AI assistants like Claude full access to your PocketBase backend through a clean, Pythonic interface.
Overview
pocketbase-mcp bridges the gap between LLMs and your PocketBase instance. Once connected, AI assistants can list collections, perform CRUD operations on records, manage authentication, handle file uploads, and administer your database — all through natural language.
Built with FastMCP (the standard Python MCP framework) and httpx for async HTTP communication with the PocketBase REST API.
Related MCP server: PocketBase MCP Server
Features
Records — list, get, create, update, delete, and batch-operate on records in any collection
Collections — list, inspect, create, update, and delete collection schemas
Authentication — authenticate as a superuser or regular user via email/password or API key
Files — generate file tokens and retrieve file URLs with optional image transformations
Settings — read and update application settings
Filtering & Pagination — pass PocketBase filter expressions, sort, expand, and pagination params directly
Realtime-aware — designed with SSE subscription patterns in mind for future extension
Requirements
Python 3.11+
A running PocketBase instance (local or remote)
uv(recommended) orpip
Installation
Using pip
pip install pocketbase-mcpConfiguration
The server is configured via environment variables:
Variable | Required | Default | Description |
| Yes | — | Base URL of your PocketBase instance (e.g. |
| No | — | Superuser email for admin operations |
| No | — | Superuser password |
| No | — | Long-lived API key (alternative to email/password) |
Set them in a .env file or export directly:
export POCKETBASE_URL=http://127.0.0.1:8090
export POCKETBASE_SUPERUSER_EMAIL=admin@example.com
export POCKETBASE_SUPERUSER_PASSWORD=your-passwordRunning the Server
stdio transport (default — for Claude Desktop, Claude Code, etc.)
pocketmcpWith MCP Inspector (for development and testing)
# Terminal 1
pocketmcp
# Terminal 2
npx @modelcontextprotocol/inspectorConnecting to Claude
Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"pocketbase": {
"command": "pocketmcp",
"args": ["server"],
"env": {
"POCKETBASE_URL": "http://127.0.0.1:8090",
"POCKETBASE_SUPERUSER_EMAIL": "admin@admin.com",
"POCKETBASE_SUPERUSER_PASSWORD": "adminadmin"
}
}
}
}Available Tools
Records
Tool | Description |
| List records in a collection with filtering, sorting, and pagination |
| Get a single record by ID |
| Create a new record |
| Update an existing record |
| Delete a record by ID |
| Perform multiple create/update/upsert/delete operations in one request |
Collections
Tool | Description |
| List all collections |
| Get a collection schema by name or ID |
| Create a new collection with fields and API rules |
| Update a collection's schema or rules |
| Delete a collection |
Authentication
Tool | Description |
| Authenticate a user or superuser with email and password |
| Return the current authentication state |
Files
Tool | Description |
| Generate the URL for a file attached to a record |
| Create a short-lived token for accessing protected files |
Settings
Tool | Description |
| Retrieve all application settings |
| Update application settings |
Project Structure
pocketbase-mcp/
├── server.py # MCP server entry point (FastMCP)
├── tools/
│ ├── records.py # Record CRUD tools
│ ├── collections.py # Collection management tools
│ ├── auth.py # Authentication tools
│ ├── files.py # File tools
│ └── settings.py # Settings tools
├── client.py # Async PocketBase HTTP client (httpx)
├── config.py # Environment variable loading
├── pyproject.toml
└── README.mdExample Usage
Once connected to Claude, you can interact with your PocketBase instance through natural language:
"List all records in the
postscollection wherestatus = 'published', sorted bycreateddescending."
"Create a new record in
userswith name 'Alice' and role 'editor'."
"Show me the schema for the
productscollection."
"Delete the record with ID
ae40239d2bc4477fromcomments."
"Update the app name in PocketBase settings to 'My App'."
PocketBase Compatibility
This MCP server targets PocketBase v0.36.9+. The batch API requires it to be explicitly enabled in your PocketBase Dashboard under Settings → Application.
Security Notes
Never commit credentials to version control. Use environment variables or a
.envfile (add.envto.gitignore).For production deployments, prefer API key authentication over email/password.
Collection API rules in PocketBase govern what the authenticated user can actually access —
pocketbase-mcprespects these rules.
Contributing
Contributions are welcome! Please open an issue before submitting a pull request for significant changes.
Fork the repository
Create a feature branch (
git checkout -b feat/my-feature)Commit your changes
Open a pull request
License
MIT License. See LICENSE for details.
Available Tools
13 toolsauth_with_passwordB
Authenticate a user or superuser with email and password.
Inputs: email (required), password (required), collection. Returns: token, record
batch_recordsC
Perform multiple create/update/upsert/delete operations in one request.
Inputs: requests (required). Returns: results
create_collectionC
Create a new collection with fields and API rules.
Inputs: name (required), type, fields, indexes, +5 more. Returns: id, name, type, fields, +7 more
create_recordC
Create a new record in a collection.
Inputs: body (required), collection (required), expand, fields. Returns: Record object. Additional properties depend on the collection schema.
delete_collectionC
Delete a collection by name or ID.
Inputs: collection_id_or_name (required). Returns: object
delete_recordB
Delete a record by ID.
Inputs: record_id (required), collection (required). Returns: object
get_auth_storeB
Return the current authentication state.
Returns: A dict with the active token and all stored sessions.
Inputs: no named parameters. Returns: object
get_collectionC
Get a collection schema by name or ID.
Inputs: collection_id_or_name (required). Returns: id, name, type, fields, +7 more
get_recordC
Get a single record by ID.
Inputs: record_id (required), collection (required), expand, fields. Returns: Record object. Additional properties depend on the collection schema.
list_collectionsC
List all collections with optional filtering, sorting, and pagination.
Inputs: page, sort, filter, per_page. Returns: page, items, perPage, totalItems, +1 more
list_recordsB
List records in a collection with filtering, sorting, and pagination.
Inputs: collection (required), page, sort, expand, +4 more. Returns: page, items, perPage, totalItems, +1 more
update_collectionC
Update a collection's schema or rules.
Inputs: collection_id_or_name (required), name, fields, indexes, +5 more. Returns: id, name, type, fields, +7 more
update_recordC
Update an existing record.
Inputs: body (required), record_id (required), collection (required), expand, +1 more. Returns: Record object. Additional properties depend on the collection schema.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Each tool has a clearly distinct resource and action: collections, records, batch operations, and authentication are cleanly separated. The only overlap is batch_records versus individual record operations, but their boundaries are obvious.
Nearly all tools use snake_case verb_noun naming such as list_collections, create_record, and delete_collection. auth_with_password is a minor deviation, but it remains readable and consistent with the overall verb-led style.
The set has 13 tools, which is well within the appropriate range for a PocketBase CRUD and auth server. Every tool appears to earn its place without excessive surface area.
Core CRUD coverage is strong for both collections and records, including batch operations and authentication. Minor gaps exist around auth lifecycle operations such as logout or token refresh, but the main workflows are covered.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
A Model Context Protocol server for Wix AI tools
API-first CRM for LLMs - contacts, companies, deals and activities over a native MCP server.
Related MCP Servers
- AlicenseDqualityNot gradedmaintenanceA 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).14164 npm70MIT
- AlicenseNot gradedqualityDmaintenanceA comprehensive server that enables advanced database operations with PocketBase, providing tools for collection management, record operations, user management, and database administration through the Model Context Protocol.164 npmMIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables Claude AI to interact with PocketBase databases by listing and accessing collections through natural language.7 npm1MIT
- -licenseBqualityNot gradedmaintenanceA comprehensive Model Context Protocol server for PocketBase that provides both user and administrative functionality, enabling authentication, collection/record management, file operations, and system administration through a standardized interface.387 npm-