pocketbase-mcp-server
高度なPocketBase MCPサーバー
PocketBaseデータベースと連携するための高度なツールを提供する包括的なMCPサーバーです。このサーバーは、モデルコンテキストプロトコル(MCP)を通じて、高度なデータベース操作、スキーマ管理、データ操作を可能にします。
変更履歴
v2.1.0(2025年4月3日)
追加した
複数のレコードを一度に更新するための
batch_update_recordsツールを追加しました。複数のレコードを一度に削除するための
batch_delete_recordsツールを追加しました。リアルタイム イベント サブスクリプション用の
subscribe_to_collectionツールを追加しました (eventsourcepolyfill が必要です)。
修理済み
明示的な電子メール/パスワードなしで環境変数を介して管理者認証を許可するために、
authenticate_userのスキーマを修正しました。Node.js でリアルタイム サブスクリプションを有効にするために、
eventsource依存関係とポリフィルを追加しました。
v2.0.0(2025年4月2日)
追加した
環境変数による管理者認証サポートの強化
impersonate_userツールによる管理者の偽装のサポートを追加しました認証操作のエラー処理の改善
開発エクスペリエンスを向上させるために包括的な TypeScript 型定義を追加しました
Cline統合のサポートを追加しました
修理済み
PocketBaseクライアント実装のTypeScriptエラーを修正しました
適切な型注釈によるスキーマフィールドの処理の改善
オプションのスキーマフィールドプロパティに関する問題を修正しました
変更
複数の認証方法をサポートするために認証フローを更新しました
より詳細な例を含むドキュメントの改善
強化された環境変数設定オプション
Related MCP server: PocketBase MCP Server
特徴
コレクション管理
カスタムスキーマを使用してコレクションを作成および管理する
データ保存を伴うコレクションスキーマの移行
高度なインデックス管理(作成、削除、一覧表示)
スキーマ検証と型安全性
コレクションスキーマとメタデータを取得する
レコード操作
レコードのCRUD操作
フィルタリング、並べ替え、集計による高度なクエリ
バッチインポート/エクスポート機能
関係拡大サポート
ページネーションとカーソルベースのナビゲーション
ユーザー管理
ユーザー認証とトークン管理
ユーザーアカウントの作成と管理
パスワード管理
ロールベースのアクセス制御
セッション処理
データベース操作
データベースのバックアップと復元
複数のエクスポート形式(JSON/CSV)
データ移行ツール
インデックスの最適化
バッチ操作
利用可能なツール
コレクション管理
create_collection: カスタムスキーマで新しいコレクションを作成するget_collection_schema: コレクションのスキーマの詳細を取得するmigrate_collection: データを保持したままコレクションスキーマを移行するmanage_indexes: コレクションインデックスを作成、削除、または一覧表示する
レコード操作
create_record: コレクションに新しいレコードを作成するlist_records: オプションのフィルターとページ区切りを使用してレコードを一覧表示しますupdate_record: 既存のレコードを更新するdelete_record: レコードを削除するquery_collection: フィルタリング、並べ替え、集計機能を備えた高度なクエリbatch_update_records: 1回の呼び出しで複数のレコードを更新するbatch_delete_records: 1回の呼び出しで複数のレコードを削除するsubscribe_to_collection: コレクション内のリアルタイムの変更をサブスクライブします (Node.js 環境ではeventsourceパッケージが必要です)import_data: 作成/更新/upsertモードでコレクションにデータをインポートする
ユーザー管理
authenticate_user: ユーザーを認証し、認証トークンを取得するcreate_user: 新しいユーザーアカウントを作成するlist_auth_methods: 利用可能なすべての認証方法を一覧表示するauthenticate_with_oauth2: OAuth2でユーザーを認証するauthenticate_with_otp: ワンタイムパスワードでユーザーを認証するauth_refresh: 認証トークンを更新するrequest_verification: メール検証をリクエストするconfirm_verification: トークンを使用してメールの検証を確認するrequest_password_reset: パスワードのリセットを要求するconfirm_password_reset: トークンを使用してパスワードのリセットを確認するrequest_email_change: メールの変更をリクエストするconfirm_email_change: トークンを使用してメールの変更を確認するimpersonate_user: 別のユーザーになりすます(管理者のみ)
データベース操作
backup_database: フォーマットオプションを使用してPocketBaseデータベースのバックアップを作成します。import_data: さまざまなモード(作成/更新/upsert)でデータをインポートします
構成
サーバーには次の環境変数が必要です。
POCKETBASE_URL: PocketBaseインスタンスのURL(例:" http://127.0.0.1:8090 ")
オプションの環境変数:
POCKETBASE_ADMIN_EMAIL: 特定の操作の管理者メールアドレスPOCKETBASE_ADMIN_PASSWORD: 管理者パスワードPOCKETBASE_DATA_DIR: カスタムデータディレクトリパス
使用例
コレクション管理
// 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
}
]
});
// Manage indexes
await mcp.use_tool("pocketbase", "manage_indexes", {
collection: "posts",
action: "create",
index: {
name: "title_idx",
fields: ["title"],
unique: true
}
});高度なクエリ
// Query with filtering, sorting, and aggregation
await mcp.use_tool("pocketbase", "query_collection", {
collection: "posts",
filter: "created >= '2024-01-01'",
sort: "-created",
aggregate: {
totalLikes: "sum(likes)",
avgRating: "avg(rating)"
},
expand: "author,categories"
});データのインポート/エクスポート
// Import data with upsert mode
await mcp.use_tool("pocketbase", "import_data", {
collection: "posts",
data: [
{
title: "First Post",
content: "Hello World"
},
{
title: "Second Post",
content: "More content"
}
],
mode: "upsert"
});
// Backup database
await mcp.use_tool("pocketbase", "backup_database", {
format: "json" // or "csv"
});スキーマの移行
// Migrate collection schema
await mcp.use_tool("pocketbase", "migrate_collection", {
collection: "posts",
newSchema: [
{
name: "title",
type: "text",
required: true
},
{
name: "content",
type: "text",
required: true
},
{
name: "tags",
type: "json",
required: false
}
],
dataTransforms: {
// Optional field transformations during migration
tags: "JSON.parse(oldTags)"
}
});バッチおよびリアルタイム操作
// Batch update records
await mcp.use_tool("pocketbase", "batch_update_records", {
collection: "products",
records: [
{ id: "record_id_1", data: { price: 19.99 } },
{ id: "record_id_2", data: { status: "published" } }
]
});
// Batch delete records
await mcp.use_tool("pocketbase", "batch_delete_records", {
collection: "products",
recordIds: ["record_id_3", "record_id_4"]
});
// Subscribe to collection changes (logs events to server console)
// Note: Requires 'eventsource' package installed in the Node.js environment running the server.
await mcp.use_tool("pocketbase", "subscribe_to_collection", {
collection: "products"
});
// Subscribe to a specific record
await mcp.use_tool("pocketbase", "subscribe_to_collection", {
collection: "products",
recordId: "specific_product_id"
});認証方法
// List available authentication methods
await mcp.use_tool("pocketbase", "list_auth_methods", {
collection: "users"
});
// Authenticate with password
await mcp.use_tool("pocketbase", "authenticate_user", {
email: "user@example.com",
password: "securepassword",
collection: "users"
});
// Authenticate with OAuth2
await mcp.use_tool("pocketbase", "authenticate_with_oauth2", {
provider: "google",
code: "auth_code_from_provider",
codeVerifier: "code_verifier_from_pkce",
redirectUrl: "https://your-app.com/auth/callback",
collection: "users"
});
// Request password reset
await mcp.use_tool("pocketbase", "request_password_reset", {
email: "user@example.com",
collection: "users"
});
// Confirm password reset
await mcp.use_tool("pocketbase", "confirm_password_reset", {
token: "verification_token",
password: "new_password",
passwordConfirm: "new_password",
collection: "users"
});
// Refresh authentication token
await mcp.use_tool("pocketbase", "auth_refresh", {
collection: "users"
});エラー処理
すべてのツールには、詳細なエラーメッセージを含む包括的なエラー処理機能が搭載されています。エラーは適切に入力され、以下のエラーが含まれます。
無効なリクエストエラー
認証エラー
データベース操作エラー
スキーマ検証エラー
ネットワークエラー
型安全性
サーバーにはすべての操作に対するTypeScript定義が含まれており、ツール使用時の型安全性が確保されています。各ツールの入力スキーマは厳密に型指定され、検証されます。
ベストプラクティス
常にtry/catchブロックで適切なエラー処理を使用する
操作を実行する前にデータを検証する
クエリパフォーマンスを向上させるために適切なインデックスを使用する
データベースを定期的にバックアップする
スキーマの変更には移行を使用する
ユーザー管理に関するセキュリティのベストプラクティスに従う
データベースのパフォーマンスを監視および最適化する
発達
リポジトリをクローンする
依存関係をインストール:
npm install.env.exampleを.envにコピーして設定するビルド:
npm run buildPocketBaseインスタンスを起動する
MCPサーバーはPocketBaseインスタンスに自動的に接続します
Smithery経由でインストール
Smithery経由で Claude Desktop 用の PocketBase Server を自動的にインストールするには:
npx -y @smithery/cli install pocketbase-server --client claude貢献
リポジトリをフォークする
機能ブランチを作成する
変更をコミットする
ブランチにプッシュする
プルリクエストを作成する
Available Tools
14 toolscreate_recordD
Inputs: no named parameters.
create_stripe_customerB
Create a new customer in Stripe
Inputs: no named parameters.
create_stripe_payment_intentB
Create a Stripe payment intent for processing payments
Inputs: no named parameters.
create_stripe_productD
Inputs: no named parameters.
discover_toolsD
Inputs: no named parameters.
get_collectionD
Inputs: no named parameters.
get_recordD
Inputs: no named parameters.
health_checkD
Inputs: no named parameters.
list_collectionsD
Inputs: no named parameters.
list_recordsD
Inputs: no named parameters.
send_custom_emailD
Inputs: no named parameters.
send_templated_emailD
Inputs: no named parameters.
smithery_discoveryD
Inputs: no named parameters.
test_toolD
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
The tools have some clear distinctions, like Stripe operations vs. PocketBase CRUD vs. email functions, but there is ambiguity within groups. For example, 'send_custom_email' and 'send_templated_email' could overlap in purpose, and 'discover_tools' vs. 'smithery_discovery' might confuse agents about their specific roles. Overall, descriptions are sparse, making it harder to differentiate tools fully.
Most tools follow a consistent verb_noun pattern, such as 'create_record', 'get_collection', and 'list_records'. However, there are minor deviations like 'health_check' (snake_case but could be 'check_health' for consistency) and 'smithery_discovery' (which uses a proper noun prefix). The naming is largely predictable but not perfectly uniform.
With 14 tools, the count is reasonable for a server that combines PocketBase database operations, Stripe integrations, and email functionalities. It's slightly on the higher side but still manageable, as each tool appears to serve a distinct purpose within its domain without obvious bloat.
For PocketBase operations, there is basic CRUD coverage (create, get, list for records and collections), but missing update and delete tools creates a notable gap. The Stripe tools cover customer, payment intent, and product creation, but lack retrieval or management functions. Email tools are present but without descriptions, it's unclear if they cover all needed scenarios. Overall, the surface is functional but has incomplete lifecycle coverage.
Related MCP Connectors
MCP server for interacting with the Supabase platform
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 comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
Related MCP Servers
- 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.MIT
- AlicenseBqualityCmaintenanceProvides sophisticated tools for interacting with PocketBase databases, enabling advanced database operations, schema management, and data manipulation through the Model Context Protocol (MCP).24156MIT
- AlicenseAqualityDmaintenanceMCP server that allows interaction with PocketBase databases, enabling record operations (fetch, list, create, update), file management, and schema migrations through natural language.2243MIT
- -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-