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).
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.
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:
-
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
-
Configure the server: Add a new entry to the
mcpServers
object in yourcline_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 (usuallynode
).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.
-
Start the server: After configuring the
cline_mcp_settings.json
file, you can start using the MCP server with the configured tools.
- Create and manage collections with custom schemas
- Retrieve collection schemas and metadata
- CRUD operations for records
- Relationship expansion support
- Pagination and cursor-based navigation
- User authentication and token management
- User account creation and management
- Password management
- Database backup
create_collection
: Create a new collection with custom schemaget_collection
: Get schema details for a collection
create_record
: Create a new record in a collectionlist_records
: List records with optional filters and paginationupdate_record
: Update an existing recorddelete_record
: Delete a record
authenticate_user
: Authenticate a user and get auth tokencreate_user
: Create a new user account
backup_database
: Create a backup of the PocketBase database with format options
The server requires the following environment variables:
POCKETBASE_URL
: URL of your PocketBase instance (e.g., "http://127.0.0.1:8090")
Optional environment variables:
POCKETBASE_ADMIN_EMAIL
: Admin email for certain operationsPOCKETBASE_ADMIN_PASSWORD
: Admin passwordPOCKETBASE_DATA_DIR
: Custom data directory path
// 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"
});
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request