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貢献
リポジトリをフォークする
機能ブランチを作成する
変更をコミットする
ブランチにプッシュする
プルリクエストを作成する
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceA 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.65MIT
- AlicenseBqualityCmaintenanceProvides sophisticated tools for interacting with PocketBase databases, enabling advanced database operations, schema management, and data manipulation through the Model Context Protocol (MCP).2465148MIT
- AlicenseAqualityCmaintenanceMCP server that allows interaction with PocketBase databases, enabling record operations (fetch, list, create, update), file management, and schema migrations through natural language.222539MIT
- -licenseBquality-maintenanceA 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.3810
Related MCP Connectors
MCP (Model Context Protocol) server for Appwrite
MCP server for interacting with the Supabase platform
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/DynamicEndpoints/pocketbase-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server