create-users
Add one or more users to your n8n instance with specified email addresses and roles, enabling team collaboration and access management.
Instructions
Create one or more users in your instance.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientId | Yes | ||
| users | Yes |
Implementation Reference
- src/index.ts:1291-1327 (handler)MCP tool handler for 'create-users': retrieves N8nClient by clientId, validates existence, calls client.createUsers(users), returns result or error.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 for 'create-users' tool specifying clientId and array of users 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:567-590 (registration)Registration of 'create-users' tool in the ListTools response, 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 createUsers that sends POST request to /users with array of user objects.async createUsers(users: Array<{ email: string; role?: 'global:admin' | 'global:member' }>): Promise<any> { return this.makeRequest('/users', { method: 'POST', body: JSON.stringify(users), }); }