create_site
Add a website to the ESA MCP Server by specifying domain name, coverage location, DNS setup, and instance ID, ensuring compliance with regional requirements like ICP filing for Chinese mainland coverage.
Instructions
Adds a website. Make sure that you have an available plan before you add a website. Make sure that your website domain name has an ICP filing if the location you want to specify covers the Chinese mainland.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteName | Yes | The website name. | |
| coverage | Yes | The service location. Valid values: - domestic: the Chinese mainland - global: global - overseas: outside the Chinese mainland | |
| accessType | Yes | The DNS setup. Valid values: - NS; - CNAME | |
| instanceId | Yes | The instance ID, which can be obtained by calling the [ListUserRatePlanInstances] operation. Specify at least one of the instance ID and website ID. If you specify both of them, the instance ID is used. | |
| resourceGroupId | No | The ID of the resource group. If you leave this parameter empty, the system uses the default resource group ID. |
Implementation Reference
- src/tools/site/site.ts:256-265 (handler)MCP tool handler function for 'create_site'. Extracts tool call arguments and invokes the underlying API service, returning the JSON response.export const create_site = async (request: CallToolRequest) => { const res = await api.createSite( request.params.arguments as CreateSiteRequest, ); return { content: [{ type: 'text', text: JSON.stringify(res) }], success: true, }; };
- src/tools/site/site.ts:115-161 (schema)Tool schema for 'create_site' defining name, description, input schema with properties like siteName, coverage, accessType, instanceId (required), and annotations.export const CREATE_SITE_TOOL: Tool = { name: 'create_site', description: 'Adds a website. Make sure that you have an available plan before you add a website. Make sure that your website domain name has an ICP filing if the location you want to specify covers the Chinese mainland.', inputSchema: { type: 'object', properties: { siteName: { type: 'string', description: 'The website name.', examples: ['example.com'], }, coverage: { type: 'string', description: 'The service location. Valid values:\n- domestic: the Chinese mainland\n- global: global\n- overseas: outside the Chinese mainland', enum: ['global', 'domestic', 'overseas'], examples: ['domestic'], }, accessType: { type: 'string', description: 'The DNS setup. Valid values:\n- NS;\n- CNAME', enum: ['NS', 'CNAME'], examples: ['NS'], }, instanceId: { type: 'string', description: 'The instance ID, which can be obtained by calling the [ListUserRatePlanInstances] operation. Specify at least one of the instance ID and website ID. If you specify both of them, the instance ID is used.', examples: ['dbaudit-cn-nwy349jdb03'], }, resourceGroupId: { type: 'string', description: 'The ID of the resource group. If you leave this parameter empty, the system uses the default resource group ID.', examples: ['rg-acfmw4znnok****'], }, }, required: ['siteName', 'coverage', 'accessType', 'instanceId'], annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false, }, }, };
- src/utils/service.ts:389-398 (helper)Helper method in API service client that wraps the Alibaba Cloud ESA client's createSite API call, handling request construction and runtime options.createSite(params: CreateSiteRequest) { const request = new CreateSiteRequest(params); return this.callApi( this.client.createSite.bind(this.client) as ApiMethod< CreateSiteRequest, CreateSiteResponse >, request, ); }
- src/tools/list-esa-function.ts:164-208 (registration)Registration of all ESA tool handlers, including 'create_site', in the esaHandlers object used for MCP tool dispatching.export const esaHandlers: ToolHandlers = { site_active_list, site_match, site_route_list, site_record_list, routine_create, routine_code_commit, routine_delete, routine_list, routine_get, routine_code_deploy, routine_route_list, deployment_delete, route_create, route_delete, route_update, route_get, er_record_create, er_record_delete, er_record_list, html_deploy, create_site, update_site_pause, get_site_pause, create_site_mx_record, create_site_ns_record, create_site_txt_record, create_site_cname_record, create_site_a_or_aaaa_record, update_record, list_records, get_record, delete_record, update_ipv6, get_ipv6, update_managed_transform, get_managed_transform, set_certificate, apply_certificate, get_certificate, delete_certificate, list_certificates, get_certificate_quota, list_sites, };