pocketbase-mcp
Enables AI assistants to perform CRUD operations on Pocketbase collections, manage authentication, and query logs via a type-safe API.
README
Pocketbase MCP Server
MCP (Model Context Protocol) server for Pocketbase - enables AI assistants to interact with Pocketbase backend through a clean, type-safe API.
Features
- š Silent Authentication - Automatic authentication with retry logic
- š¦ Full CRUD Operations - Complete record management
- š Advanced Querying - Filtering, sorting, pagination, field selection
- š Collections Management - List and inspect collections
- š Logs Access - Query system logs with filters
- š”ļø Type Safety - Full TypeScript support with Zod validation
- šļø Clean Architecture - Layered design for easy maintenance
Installation
# Install dependencies
pnpm install
# Build the project
pnpm build
Configuration
Environment Variables
Create a .env file in the project root:
POCKETBASE_URL=https://your-pocketbase-instance.com
POCKETBASE_IDENTITY=your-email@example.com
POCKETBASE_PASSWORD=your-password
MCP Client Configuration
Add to your MCP client config (e.g., Claude Desktop):
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"pocketbase": {
"command": "node",
"args": ["path/to/pocketbase-mcp/dist/index.js"],
"env": {
"POCKETBASE_URL": "https://your-pocketbase-instance.com",
"POCKETBASE_IDENTITY": "your-email@example.com",
"POCKETBASE_PASSWORD": "your-password"
}
}
}
}
Available Tools
1. pocketbase_auth (Optional)
Authenticate with Pocketbase. Note: Authentication is handled automatically for other tools.
pocketbase_auth({
pocketbaseUrl?: string,
identity?: string,
password?: string
})
2. pocketbase_list_collections
List all collections from Pocketbase.
pocketbase_list_collections({
page?: number, // default: 1
perPage?: number, // default: 500
skipTotal?: number // default: 1
})
3. pocketbase_list_records
List records from a collection with filtering and pagination.
pocketbase_list_records({
collection: string, // required
page?: number,
perPage?: number, // default: 30, max: 500
sort?: string, // e.g., "-created,name"
filter?: string, // e.g., 'status="active"'
expand?: string, // e.g., "user,category"
fields?: string, // e.g., "id,name,email"
skipTotal?: number
})
4. pocketbase_get_record
Get a single record by ID.
pocketbase_get_record({
collection: string, // required
id: string, // required
expand?: string,
fields?: string
})
5. pocketbase_create_record
Create a new record in a collection.
pocketbase_create_record({
collection: string, // required
data: object, // required - record data
expand?: string,
fields?: string
})
6. pocketbase_update_record
Update an existing record.
pocketbase_update_record({
collection: string, // required
id: string, // required
data: object, // required - fields to update
expand?: string,
fields?: string
})
7. pocketbase_delete_record
Delete a record from a collection.
pocketbase_delete_record({
collection: string, // required
id: string // required
})
8. pocketbase_list_logs
Query system logs with filtering and pagination.
pocketbase_list_logs({
page?: number,
perPage?: number, // default: 50, max: 500
sort?: string,
filter?: string, // e.g., '(message ~ "error")'
skipTotal?: number // default: 1
})
Architecture
The project follows a clean, layered architecture:
src/
āāā index.ts # MCP server entry point
āāā config/ # Environment configuration
āāā types/ # TypeScript type definitions
āāā schemas/ # Zod validation schemas
āāā utils/ # Error handling & response formatting
āāā client/ # HTTP client & authentication manager
āāā repositories/ # Data access layer
āāā services/ # Business logic layer
āāā handlers/ # MCP request handlers
āāā tools/ # Tool definitions registry
Design Patterns
- Repository Pattern: Separates data access from business logic
- Service Pattern: Encapsulates business logic
- Singleton Pattern: For HTTP client and auth manager
- Template Method: Base classes for common functionality
- Dependency Injection: Services injected into handlers
Development
# Run in development mode
pnpm dev
# Build for production
pnpm build
# Start production server
pnpm start
License
ISC
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.