Add Client
whmcs_add_clientAdd a new client to your WHMCS installation by submitting their personal info, contact details, and password.
Instructions
Create a new client in WHMCS
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| firstname | Yes | Client first name | |
| lastname | Yes | Client last name | |
| Yes | Client email address | ||
| address1 | Yes | Street address | |
| city | Yes | City | |
| state | Yes | State/Province | |
| postcode | Yes | Postal/ZIP code | |
| country | Yes | Country (2-letter ISO code) | |
| phonenumber | Yes | Phone number | |
| password2 | Yes | Password for the client account | |
| companyname | No | Company name | |
| address2 | No | Address line 2 | |
| currency | No | Currency ID | |
| language | No | Client language | |
| groupid | No | Client group ID | |
| notes | No | Admin notes | |
| noemail | No | Do not send welcome email |
Implementation Reference
- src/index.ts:90-121 (registration)Tool registration for 'whmcs_add_client' - registers the tool with the MCP server, defining its input schema and handler that delegates to whmcsClient.addClient().
server.registerTool( 'whmcs_add_client', { title: 'Add Client', description: 'Create a new client in WHMCS', inputSchema: { firstname: z.string().describe('Client first name'), lastname: z.string().describe('Client last name'), email: z.string().email().describe('Client email address'), address1: z.string().describe('Street address'), city: z.string().describe('City'), state: z.string().describe('State/Province'), postcode: z.string().describe('Postal/ZIP code'), country: z.string().describe('Country (2-letter ISO code)'), phonenumber: z.string().describe('Phone number'), password2: z.string().describe('Password for the client account'), companyname: z.string().optional().describe('Company name'), address2: z.string().optional().describe('Address line 2'), currency: z.number().optional().describe('Currency ID'), language: z.string().optional().describe('Client language'), groupid: z.number().optional().describe('Client group ID'), notes: z.string().optional().describe('Admin notes'), noemail: z.boolean().optional().describe('Do not send welcome email'), }, }, async (params) => { const result = await whmcsClient.addClient(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:95-113 (schema)Input schema definition for 'whmcs_add_client' - defines Zod validation for client creation fields including required fields (firstname, lastname, email, address1, city, state, postcode, country, phonenumber, password2) and optional fields.
inputSchema: { firstname: z.string().describe('Client first name'), lastname: z.string().describe('Client last name'), email: z.string().email().describe('Client email address'), address1: z.string().describe('Street address'), city: z.string().describe('City'), state: z.string().describe('State/Province'), postcode: z.string().describe('Postal/ZIP code'), country: z.string().describe('Country (2-letter ISO code)'), phonenumber: z.string().describe('Phone number'), password2: z.string().describe('Password for the client account'), companyname: z.string().optional().describe('Company name'), address2: z.string().optional().describe('Address line 2'), currency: z.number().optional().describe('Currency ID'), language: z.string().optional().describe('Client language'), groupid: z.number().optional().describe('Client group ID'), notes: z.string().optional().describe('Admin notes'), noemail: z.boolean().optional().describe('Do not send welcome email'), }, - src/whmcs-client.ts:170-203 (handler)Handler implementation - WhmcsApiClient.addClient() method that calls the WHMCS API 'AddClient' action, returning the new clientid and owner_user_id.
async addClient(params: { firstname: string; lastname: string; email: string; address1: string; city: string; state: string; postcode: string; country: string; phonenumber: string; password2: string; companyname?: string; address2?: string; currency?: number; clientip?: string; language?: string; groupid?: number; securityqid?: number; securityqans?: string; notes?: string; cardtype?: string; cardnum?: string; expdate?: string; startdate?: string; issuenumber?: string; cvv?: string; noemail?: boolean; skipvalidation?: boolean; }) { return this.call<WhmcsApiResponse & { clientid: number; owner_user_id: number; }>('AddClient', params); }