create_cli_token
Generate a CLI token to execute Airflow commands in Amazon MWAA environments for workflow automation and management.
Instructions
Create a CLI token for executing Airflow CLI commands.
Args: name: The name of the MWAA environment
Returns: Dictionary containing the CLI token and webserver hostname
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- awslabs/mwaa_mcp_server/tools.py:224-236 (handler)The implementation of the 'create_cli_token' tool, which calls the MWAA client's create_cli_token method.
async def create_cli_token(self, name: str) -> Dict[str, Any]: """Create a CLI token for the environment.""" try: response = self.mwaa_client.create_cli_token(Name=name) return { "CliToken": response["CliToken"], "WebServerHostname": response["WebServerHostname"], } except (ClientError, BotoCoreError) as e: logger.error("Error creating CLI token for %s: %s", name, e) return {"error": str(e)} - awslabs/mwaa_mcp_server/server.py:217-229 (registration)The registration of the 'create_cli_token' tool in the MCP server.
@mcp.tool(name="create_cli_token") async def create_cli_token( name: str, ) -> Dict[str, Any]: """Create a CLI token for executing Airflow CLI commands. Args: name: The name of the MWAA environment Returns: Dictionary containing the CLI token and webserver hostname """ return await tools.create_cli_token(name)