list-users
Retrieve all users from your MCP-N8N instance. This tool is restricted to the instance owner and requires a clientId for authentication.
Instructions
Retrieve all users from your instance. Only available for the instance owner.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientId | Yes |
Implementation Reference
- src/index.ts:1259-1289 (handler)Executes the list-users tool by fetching users via N8nClient.listUsers() and returning formatted JSON.case "list-users": { const { clientId } = args as { clientId: string }; const client = clients.get(clientId); if (!client) { return { content: [{ type: "text", text: "Client not initialized. Please run init-n8n first.", }], isError: true }; } try { const users = await client.listUsers(); return { content: [{ type: "text", text: JSON.stringify(users.data, null, 2), }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; } }
- src/index.ts:556-565 (registration)Registers the list-users tool in the listTools response with name, description, and input schema.name: "list-users", description: "Retrieve all users from your instance. Only available for the instance owner.", inputSchema: { type: "object", properties: { clientId: { type: "string" } }, required: ["clientId"] } },
- src/index.ts:231-232 (helper)N8nClient helper method that performs the API request to list users.return this.makeRequest<N8nUserList>('/users'); }
- src/index.ts:19-22 (schema)Type definition for the response from the users API.interface N8nUserList { data: N8nUser[]; nextCursor?: string; }
- src/index.ts:8-17 (schema)Type definition for individual n8n user objects.interface N8nUser { id: string; email: string; firstName?: string; lastName?: string; isPending: boolean; role?: string; createdAt: string; updatedAt: string; }