The PocketBase MCP Server is a TypeScript-based implementation of the Model Context Protocol (MCP) that integrates with PocketBase databases. It provides tools for listing and interacting with PocketBase collections, allowing AI assistants like Claude to access your database information.
npm install
npm run build
To use this MCP server with Claude Desktop, you need to add the server configuration to Claude's config file:
On MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
On Windows:
%APPDATA%/Claude/claude_desktop_config.json
Add the following configuration to the JSON file:
{
"mcpServers": {
"pocketbase-mcp-server": {
"command": "/path/to/pocketbase-mcp-server/build/index.js --pb-url=http://localhost:8090 [email protected] --pb-admin-password=your-secure-password"
}
}
}
To connect to your PocketBase instance, you must provide these configuration parameters either as command-line arguments or environment variables:
Parameter | Command Line | Environment Variable | Description |
---|---|---|---|
PocketBase URL | --pb-url=<url> |
PB_URL |
URL of your PocketBase instance |
Admin Email | --pb-admin-email=<email> |
PB_ADMIN_EMAIL |
Admin email for authentication |
Admin Password | --pb-admin-password=<password> |
PB_ADMIN_PASSWORD |
Admin password for authentication |
If you prefer using environment variables:
export PB_URL=http://localhost:8090
export [email protected]
export PB_ADMIN_PASSWORD=your-secure-password
Alternatively, provide the parameters directly:
node build/index.js --pb-url=http://localhost:8090 [email protected] --pb-admin-password=your-secure-password
Currently, the server provides the following tools:
Since MCP servers communicate over standard input/output, debugging can be challenging. Use the MCP Inspector to help with debugging:
npm run inspector
This will provide a URL to access debugging tools in your browser, allowing you to monitor communication between Claude and your MCP server.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.