transfer_credential
Move n8n credentials between projects or assign them to different owners for better access control and workflow management.
Instructions
Transfer an n8n credential to a different project or owner
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| projectId | No | ||
| newOwnerId | No |
Implementation Reference
- src/index.ts:457-461 (handler)MCP tool handler for transfer_credential: extracts args, calls n8nClient.transferCredential, formats success responseprivate async handleTransferCredential(args: { id: string | number } & TransferRequest) { const { id, ...transferData } = args; const result = await this.n8nClient.transferCredential(id, transferData); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(result), null, 2) }] }; }
- src/n8n-client.ts:508-511 (helper)Core implementation: Makes PUT request to n8n API /credentials/{id}/transfer endpointasync transferCredential(id: string | number, transferData: TransferRequest): Promise<TransferResponse> { const response = await this.api.put<N8nApiResponse<TransferResponse>>(`/credentials/${id}/transfer`, transferData); return response.data.data; }
- src/index.ts:193-193 (registration)Tool registration in list_tools response, defines name, description, input schema{ name: 'transfer_credential', description: 'Transfer an n8n credential to a different project or owner', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }] }, projectId: { type: 'string' }, newOwnerId: { type: 'string' } }, required: ['id'] } },
- src/types.ts:74-83 (schema)Type definitions for TransferRequest (input) and TransferResponse (output) used by the tool handler and client methodexport interface TransferRequest { projectId?: string; newOwnerId?: string; } export interface TransferResponse { id: string | number; projectId?: string; newOwnerId?: string; }