Skip to content
Back to search

pocketbase-mcp

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

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/mrwyndham--pocketbase-mcp/badge.svg)](/listings/mrwyndham--pocketbase-mcp)

HTML

<a href="/listings/mrwyndham--pocketbase-mcp"><img src="/api/listings/mrwyndham--pocketbase-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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.

```json { "mcpServers": { "pocketbase-server": { "command": "node", "args": ["build/index.js"], "env": { "POCKETBASE_URL": "http://127.0.0.1:8090", "POCKETBASE_ADMIN_EMAIL": "admin@example.com", "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.

- Setup in vscode is similar , find or create `.vscode/mcp.json` and add

{
  "inputs": [
    {
      "type": "promptString",
      "id": "pocketbase-admin-email",
      "description": "PocketBase Admin Email",
      "password": false
    },
    {
      "type": "promptString",
      "id": "pocketbase-admin-password",
      "description": "PocketBase Admin Password",
      "password": true
    }
  ],
  "servers": {
    "pocketbaseServer": {
      "type": "stdio",
      "command": "node",
      // replace this with the path to your compiled MCP server (git clone the repo and run `npm run build` to compile)
      "args": ["~/Desktop/code/mcp/pocketbase-mcp/build/index.js"],
      "env": {
        "POCKETBASE_URL": "http://127.0.0.1:8090",
        "POCKETBASE_ADMIN_EMAIL": "${input:pocketbase-admin-email}",
        "POCKETBASE_ADMIN_PASSWORD": "${input:pocketbase-admin-password}"
      }
    }
  }
}

1. **Start the server:** After configuring the `cline_mcp_settings.json` file, you can start using the MCP server with the configured tools.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 312 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # PocketBase MCP Server
  2. 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).
  3. Here is a video of me using it: https://www.youtube.com/watch?v=ZuTIO3I7rTM&t=345s
  4. ## Why This And Not DynamicsEndpoints?
  5. 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.
  6. ## Setup MCP Server Locally (Only Way Supported for Now)
  7. 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:
  8. 1. **Locate your `cline_mcp_settings.json` file:** This file is usually located in your Cursor user settings directory. For example:
  9. `/Users/yourusername/Library/Application Support/Cursor/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`
  10. 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.
  11. ```json
  12. {
  13. "mcpServers": {
  14. "pocketbase-server": {
  15. "command": "node",
  16. "args": ["build/index.js"],
  17. "env": {
  18. "POCKETBASE_URL": "http://127.0.0.1:8090",
  19. "POCKETBASE_ADMIN_EMAIL": "admin@example.com",
  20. "POCKETBASE_ADMIN_PASSWORD": "admin_password"
  21. },
  22. "disabled": false,
  23. "autoApprove": ["create_record", "create_collection"]
  24. }
  25. }
  26. }
  27. ```
  28. - **`command`**: The command to start the server (usually `node`).
  29. - **`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.
  30. - **`env`**: An object containing environment variables.
  31. - **`POCKETBASE_URL`**: The URL of your PocketBase instance. This is _required_.
  32. - **`POCKETBASE_ADMIN_EMAIL`**: The admin email for your PocketBase instance (optional, but needed for some operations).
  33. - **`POCKETBASE_ADMIN_PASSWORD`**: The admin password for your PocketBase instance (optional, but needed for some operations).
  34. - **`disabled`**: Whether to disable to server on startup.
  35. - **`autoApprove`**: list of tools to auto approve.
  36. - Adjust the values in the `env` object to match your PocketBase instance's settings.
  37. - Setup in vscode is similar , find or create `.vscode/mcp.json` and add
  38. ```json
  39. {
  40. "inputs": [
  41. {
  42. "type": "promptString",
  43. "id": "pocketbase-admin-email",
  44. "description": "PocketBase Admin Email",
  45. "password": false
  46. },
  47. {
  48. "type": "promptString",
  49. "id": "pocketbase-admin-password",
  50. "description": "PocketBase Admin Password",
  51. "password": true
  52. }
  53. ],
  54. "servers": {
  55. "pocketbaseServer": {
  56. "type": "stdio",
  57. "command": "node",
  58. // replace this with the path to your compiled MCP server (git clone the repo and run `npm run build` to compile)
  59. "args": ["~/Desktop/code/mcp/pocketbase-mcp/build/index.js"],
  60. "env": {
  61. "POCKETBASE_URL": "http://127.0.0.1:8090",
  62. "POCKETBASE_ADMIN_EMAIL": "${input:pocketbase-admin-email}",
  63. "POCKETBASE_ADMIN_PASSWORD": "${input:pocketbase-admin-password}"
  64. }
  65. }
  66. }
  67. }
  68. ```
  69. 1. **Start the server:** After configuring the `cline_mcp_settings.json` file, you can start using the MCP server with the configured tools.
  70. ## Setup MCP Server with Docker
  71. You can run the PocketBase MCP server using Docker. A `Dockerfile` is included in the repository.
  72. ### Building the Docker Image
  73. ```bash
  74. # Build the Docker image
  75. docker build -t pocketbase-mcp .
  76. ```
  77. ### Running the Docker Container
  78. ```bash
  79. # Run the container with environment variables
  80. docker run -d \
  81. --name pocketbase-mcp \
  82. -e POCKETBASE_URL=http://127.0.0.1:8090 \
  83. -e POCKETBASE_ADMIN_EMAIL=your_admin@example.com \
  84. -e POCKETBASE_ADMIN_PASSWORD=your_admin_password \
  85. pocketbase-mcp
  86. ```
  87. ### Docker MCP Configuration
  88. To use the Dockerized MCP server with your AI assistant (Cursor, Claude, etc.), configure it in your MCP settings:
  89. **For Cline/Cursor (`cline_mcp_settings.json`):**
  90. ```json
  91. {
  92. "mcpServers": {
  93. "pocketbase-docker": {
  94. "command": "docker",
  95. "args": [
  96. "run",
  97. "-i",
  98. "--rm",
  99. "-e",
  100. "POCKETBASE_URL=http://host.docker.internal:8090",
  101. "-e",
  102. "POCKETBASE_ADMIN_EMAIL=your_admin@example.com",
  103. "-e",
  104. "POCKETBASE_ADMIN_PASSWORD=your_admin_password",
  105. "pocketbase-mcp"
  106. ],
  107. "disabled": false,
  108. "autoApprove": ["list_collections", "list_records", "get_collection"]
  109. }
  110. }
  111. }
  112. ```
  113. **For VS Code (`.vscode/mcp.json`):**
  114. ```json
  115. {
  116. "inputs": [
  117. {
  118. "type": "promptString",
  119. "id": "pocketbase-admin-email",
  120. "description": "PocketBase Admin Email",
  121. "password": false
  122. },
  123. {
  124. "type": "promptString",
  125. "id": "pocketbase-admin-password",
  126. "description": "PocketBase Admin Password",
  127. "password": true
  128. }
  129. ],
  130. "servers": {
  131. "pocketbaseDocker": {
  132. "type": "stdio",
  133. "command": "docker",
  134. "args": [
  135. "run",
  136. "-i",
  137. "--rm",
  138. "-e",
  139. "POCKETBASE_URL=http://host.docker.internal:8090",
  140. "-e",
  141. "POCKETBASE_ADMIN_EMAIL=${input:pocketbase-admin-email}",
  142. "-e",
  143. "POCKETBASE_ADMIN_PASSWORD=${input:pocketbase-admin-password}",
  144. "pocketbase-mcp"
  145. ]
  146. }
  147. }
  148. }
  149. ```
  150. ### Docker Configuration Notes
  151. - **`-i`**: Interactive mode (required for stdio communication)
  152. - **`--rm`**: Automatically remove container when it exits
  153. - **`host.docker.internal`**: Use this to access PocketBase running on your host machine from within Docker
  154. - **Environment Variables**: Replace placeholder values with your actual PocketBase credentials
  155. - **Network**: If your PocketBase is also running in Docker, use Docker networking (e.g., `--network host` or custom bridge network)
  156. ### Docker Compose (Optional)
  157. Create a `docker-compose.yml` for easier management:
  158. ```yaml
  159. version: "3.8"
  160. services:
  161. pocketbase-mcp:
  162. build: .
  163. environment:
  164. - POCKETBASE_URL=http://host.docker.internal:8090
  165. - POCKETBASE_ADMIN_EMAIL=your_admin@example.com
  166. - POCKETBASE_ADMIN_PASSWORD=your_admin_password
  167. stdin_open: true
  168. tty: true
  169. ```
  170. Then configure your MCP settings to use:
  171. ```json
  172. {
  173. "mcpServers": {
  174. "pocketbase-docker": {
  175. "command": "docker-compose",
  176. "args": ["run", "--rm", "pocketbase-mcp"],
  177. "disabled": false
  178. }
  179. }
  180. }
  181. ```
  182. ## Features
  183. ### Collection Management
  184. - Create and manage collections with custom schemas
  185. - Retrieve collection schemas and metadata
  186. ### Record Operations
  187. - CRUD operations for records
  188. - Relationship expansion support
  189. - Pagination and cursor-based navigation
  190. ### User Management
  191. - User authentication and token management
  192. - User account creation and management
  193. - Password management
  194. ### Database Operations
  195. - Database backup
  196. ## Available Tools
  197. ### Collection Management
  198. - `create_collection`: Create a new collection with custom schema
  199. - `get_collection`: Get schema details for a collection
  200. ### Record Operations
  201. - `create_record`: Create a new record in a collection
  202. - `list_records`: List records with optional filters and pagination
  203. - `update_record`: Update an existing record
  204. - `delete_record`: Delete a record
  205. ### User Management
  206. - `authenticate_user`: Authenticate a user and get auth token
  207. - `create_user`: Create a new user account
  208. ### Database Operations
  209. - `backup_database`: Create a backup of the PocketBase database with format options
  210. ## Configuration
  211. The server requires the following environment variables:
  212. - `POCKETBASE_URL`: URL of your PocketBase instance (e.g., "http://127.0.0.1:8090")
  213. Optional environment variables:
  214. - `POCKETBASE_ADMIN_EMAIL`: Admin email for certain operations
  215. - `POCKETBASE_ADMIN_PASSWORD`: Admin password
  216. - `POCKETBASE_DATA_DIR`: Custom data directory path
  217. ## Usage Examples
  218. ```typescript
  219. // Create a new collection
  220. await mcp.use_tool("pocketbase", "create_collection", {
  221. name: "posts",
  222. schema: [
  223. {
  224. name: "title",
  225. type: "text",
  226. required: true,
  227. },
  228. {
  229. name: "content",
  230. type: "text",
  231. required: true,
  232. },
  233. ],
  234. });
  235. // Authenticate with password
  236. await mcp.use_tool("pocketbase", "authenticate_user", {
  237. email: "user@example.com",
  238. password: "securepassword",
  239. collection: "users",
  240. });
  241. ```
  242. ## Contributing
  243. 1. Fork the repository
  244. 2. Create a feature branch
  245. 3. Commit your changes
  246. 4. Push to the branch
  247. 5. Create a Pull Request
  248. ## Sponsors
  249. - [Biz365](https://www.biz365.com.au/)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.