PocketBase MCP Server
dynamic-pocketbase-mcp
用于 PocketBase 的动态模型上下文协议 (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-mcp在 AI 客户端中配置
Claude Desktop
添加到您的 Claude Desktop 配置中(macOS 上为 ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"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 客户端后,打开聊天窗口并尝试以下提示:
"Set PocketBase URL to
https://pb.example.com.""Check my PocketBase server health."
"List all PocketBase collections."
"Authenticate as admin with email
<your-email>and password<your-password>.""Create a collection named
noteswith a requiredtitletext field.""Create a record in
noteswith titleFirst note.""Show all records in
notes, newest first.""Log out from PocketBase auth session."
如果这些步骤成功,您的 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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
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/fadlee/pocketbase-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server