sitebay_create_site
Create a new WordPress site on SiteBay with custom domain, admin credentials, and optional Git integration or ready-made templates.
Instructions
Create a new WordPress site (SiteLiveCreate schema).
Args: team_id: Team UUID that owns the site fqdn: The fully qualified domain name for the new site (e.g., "www.example.org") wordpress_blog_name: Blog/site title wordpress_first_name: Admin first name wordpress_last_name: Admin last name wordpress_email: Admin email address wordpress_username: Admin username wordpress_password: Admin password (strong) git_url: Optional Git repository URL ready_made_site_name: Optional ready-made site name is_free: Optional flag for free plan
Returns: Success message with new site details and access information
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team_id | Yes | ||
| fqdn | Yes | ||
| wordpress_blog_name | Yes | ||
| wordpress_first_name | Yes | ||
| wordpress_last_name | Yes | ||
| wordpress_email | Yes | ||
| wordpress_username | Yes | ||
| wordpress_password | Yes | ||
| git_url | No | ||
| ready_made_site_name | No | ||
| is_free | No |
Implementation Reference
- src/sitebay_mcp/server.py:111-192 (handler)Primary MCP tool handler registered with @mcp.tool for 'sitebay_create_site'. Handles context, client initialization, input validation, delegates to core logic in sites.py, and provides comprehensive error handling with ctx.error calls.@mcp.tool async def sitebay_create_site( ctx: Context, team_id: str, fqdn: str, wordpress_blog_name: str, wordpress_first_name: str, wordpress_last_name: str, wordpress_email: str, wordpress_username: str, wordpress_password: str, git_url: Optional[str] = None, ready_made_site_name: Optional[str] = None, is_free: Optional[bool] = None, ) -> str: """ Create a new WordPress site (SiteLiveCreate schema). Args: team_id: Team UUID that owns the site fqdn: The fully qualified domain name for the new site (e.g., "www.example.org") wordpress_blog_name: Blog/site title wordpress_first_name: Admin first name wordpress_last_name: Admin last name wordpress_email: Admin email address wordpress_username: Admin username wordpress_password: Admin password (strong) git_url: Optional Git repository URL ready_made_site_name: Optional ready-made site name is_free: Optional flag for free plan Returns: Success message with new site details and access information """ try: await ctx.info(f"Starting site creation for: {fqdn}") client = await initialize_client() # Basic validation if not fqdn or '.' not in fqdn: raise ValueError("Invalid domain name provided") if not team_id: raise ValueError("team_id is required") result = await sites.sitebay_create_site( client, team_id, fqdn, wordpress_blog_name, wordpress_first_name, wordpress_last_name, wordpress_email, wordpress_username, wordpress_password, git_url, ready_made_site_name, is_free, ) await ctx.info(f"Successfully created site: {fqdn}") return result except ValueError as e: await ctx.error(f"Validation error creating site {fqdn}: {str(e)}") return f"❌ Validation Error: {str(e)}" except ValidationError as e: await ctx.error(f"SiteBay validation error creating site {fqdn}: {str(e)}") error_msg = f"❌ Validation Error - Please check your input:\n{str(e)}\n" if hasattr(e, 'field_errors') and e.field_errors: error_msg += "\nSpecific field errors:\n" for field, msg in e.field_errors.items(): error_msg += f" • {field}: {msg}\n" error_msg += "\nPlease adjust your parameters and try again." return error_msg except SiteBayError as e: await ctx.error(f"SiteBay API error creating site {fqdn}: {str(e)}") return f"❌ SiteBay Error: {str(e)}" except Exception as e: await ctx.error(f"Unexpected error creating site {fqdn}: {str(e)}") return f"❌ Unexpected error: {str(e)}"
- src/sitebay_mcp/tools/sites.py:94-164 (handler)Core handler logic for site creation. Constructs the site_data dictionary from parameters and calls client.create_site(site_data). Formats the success response with site details or error message.async def sitebay_create_site( client: SiteBayClient, team_id: str, fqdn: str, wordpress_blog_name: str, wordpress_first_name: str, wordpress_last_name: str, wordpress_email: str, wordpress_username: str, wordpress_password: str, git_url: Optional[str] = None, ready_made_site_name: Optional[str] = None, is_free: Optional[bool] = None, ) -> str: """ Create a new WordPress site (SiteLiveCreate schema). Args: team_id: Team UUID fqdn: New site domain wordpress_blog_name: Blog/site title wordpress_first_name: Admin first name wordpress_last_name: Admin last name wordpress_email: Admin email wordpress_username: Admin username wordpress_password: Admin password git_url: Optional repository URL ready_made_site_name: Optional ready-made site name is_free: Optional free plan flag Returns: Formatted string with new site details """ try: site_data: Dict[str, Any] = { "team_id": team_id, "fqdn": fqdn, "wordpress_blog_name": wordpress_blog_name, "wordpress_first_name": wordpress_first_name, "wordpress_last_name": wordpress_last_name, "wordpress_email": wordpress_email, "wordpress_username": wordpress_username, "wordpress_password": wordpress_password, } if git_url: site_data["git_url"] = git_url if ready_made_site_name: site_data["ready_made_site_name"] = ready_made_site_name if is_free is not None: site_data["is_free"] = is_free site = await client.create_site(site_data) result = f"✅ **Site Created Successfully!**\n\n" result += f"• **Domain**: {site.get('fqdn')}\n" result += f"• **Active**: {site.get('active', 'Unknown')}\n" result += f"• **HTTP Auth Enabled**: {site.get('http_auth_enabled', 'Unknown')}\n" result += f"• **Admin Username**: {wordpress_username}\n" result += f"• **Admin Email**: {wordpress_email}\n" if git_url: result += f"• **Git URL**: {git_url}\n" if ready_made_site_name: result += f"• **Ready-made**: {ready_made_site_name}\n" if is_free is not None: result += f"• **Plan**: {'Free' if is_free else 'Paid'}\n" result += "\n🚀 Your WordPress site is being deployed and will be ready shortly!" return result except SiteBayError as e: return f"Error creating site: {str(e)}"
- src/sitebay_mcp/server.py:111-111 (registration)Registration of the 'sitebay_create_site' tool via the @mcp.tool decorator in the FastMCP server.@mcp.tool