Skip to main content
Glama
mrwyndham

PocketBase MCP Server

create_user

Generate new user accounts with specified email, password, name, and optional collection in PocketBase MCP Server. Simplify user management and database integration using structured input data.

Instructions

Create a new user account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionNoCollection name (default: users)users
emailYesUser email
nameNoUser name
passwordYesUser password
passwordConfirmYesPassword confirmation

Implementation Reference

  • The handler function that executes the create_user tool by creating a new user record in the specified PocketBase collection using the PocketBase SDK.
    private async createUser(args: any) { try { const collection = args.collection || 'users'; const result = await this.pb.collection(collection).create({ email: args.email, password: args.password, passwordConfirm: args.passwordConfirm, name: args.name, }); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (error: unknown) { throw new McpError( ErrorCode.InternalError, `Failed to create user: ${pocketbaseErrorMessage(error)}` ); } }
  • Input schema defining the parameters for the create_user tool: required email, password, passwordConfirm; optional name and collection.
    inputSchema: { type: 'object', properties: { email: { type: 'string', description: 'User email', }, password: { type: 'string', description: 'User password', }, passwordConfirm: { type: 'string', description: 'Password confirmation', }, name: { type: 'string', description: 'User name', }, collection: { type: 'string', description: 'Collection name (default: users)', default: 'users' } }, required: ['email', 'password', 'passwordConfirm'], },
  • src/index.ts:547-576 (registration)
    Tool registration in the MCP server's list of tools, including name, description, and input schema.
    name: 'create_user', description: 'Create a new user account', inputSchema: { type: 'object', properties: { email: { type: 'string', description: 'User email', }, password: { type: 'string', description: 'User password', }, passwordConfirm: { type: 'string', description: 'Password confirmation', }, name: { type: 'string', description: 'User name', }, collection: { type: 'string', description: 'Collection name (default: users)', default: 'users' } }, required: ['email', 'password', 'passwordConfirm'], }, },
  • src/index.ts:685-686 (registration)
    Dispatcher case in the CallToolRequestHandler that routes 'create_user' calls to the createUser method.
    case 'create_user': return await this.createUser(request.params.arguments);

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/mrwyndham/pocketbase-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server