create-users
Add one or multiple users to your MCP- N8N instance by specifying email and role. Simplify user management with structured input for client ID and user details.
Instructions
Create one or more users in your instance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientId | Yes | ||
| users | Yes |
Implementation Reference
- src/index.ts:1291-1327 (handler)Executes the create-users tool by retrieving the N8nClient instance using clientId and calling its createUsers method with the users array.
case "create-users": { const { clientId, users } = args as { clientId: string; users: Array<{ email: string; role?: 'global:admin' | 'global:member' }> }; const client = clients.get(clientId); if (!client) { return { content: [{ type: "text", text: "Client not initialized. Please run init-n8n first.", }], isError: true }; } try { const result = await client.createUsers(users); return { content: [{ type: "text", text: JSON.stringify(result, null, 2), }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; } } - src/index.ts:569-589 (schema)Input schema definition for the create-users tool, specifying clientId and users array with email (required) and optional role.
inputSchema: { type: "object", properties: { clientId: { type: "string" }, users: { type: "array", items: { type: "object", properties: { email: { type: "string" }, role: { type: "string", enum: ["global:admin", "global:member"] } }, required: ["email"] } } }, required: ["clientId", "users"] } - src/index.ts:566-589 (registration)Registration of the create-users tool in the ListToolsRequestSchema handler's tools array, including name, description, and input schema.
{ name: "create-users", description: "Create one or more users in your instance.", inputSchema: { type: "object", properties: { clientId: { type: "string" }, users: { type: "array", items: { type: "object", properties: { email: { type: "string" }, role: { type: "string", enum: ["global:admin", "global:member"] } }, required: ["email"] } } }, required: ["clientId", "users"] } - src/index.ts:234-239 (helper)N8nClient helper method that performs the POST request to the /users endpoint to create the users.
async createUsers(users: Array<{ email: string; role?: 'global:admin' | 'global:member' }>): Promise<any> { return this.makeRequest('/users', { method: 'POST', body: JSON.stringify(users), }); }