PocketBase MCP Server
dynamic-pocketbase-mcp
PocketBase 用の動的 Model Context Protocol (MCP) サーバーです。AI クライアントを一度接続すれば、ランタイムツールを使用してあらゆる PocketBase プロジェクトのコレクションやレコードを管理できます。
このサーバーが異なる理由
多くの PocketBase MCP サーバーは静的です。つまり、コレクション固有の動作をハードコードしたり、スキーマごとにカスタムツール定義が必要になったりします。
dynamic-pocketbase-mcp は動的です:
コレクションに依存しないツール (
list_collections,list_records,create_recordなど) を使用しますサーバーコードを再生成することなく、既存および新規作成されたコレクション全体で動作します
ライブの PocketBase コレクションを MCP リソースとして公開します
Related MCP server: PocketBase MCP Server
機能
ヘルスチェック、認証、コレクション、ルール、レコードのための 18 個の MCP ツール
コレクションのライフサイクル操作 (作成、更新、削除、検査)
フィルタリング、ソート、ページネーション、フィールド選択を備えたレコード CRUD
ツールによるセッションベースの認証 (
auth_admin,auth_user,get_auth_status,logout)フィールドスキーマおよびルール構文のための組み込みリファレンス
インストール
npm install dynamic-pocketbase-mcp
# or
bun install dynamic-pocketbase-mcpAI クライアントでの設定
Claude Desktop
Claude Desktop の設定 (~/Library/Application Support/Claude/claude_desktop_config.json (macOS の場合)) に追加します:
{
"mcpServers": {
"dynamic-pocketbase": {
"command": "npx",
"args": ["-y", "dynamic-pocketbase-mcp"]
}
}
}POCKETBASE_URL が設定されていない場合、サーバーはデフォルトで http://localhost:8090 を使用します。
直接使用する方法
# Use default URL (http://localhost:8090)
npx -y dynamic-pocketbase-mcp
# Use custom PocketBase URL
POCKETBASE_URL=https://pb.example.com \
bunx dynamic-pocketbase-mcp簡単なチュートリアル: この MCP を使用して AI とチャットする
MCP クライアントを設定した後、チャットを開いて以下のようなプロンプトを試してください:
"PocketBase の URL を
https://pb.example.comに設定して。""PocketBase サーバーのヘルス状態を確認して。"
"すべての PocketBase コレクションをリストアップして。"
"メールアドレス
<your-email>とパスワード<your-password>で管理者として認証して。""
notesという名前のコレクションを作成して。必須のtitleテキストフィールドを含めて。""
notesにFirst noteというタイトルのレコードを作成して。""
notesの全レコードを新しい順に表示して。""PocketBase の認証セッションからログアウトして。"
これらの手順が成功すれば、AI はこの MCP サーバーを通じてスキーマとデータを管理できるようになります。
認証フロー (ツール経由)
auth_adminまたはauth_userget_auth_statuslogout
利用可能なツール
ヘルスチェックとリファレンス
health- PocketBase サーバーのヘルス状態を確認するset_base_url- 現在の MCP セッションの PocketBase URL を更新し、認証トークンをクリアするget_field_schema_reference- フィールド型のドキュメントを取得するget_rules_reference- API ルールの構文リファレンスを取得する
認証
auth_admin- 管理者/スーパーユーザーとして認証するauth_user- 認証コレクションのユーザーとして認証する (メールアドレス/ユーザー名)get_auth_status- 現在の認証状態を確認するlogout- 認証セッションをクリアする
コレクション
list_collections- すべてのコレクションをリストアップするview_collection- 名前または ID でコレクションを表示するcreate_collection- 新しいコレクションを作成する (指定がない限り、ベース/認証コレクション用にcreatedおよびupdatedの自動日付フィールドが自動追加されます)update_collection- コレクションのスキーマ/設定を更新するdelete_collection- コレクションを削除するupdate_collection_rules- アクセス制御ルールを更新する
レコード
list_records- フィルタリング、ソート、ページネーションを使用してレコードをリスト/検索するview_record- ID で単一のレコードを表示するcreate_record- 新しいレコードを作成するupdate_record- 既存のレコードを更新するdelete_record- レコードを削除する
開発
# Install dependencies
bun install
# Run in development mode
bun run dev
# Type check
bun run typecheck
# Run tests (builds dist first)
bun run test
# Run all checks (typecheck + tests)
bun run check
# Interactive release helper (bump, check, publish, push tag)
bun run release
# Build for production
bun run build環境変数
変数 | 必須 | 説明 |
| いいえ | PocketBase サーバーの URL (デフォルト: |
ライセンス
MIT
Available Tools
22 toolsanalyze_collection_dataC
Analyze data patterns and provide insights about a collection
Inputs: collection (required), options.
authenticate_userC
Authenticate a user and get auth token
Inputs: email (required), password (required), autoRefreshThreshold, collection.
backup_databaseC
Create a backup of the PocketBase database
Inputs: format.
create_collectionC
Create a new collection in PocketBase
Inputs: fields (required), name (required), createRule, deleteRule, +7 more.
create_recordC
Create a new record in a collection
Inputs: collection (required), data (required), expand, fields.
create_userC
Create a new user account
Inputs: email (required), password (required), passwordConfirm (required), additionalData, +3 more.
delete_collectionB
Delete a collection from PocketBase
Inputs: collection (required).
delete_recordC
Delete a record
Inputs: collection (required), id (required).
download_fileC
Download a file from a record in PocketBase
Inputs: collection (required), fileField (required), recordId (required).
generate_pb_schemaB
Generate a PocketBase schema based on TypeScript interfaces or database diagram
Inputs: sourceCode (required), options.
generate_typescript_interfacesB
Generate TypeScript interfaces from PocketBase collections
Inputs: collections, options.
get_collection_schemaC
Get schema details for a collection
Inputs: collection (required).
import_dataC
Import data into a collection
Inputs: collection (required), data (required), mode.
list_collectionsC
List all collections with optional sorting
Inputs: sort.
list_recordsC
List records from a collection with optional filters
Inputs: collection (required), expand, fields, filter, +4 more.
manage_indexesC
Manage collection indexes
Inputs: action (required), collection (required), index.
migrate_collectionC
Add, remove, or modify fields from a collection
Inputs: collection (required), fields (required), createRule, dataTransforms, +5 more.
query_collectionC
Advanced query with filtering, sorting, and aggregation
Inputs: collection (required), aggregate, expand, filter, +1 more.
truncate_collectionB
Delete all records associated with the specified collection
Inputs: collection (required).
update_recordC
Update an existing record
Inputs: collection (required), data (required), id (required), expand, +1 more.
upload_fileB
Upload a file to a record in PocketBase
Inputs: collection (required), fileContent (required), fileField (required), fileName (required), +1 more.
upload_file_from_urlC
Upload a file from URL to a record in PocketBase
Inputs: collection (required), fileField (required), recordId (required), url (required), +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Most tools have distinct purposes targeting specific resources and actions, but some potential confusion exists: 'list_records' and 'query_collection' both retrieve records, though 'query_collection' offers advanced features; 'upload_file' and 'upload_file_from_url' are closely related but differentiated by source. Overall, descriptions help clarify boundaries, but minor overlaps could cause occasional misselection.
Tool names follow a highly consistent verb_noun pattern throughout, such as 'create_collection', 'delete_record', and 'list_records'. All tools use snake_case with clear, descriptive verbs aligned with their actions, making the set predictable and easy to navigate without any deviations in style.
With 22 tools, the count is slightly high for a typical MCP server scope, but it is reasonable given the comprehensive coverage of PocketBase operations. It includes CRUD, schema management, data handling, and utilities, which justifies the number, though it might feel heavy compared to more focused servers.
The tool set provides complete coverage for PocketBase operations, including full CRUD for collections and records, user authentication, schema management, data import/export, file handling, and utilities like backup and analysis. There are no obvious gaps, ensuring agents can handle all core workflows without dead ends.
Maintenance
Related MCP Connectors
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
MCP server for interacting with the Supabase platform
Agent-native backend: Postgres, auth, storage, functions, hosting and deploy, over MCP
Query, join, profile, clean and convert CSV/JSON/Parquet with server-side DuckDB over MCP.
Related MCP Servers
- AlicenseDqualityNot gradedmaintenanceA comprehensive MCP server 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).14164 npm70MIT
- AlicenseAqualityCmaintenanceMCP server that allows interaction with PocketBase databases, enabling record operations (fetch, list, create, update), file management, and schema migrations through natural language.2243MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants and MCP clients to interact with PocketBase databases for authentication, data management, and administrative operations.65MIT
- AlicenseNot gradedqualityAmaintenanceEnables creating and managing collections, performing record CRUD operations with pagination and expansions, handling user authentication, and backing up PocketBase databases through MCP tools.18 npmISC