This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new fa847a679b4 feat(mcp): add create/update/delete dataset column tools 
(#46048)
fa847a679b4 is described below

commit fa847a679b46fb8c01a8391f69a38f74b77d7225
Author: Evan Rusackas <[email protected]>
AuthorDate: Fri Nov 13 14:21:06 2026 -0800

    feat(mcp): add create/update/delete dataset column tools (#46048)
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 docs/admin_docs/configuration/mcp-server.mdx       |   5 +-
 .../docs/using-superset/using-ai-with-superset.mdx |  16 +
 superset/commands/dataset/update.py                |  46 ++
 superset/mcp_service/app.py                        |   7 +
 superset/mcp_service/dashboard_scope.py            |   3 +
 superset/mcp_service/dataset/schemas.py            | 272 ++++++++-
 superset/mcp_service/dataset/tool/__init__.py      |   6 +
 .../dataset/tool/create_dataset_column.py          | 188 ++++++
 .../dataset/tool/delete_dataset_column.py          | 265 +++++++++
 .../dataset/tool/delete_dataset_metric.py          |  14 +-
 .../dataset/tool/update_dataset_column.py          | 296 ++++++++++
 superset/mcp_service/mcp_config.py                 |   3 +
 superset/mcp_service/utils/response_size_utils.py  |   3 +
 .../dataset/tool/test_dataset_column_mutations.py  | 654 +++++++++++++++++++++
 .../mcp_service/native_tool_inventory.json         |  90 ++-
 .../mcp_service/test_mcp_tool_registration.py      |   9 +
 .../mcp_service/test_rbac_tool_enforcement.py      |  18 +
 .../test_sanitization_warning_inputs.py            |  31 +
 .../unit_tests/mcp_service/test_tool_inventory.py  |   3 +
 19 files changed, 1902 insertions(+), 27 deletions(-)

diff --git a/docs/admin_docs/configuration/mcp-server.mdx 
b/docs/admin_docs/configuration/mcp-server.mdx
index 5e016b70416..2d01d083ce4 100644
--- a/docs/admin_docs/configuration/mcp-server.mdx
+++ b/docs/admin_docs/configuration/mcp-server.mdx
@@ -2529,11 +2529,12 @@ or whitespace-only dashboard renames with "Text must 
not be empty"; omitting
 `dashboard_title` leaves the stored title unchanged.
 
 Blank names in `create_virtual_dataset`, `create_theme`, 
`create_dataset_metric`,
-`update_dataset_metric`, and `update_dataset`, and whitespace-only labels in
+`update_dataset_metric`, `create_dataset_column`, `update_dataset_column`, and
+`update_dataset`, and whitespace-only labels in
 `save_sql_query`, report "Text must not be empty" at the corresponding name 
field.
 Blank-name checks precede length checks, including whitespace-only inputs 
longer
 than the field limit.
-Explicit null metric or dataset names remain invalid; omitting them from 
updates
+Explicit null metric, column, or dataset names remain invalid; omitting them 
from updates
 leaves the stored name unchanged.
 
 ### Chart and dashboard titles
diff --git a/docs/docs/using-superset/using-ai-with-superset.mdx 
b/docs/docs/using-superset/using-ai-with-superset.mdx
index 03d90d19c17..c0bec3c622f 100644
--- a/docs/docs/using-superset/using-ai-with-superset.mdx
+++ b/docs/docs/using-superset/using-ai-with-superset.mdx
@@ -328,6 +328,9 @@ the corresponding catalog asset type, subject to the 
caller's permissions.
 | `create_dataset_metric` | Add a saved metric with a unique name and SQL 
expression; accepts the same optional properties as `update_dataset_metric` 
(requires dataset editorship) |
 | `delete_dataset_metric` | Delete only the selected saved metric by ID, UUID, 
or name, preserving concurrently added metrics, and report accessible charts 
referencing it; chart definitions are not modified (requires dataset 
editorship) |
 | `update_dataset_metric`  | Update a saved metric's expression, name, 
verbose_name, or format (affects every chart using it; requires dataset 
ownership) |
+| `create_dataset_column` | Add a calculated column (a named, row-level SQL 
expression) with a unique name; other columns are preserved (requires dataset 
editorship) |
+| `update_dataset_column` | Update a column's label, description, type, 
temporal/groupby/filterable flags or date format, and a calculated column's 
expression or name (affects every chart using it; requires dataset ownership) |
+| `delete_dataset_column` | Delete a calculated column by ID, UUID, or name 
and report accessible charts referencing it; physical columns cannot be deleted 
and chart definitions are not modified (requires dataset editorship) |
 
 Saved-metric creation and deletion accept a dataset ID or UUID and require the
 same dataset write permission and editorship as metric updates. For example,
@@ -346,6 +349,19 @@ that those charts may need repair; deletion does not 
rewrite charts. References
 embedded in SQL expressions are not inferred. If a chart has malformed 
query-context
 JSON, impact reporting still checks its saved form data and other accessible 
charts.
 
+Calculated columns work the same way. Call `create_dataset_column` with
+`{"dataset_id": 123, "column_name": "order_size", "expression": "CASE WHEN 
amount > 100 THEN 'large' ELSE 'small' END"}`
+to add one; optional properties are `verbose_name`, `description`, `type`,
+`is_dttm`, `groupby`, `filterable`, and `python_date_format`. Expressions go 
through
+the same SQL validation as the dataset editor. `update_dataset_column` changes 
only
+the properties you pass. It also edits physical columns' display and behavior
+settings, but it refuses to rename a physical column or give it an expression,
+because physical columns mirror the source table. `delete_dataset_column` 
removes
+only calculated columns and reports `affected_charts`: accessible charts that
+reference the column by name as a dimension, in a simple filter, or in a simple
+adhoc metric. Pass `column_fields` including `expression` to `get_dataset_info`
+to see which columns are calculated.
+
 ### Semantic Layer
 
 | Tool                         | Description                                   
                                                                                
    |
diff --git a/superset/commands/dataset/update.py 
b/superset/commands/dataset/update.py
index beca6c7ee80..188e90fa517 100644
--- a/superset/commands/dataset/update.py
+++ b/superset/commands/dataset/update.py
@@ -108,6 +108,7 @@ class UpdateDatasetCommand(UpdateMixin, BaseCommand):
         override_columns: Optional[bool] = False,
         *,
         preserve_existing_metrics: bool = False,
+        preserve_existing_columns: bool = False,
         delete_metric_ids: set[int] | None = None,
     ):
         self._model_id = model_id
@@ -116,6 +117,7 @@ class UpdateDatasetCommand(UpdateMixin, BaseCommand):
         self.override_columns = override_columns
         self._delete_metric_ids = delete_metric_ids
         self._preserve_existing_metrics = preserve_existing_metrics
+        self._preserve_existing_columns = preserve_existing_columns
         self._properties["override_columns"] = override_columns
 
     @transaction(
@@ -154,6 +156,11 @@ class UpdateDatasetCommand(UpdateMixin, BaseCommand):
 
         raise_if_managed_externally(self._model, DatasetForbiddenError)
 
+        if self._preserve_existing_columns and "columns" in self._properties:
+            self._properties["columns"] = self._with_existing_columns(
+                self._properties["columns"]
+            )
+
         # Validate/Populate editors
         compute_subjects(self._model, self._properties, exceptions)
 
@@ -170,6 +177,45 @@ class UpdateDatasetCommand(UpdateMixin, BaseCommand):
         if exceptions:
             raise DatasetInvalidError(exceptions=exceptions)
 
+    def _with_existing_columns(
+        self, columns: list[dict[str, Any]]
+    ) -> list[dict[str, Any]]:
+        """
+        Complete an additive ``columns`` payload with the stored columns it 
omits.
+
+        A ``columns`` payload replaces the dataset's column list, so a caller
+        that only means to add or edit one column would otherwise have to echo
+        every other column back, and a column another writer added or renamed
+        after the caller read the dataset would be dropped or reverted. Filling
+        the gaps from the model loaded by this command keeps those changes, and
+        hands every downstream check (duplicates, partition mapping, folders)
+        the complete list it expects.
+
+        Payload entries that carry an ``id`` but no ``column_name`` take the
+        stored name, since validation keys on it.
+        """
+        model = cast(SqlaTable, self._model)
+        names_by_id = {column.id: column.column_name for column in 
model.columns}
+        completed: list[dict[str, Any]] = []
+        for column in columns:
+            if "id" in column and "column_name" not in column:
+                column = {**column, "column_name": 
names_by_id.get(column["id"])}
+            completed.append(column)
+        payload_ids = {column["id"] for column in columns if "id" in column}
+        for existing in model.columns:
+            if existing.id in payload_ids:
+                continue
+            stub: dict[str, Any] = {
+                "id": existing.id,
+                "column_name": existing.column_name,
+            }
+            # The partition mapping check reads the mapped column's transform
+            # from the payload, so carry the stored one rather than hide it.
+            if existing.partition_value_transform is not None:
+                stub["partition_value_transform"] = 
existing.partition_value_transform
+            completed.append(stub)
+        return completed
+
     def _validate_dataset_source(self, exceptions: list[ValidationError]) -> 
None:
         # we know we have a valid model
         self._model = cast(SqlaTable, self._model)
diff --git a/superset/mcp_service/app.py b/superset/mcp_service/app.py
index 7bd91a6edff..5a8b0e25d9f 100644
--- a/superset/mcp_service/app.py
+++ b/superset/mcp_service/app.py
@@ -192,6 +192,9 @@ Dataset Management:
 - create_dataset: Register a physical table as a dataset against an existing 
DB connection (requires write access)
 - create_virtual_dataset: Save a SQL query as a virtual dataset for charting 
(requires write access)
 - update_dataset: Update a dataset's name, SQL (virtual datasets), 
description, default datetime column or cache timeout, re-syncing columns when 
the SQL changes (requires dataset ownership)
+- create_dataset_column: Add a calculated column (row-level SQL expression) to 
a dataset (requires dataset editorship)
+- update_dataset_column: Update a dataset column — a calculated column's 
expression or name, or any column's label, type, temporal/groupby/filterable 
flags, date format (requires dataset ownership)
+- delete_dataset_column: Delete a calculated column and report referencing 
charts (requires dataset editorship)
 - create_dataset_metric: Add a saved metric to a dataset (requires dataset 
editorship)
 - delete_dataset_metric: Delete a saved metric and report referencing charts 
(requires dataset editorship)
 - update_dataset_metric: Update a saved metric on a dataset — expression, 
name, verbose_name, format (requires dataset ownership)
@@ -534,6 +537,7 @@ Input format:
   charts, or dashboards). SQL execution is a separate permission — see 
execute_sql below.
 - Write tools (generate_chart, generate_dashboard, update_chart, 
update_dashboard,
   duplicate_dashboard, create_dataset, create_virtual_dataset, update_dataset,
+  create_dataset_column, update_dataset_column, delete_dataset_column,
   create_dataset_metric, delete_dataset_metric, update_dataset_metric,
   save_sql_query, add_chart_to_existing_dashboard, manage_native_filters,
   remove_chart_from_dashboard, update_chart_preview, manage_dashboard_owners,
@@ -860,15 +864,18 @@ from superset.mcp_service.database.tool import (  # noqa: 
F401, E402
 )
 from superset.mcp_service.dataset.tool import (  # noqa: F401, E402
     create_dataset,
+    create_dataset_column,
     create_dataset_metric,
     create_virtual_dataset,
     delete_dataset,
+    delete_dataset_column,
     delete_dataset_metric,
     get_dataset_info,
     list_datasets,
     query_dataset,
     restore_dataset,
     update_dataset,
+    update_dataset_column,
     update_dataset_metric,
 )
 from superset.mcp_service.explore.tool import (  # noqa: F401, E402
diff --git a/superset/mcp_service/dashboard_scope.py 
b/superset/mcp_service/dashboard_scope.py
index 07260898866..3618b0a03c3 100644
--- a/superset/mcp_service/dashboard_scope.py
+++ b/superset/mcp_service/dashboard_scope.py
@@ -1236,6 +1236,8 @@ DEFINITION_CHANGING_TOOLS = (
     "update_dashboard",
     "create_virtual_dataset",
     "update_dataset",
+    "create_dataset_column",
+    "update_dataset_column",
     "create_dataset_metric",
     "update_dataset_metric",
     "restore_chart",
@@ -1273,6 +1275,7 @@ SCOPE_NEUTRAL_TOOLS = frozenset(
         "delete_chart",
         "delete_dashboard",
         "delete_dataset",
+        "delete_dataset_column",
         "delete_dataset_metric",
         "duplicate_dashboard",
         "find_users",
diff --git a/superset/mcp_service/dataset/schemas.py 
b/superset/mcp_service/dataset/schemas.py
index d7539f6083a..9e2d031a453 100644
--- a/superset/mcp_service/dataset/schemas.py
+++ b/superset/mcp_service/dataset/schemas.py
@@ -139,6 +139,10 @@ class TableColumnInfo(BaseModel):
     groupby: bool | None = Field(None, description="Is groupable")
     filterable: bool | None = Field(None, description="Is filterable")
     description: str | None = Field(None, description="Column description")
+    expression: str | None = Field(
+        None,
+        description="SQL expression of a calculated column; null for physical 
columns",
+    )
 
     @model_serializer(mode="wrap")
     def _filter_column_fields_by_context(
@@ -521,7 +525,8 @@ class GetDatasetInfoRequest(MetadataCacheControl):
                 "Per-column fields to include for entries in 'columns'. 
Defaults "
                 "to ['column_name','type','is_dttm']. Pass a wider list to "
                 "include 'verbose_name','groupby','filterable','description' "
-                "when needed."
+                "when needed, or 'expression' to see which columns are "
+                "calculated and their SQL."
             ),
         ),
     ]
@@ -1022,6 +1027,262 @@ class DeleteDatasetMetricResponse(BaseModel):
     error: str | None = Field(None, description="Error message, or null on 
success")
 
 
+UPDATABLE_COLUMN_FIELDS: frozenset[str] = frozenset(
+    {
+        "column_name",
+        "expression",
+        "verbose_name",
+        "description",
+        "type",
+        "is_dttm",
+        "groupby",
+        "filterable",
+        "python_date_format",
+    }
+)
+
+# Properties tied to a physical column's identity in the source table. Changing
+# them on a physical column breaks it rather than editing it.
+PHYSICAL_COLUMN_LOCKED_FIELDS: frozenset[str] = frozenset({"column_name", 
"expression"})
+
+
+class DatasetColumnProperties(OmittedMeansUnchanged):
+    """Dataset identifier and writable column properties."""
+
+    model_config = ConfigDict(populate_by_name=True)
+
+    dataset_id: int | str = Field(
+        ...,
+        description="Dataset identifier — numeric ID or UUID string. "
+        "Use list_datasets to find valid IDs.",
+    )
+
+    @field_validator("dataset_id", mode="before")
+    @classmethod
+    def reject_bool_identifiers(cls, value: object) -> object:
+        """bool is a subclass of int, so true would coerce to ID 1."""
+        if isinstance(value, bool):
+            raise ValueError("identifier must be an integer ID or string")
+        return value
+
+    column_name: str | None = Field(
+        None,
+        max_length=255,
+        description="New column name, unique within the dataset. Only pass 
this "
+        "to rename a calculated column; physical columns cannot be renamed.",
+    )
+    expression: str | None = Field(
+        None,
+        description="SQL expression evaluated per row, e.g. "
+        "\"CASE WHEN amount > 100 THEN 'large' ELSE 'small' END\". "
+        "Only calculated columns have an expression.",
+    )
+    verbose_name: str | None = Field(
+        None, max_length=1024, description="Human-friendly display label."
+    )
+    description: str | None = Field(None, description="Column description.")
+    type: str | None = Field(
+        None,
+        description="SQL type of the expression's result (e.g. 'VARCHAR', "
+        "'DOUBLE', 'TIMESTAMP'). Helps Superset pick filters and formatting.",
+    )
+    is_dttm: bool | None = Field(
+        None, description="Whether the column is temporal (usable as a time 
axis)."
+    )
+    groupby: bool | None = Field(
+        None, description="Whether the column can be used as a dimension."
+    )
+    filterable: bool | None = Field(
+        None, description="Whether the column can be filtered on."
+    )
+    python_date_format: str | None = Field(
+        None,
+        min_length=1,
+        max_length=255,
+        description="Python strftime format of a temporal string column "
+        "(e.g. '%Y-%m-%d'), or 'epoch_s' / 'epoch_ms' for epoch values.",
+    )
+
+    @field_validator("groupby", "filterable")
+    @classmethod
+    def reject_null_flags(cls, value: bool | None) -> bool | None:
+        """Reject an explicit null; omit the field to leave it unchanged."""
+        if value is None:
+            raise ValueError("value must be true or false; omit the field 
instead")
+        return value
+
+    @field_validator("column_name", mode="before")
+    @classmethod
+    def reject_blank_column_name(cls, value: object) -> object:
+        """Reject blank names before the length cap without trimming valid 
names."""
+        if isinstance(value, (bytes, bytearray)):
+            try:
+                value = value.decode()
+            except UnicodeDecodeError:
+                return value  # Let Pydantic report its string_unicode error.
+        if isinstance(value, str) and not value.strip():
+            raise PydanticCustomError("empty_text", "column_name cannot be 
empty")
+        return value
+
+    @field_validator("python_date_format")
+    @classmethod
+    def python_date_format_must_be_valid(cls, value: str | None) -> str | None:
+        from superset.daos.dataset import DatasetDAO
+
+        if value is not None and not 
DatasetDAO.validate_python_date_format(value):
+            raise ValueError(
+                "Invalid python_date_format: must be a strftime format that "
+                "produces an ISO 8601 timestamp, or 'epoch_s' / 'epoch_ms'"
+            )
+        return value
+
+    def updates(self) -> Dict[str, Any]:
+        """Return only the column properties explicitly provided by the caller.
+
+        ``exclude_unset`` distinguishes "not provided" (leave the stored value
+        alone) from an explicit ``null`` (clear the stored value).
+        """
+        return self.model_dump(
+            exclude_unset=True,
+            include=set(UPDATABLE_COLUMN_FIELDS),
+        )
+
+    @model_validator(mode="after")
+    def validate_updates(self) -> "DatasetColumnProperties":
+        """Require at least one updatable property and reject empty values."""
+        provided = self.model_fields_set & UPDATABLE_COLUMN_FIELDS
+        if not provided:
+            raise ValueError(
+                "At least one column property must be provided to update. "
+                f"Updatable properties: {sorted(UPDATABLE_COLUMN_FIELDS)}."
+            )
+        if "column_name" in provided and self.column_name is None:
+            with field_validation_error("column_name"):
+                raise PydanticCustomError(
+                    "empty_text", "column_name cannot be empty or null"
+                )
+        if "expression" in provided and not (self.expression or "").strip():
+            raise ValueError(
+                "expression cannot be empty or null; use delete_dataset_column 
"
+                "to remove a calculated column"
+            )
+        return self
+
+
+class UpdateDatasetColumnRequest(DatasetColumnProperties):
+    """Request schema for update_dataset_column."""
+
+    column: int | str = Field(
+        ...,
+        description="Column to update — numeric column ID, column UUID, or "
+        "column_name (e.g. 'order_size'). Numeric strings are treated as IDs. "
+        "Use get_dataset_info to discover a dataset's columns.",
+    )
+
+    @field_validator("column", mode="before")
+    @classmethod
+    def reject_bool_column(cls, value: object) -> object:
+        """bool is a subclass of int, so true would coerce to ID 1."""
+        if isinstance(value, bool):
+            raise ValueError("identifier must be an integer ID or string")
+        return value
+
+
+class CreateDatasetColumnRequest(DatasetColumnProperties):
+    """Request schema for create_dataset_column."""
+
+    column_name: str = Field(
+        ..., max_length=255, description="Column name, unique within the 
dataset."
+    )
+    expression: str = Field(
+        ...,
+        description="SQL expression evaluated per row, e.g. "
+        "\"CASE WHEN amount > 100 THEN 'large' ELSE 'small' END\".",
+    )
+
+
+class DeleteDatasetColumnRequest(BaseModel):
+    """Request schema for delete_dataset_column."""
+
+    dataset_id: int | str = Field(
+        ..., description="Dataset identifier — numeric ID or UUID string."
+    )
+    column: int | str = Field(
+        ...,
+        description="Calculated column ID, UUID, or column_name. Numeric 
strings "
+        "are IDs.",
+    )
+
+    @field_validator("dataset_id", "column", mode="before")
+    @classmethod
+    def reject_bool_identifiers(cls, value: object) -> object:
+        """bool is a subclass of int, so true would coerce to ID 1."""
+        if isinstance(value, bool):
+            raise ValueError("identifier must be an integer ID or string")
+        return value
+
+
+class DatasetColumnDetail(TableColumnInfo):
+    """Full column details, including identifiers."""
+
+    id: int | None = Field(None, description="Column ID")
+    uuid: str | None = Field(None, description="Column UUID")
+    python_date_format: str | None = Field(
+        None, description="Python date format of a temporal string column"
+    )
+    is_calculated: bool = Field(
+        False, description="Whether the column is calculated (has an 
expression)"
+    )
+
+
+class UpdateDatasetColumnResponse(BaseModel):
+    """Response schema for update_dataset_column."""
+
+    dataset_id: int | None = Field(None, description="Dataset ID")
+    dataset_name: str | None = Field(None, description="Dataset name")
+    column: DatasetColumnDetail | None = Field(
+        None, description="The column after the update. None if the update 
failed."
+    )
+    updated_properties: List[str] = Field(
+        default_factory=list,
+        description="Names of the column properties that were updated.",
+    )
+    url: str | None = Field(
+        None, description="Explore URL for the dataset. None if the update 
failed."
+    )
+    error: str | None = Field(
+        None, description="Error message if the update failed, otherwise null."
+    )
+
+
+class CreateDatasetColumnResponse(BaseModel):
+    """Response schema for create_dataset_column."""
+
+    dataset_id: int | None = Field(None, description="Dataset ID")
+    dataset_name: str | None = Field(None, description="Dataset name")
+    column: DatasetColumnDetail | None = Field(
+        None, description="Created column, or null if creation failed."
+    )
+    url: str | None = Field(None, description="Explore URL for the dataset")
+    error: str | None = Field(None, description="Error message, or null on 
success")
+
+
+class DeleteDatasetColumnResponse(BaseModel):
+    """Response schema for delete_dataset_column."""
+
+    dataset_id: int | None = Field(None, description="Dataset ID")
+    dataset_name: str | None = Field(None, description="Dataset name")
+    column: DatasetColumnDetail | None = Field(
+        None, description="Deleted column, or null if deletion failed."
+    )
+    affected_charts: list[MetricChartReference] = Field(
+        default_factory=list,
+        description="Accessible charts referencing the deleted column by name. 
"
+        "Their definitions are not modified and may need repair.",
+    )
+    error: str | None = Field(None, description="Error message, or null on 
success")
+
+
 class DeleteDatasetRequest(BaseModel):
     """Request schema for delete_dataset."""
 
@@ -1472,6 +1733,14 @@ def _parse_json_field(obj: Any, field_name: str) -> 
Dict[str, Any] | None:
     return value
 
 
+def _calculated_expression(column: Any) -> str | None:
+    """Return a calculated column's SQL expression, or None for physical 
columns."""
+    expression = getattr(column, "expression", None)
+    if isinstance(expression, str) and expression.strip():
+        return expression
+    return None
+
+
 def serialize_dataset_object(dataset: Any) -> DatasetInfo | None:
     if not dataset:
         return None
@@ -1493,6 +1762,7 @@ def serialize_dataset_object(dataset: Any) -> DatasetInfo 
| None:
             groupby=getattr(col, "groupby", None),
             filterable=getattr(col, "filterable", None),
             description=getattr(col, "description", None),
+            expression=_calculated_expression(col),
         )
         for col in getattr(dataset, "columns", [])
     ]
diff --git a/superset/mcp_service/dataset/tool/__init__.py 
b/superset/mcp_service/dataset/tool/__init__.py
index 313f6d121d7..a078a662556 100644
--- a/superset/mcp_service/dataset/tool/__init__.py
+++ b/superset/mcp_service/dataset/tool/__init__.py
@@ -16,27 +16,33 @@
 # under the License.
 
 from .create_dataset import create_dataset
+from .create_dataset_column import create_dataset_column
 from .create_dataset_metric import create_dataset_metric
 from .create_virtual_dataset import create_virtual_dataset
 from .delete_dataset import delete_dataset
+from .delete_dataset_column import delete_dataset_column
 from .delete_dataset_metric import delete_dataset_metric
 from .get_dataset_info import get_dataset_info
 from .list_datasets import list_datasets
 from .query_dataset import query_dataset
 from .restore_dataset import restore_dataset
 from .update_dataset import update_dataset
+from .update_dataset_column import update_dataset_column
 from .update_dataset_metric import update_dataset_metric
 
 __all__ = [
     "create_dataset",
+    "create_dataset_column",
     "create_dataset_metric",
     "create_virtual_dataset",
     "delete_dataset",
+    "delete_dataset_column",
     "delete_dataset_metric",
     "get_dataset_info",
     "list_datasets",
     "query_dataset",
     "restore_dataset",
     "update_dataset",
+    "update_dataset_column",
     "update_dataset_metric",
 ]
diff --git a/superset/mcp_service/dataset/tool/create_dataset_column.py 
b/superset/mcp_service/dataset/tool/create_dataset_column.py
new file mode 100644
index 00000000000..d200dfa36fe
--- /dev/null
+++ b/superset/mcp_service/dataset/tool/create_dataset_column.py
@@ -0,0 +1,188 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Create a calculated column on a dataset (FastMCP tool)."""
+
+from fastmcp import Context
+from superset_core.mcp.decorators import tool, ToolAnnotations
+
+from superset import security_manager
+from superset.extensions import event_logger
+from superset.mcp_service.dataset.schemas import (
+    CreateDatasetColumnRequest,
+    CreateDatasetColumnResponse,
+)
+from superset.mcp_service.dataset.tool.update_dataset_column import (
+    _serialize_column,
+)
+
+
+@tool(
+    tags=["mutate"],
+    class_permission_name="Dataset",
+    method_permission_name="write",
+    annotations=ToolAnnotations(
+        title="Create dataset calculated column",
+        readOnlyHint=False,
+        destructiveHint=False,
+        idempotentHint=False,
+        openWorldHint=False,
+    ),
+)
+async def create_dataset_column(
+    request: CreateDatasetColumnRequest, ctx: Context
+) -> CreateDatasetColumnResponse:
+    """Add a calculated column to a dataset identified by ID or UUID.
+
+    A calculated column is a named, row-level SQL expression stored on the
+    dataset, e.g. CASE WHEN amount > 100 THEN 'large' ELSE 'small' END, that
+    charts can group by and filter on like any other column. The expression
+    is evaluated per row, so it must not aggregate.
+
+    Requires column_name and expression; accepts the same optional properties
+    as update_dataset_column (verbose_name, description, type, is_dttm,
+    groupby, filterable, python_date_format). Existing columns are preserved.
+    Requires dataset editorship (or Admin). Use get_dataset_info to inspect
+    existing column names before creating one.
+
+    Example usage:
+    ```json
+    {
+        "dataset_id": 123,
+        "column_name": "order_size",
+        "expression": "CASE WHEN amount > 100 THEN 'large' ELSE 'small' END",
+        "type": "VARCHAR"
+    }
+    ```
+    """
+    updates = request.updates()
+    await ctx.info("Creating dataset column: dataset_id=%s" % 
(request.dataset_id,))
+
+    try:
+        from sqlalchemy.orm import joinedload, subqueryload
+
+        from superset.commands.dataset.exceptions import (
+            DatasetForbiddenError,
+            DatasetInvalidError,
+            DatasetNotFoundError,
+            DatasetSoftDeletedTwinExistsError,
+            DatasetUpdateFailedError,
+        )
+        from superset.commands.dataset.update import UpdateDatasetCommand
+        from superset.connectors.sqla.models import SqlaTable
+        from superset.exceptions import SupersetSecurityException
+        from superset.mcp_service.dataset.dataset_utils import resolve_dataset
+        from superset.mcp_service.utils.url_utils import get_superset_base_url
+
+        eager_options = [
+            subqueryload(SqlaTable.columns),
+            joinedload(SqlaTable.database),
+        ]
+
+        with 
event_logger.log_context(action="mcp.create_dataset_column.lookup"):
+            dataset = resolve_dataset(request.dataset_id, eager_options)
+
+        if dataset is None:
+            await ctx.warning("Dataset not found: %s" % (request.dataset_id,))
+            return CreateDatasetColumnResponse(
+                error=(
+                    f"No dataset found with identifier: {request.dataset_id}."
+                    " Use list_datasets to get valid dataset IDs."
+                ),
+            )
+
+        # Check editorship before inspecting column names. The command repeats
+        # this check and enforces all dataset update validation on persistence.
+        try:
+            security_manager.raise_for_editorship(dataset)
+        except SupersetSecurityException:
+            await ctx.warning(
+                "Dataset column create forbidden: dataset_id=%s" % 
(dataset.id,)
+            )
+            return CreateDatasetColumnResponse(
+                error="You must be an owner of this dataset (or an Admin) "
+                "to create its columns.",
+            )
+
+        columns = list(dataset.columns)
+        if any(column.column_name == request.column_name for column in 
columns):
+            await ctx.warning("Column already exists: %s" % 
(request.column_name,))
+            return CreateDatasetColumnResponse(
+                dataset_id=dataset.id,
+                dataset_name=dataset.table_name,
+                error=f"Column '{request.column_name}' already exists on this "
+                "dataset. Choose a unique column_name or use 
update_dataset_column.",
+            )
+
+        # Use an additive write: echoing lookup-time columns back could revert
+        # a concurrent rename or delete a column added by another writer.
+        with 
event_logger.log_context(action="mcp.create_dataset_column.create"):
+            updated_dataset = UpdateDatasetCommand(
+                dataset.id,
+                {"columns": [updates]},
+                preserve_existing_columns=True,
+            ).run()
+
+        created_column = next(
+            c for c in updated_dataset.columns if c.column_name == 
request.column_name
+        )
+        await ctx.info(
+            "Dataset column created: dataset_id=%s, column_id=%s"
+            % (updated_dataset.id, created_column.id)
+        )
+        return CreateDatasetColumnResponse(
+            dataset_id=updated_dataset.id,
+            dataset_name=updated_dataset.table_name,
+            column=_serialize_column(created_column),
+            url=(
+                f"{get_superset_base_url()}/explore/"
+                f"?datasource_type=table&datasource_id={updated_dataset.id}"
+            ),
+        )
+
+    except DatasetNotFoundError:
+        await ctx.warning("Dataset not found: %s" % (request.dataset_id,))
+        return CreateDatasetColumnResponse(
+            error=f"No dataset found with identifier: {request.dataset_id}.",
+        )
+    except DatasetForbiddenError:
+        await ctx.warning(
+            "Dataset column create forbidden: dataset_id=%s" % 
(request.dataset_id,)
+        )
+        return CreateDatasetColumnResponse(
+            error="You must be an owner of this dataset (or an Admin) "
+            "to create its columns.",
+        )
+    except DatasetSoftDeletedTwinExistsError as exc:
+        collision_message: str = str(exc)
+        await ctx.warning("Dataset column validation failed: %s" % 
(collision_message,))
+        return CreateDatasetColumnResponse(error=collision_message)
+    except DatasetInvalidError as exc:
+        messages = exc.normalized_messages()
+        await ctx.warning("Dataset column validation failed: %s" % (messages,))
+        return CreateDatasetColumnResponse(error=str(messages))
+    except DatasetUpdateFailedError as exc:
+        await ctx.error("Dataset column create failed: %s" % (str(exc),))
+        return CreateDatasetColumnResponse(
+            error=f"Failed to create column: {exc}",
+        )
+    except Exception as exc:
+        await ctx.error(
+            "Unexpected error creating dataset column: %s: %s"
+            % (type(exc).__name__, str(exc))
+        )
+        raise
diff --git a/superset/mcp_service/dataset/tool/delete_dataset_column.py 
b/superset/mcp_service/dataset/tool/delete_dataset_column.py
new file mode 100644
index 00000000000..6a9b6c61b70
--- /dev/null
+++ b/superset/mcp_service/dataset/tool/delete_dataset_column.py
@@ -0,0 +1,265 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Delete a calculated column on a dataset (FastMCP tool)."""
+
+from typing import Any
+
+from fastmcp import Context
+from superset_core.mcp.decorators import tool, ToolAnnotations
+
+from superset import security_manager
+from superset.extensions import event_logger
+from superset.mcp_service.dataset.schemas import (
+    DeleteDatasetColumnRequest,
+    DeleteDatasetColumnResponse,
+)
+from superset.mcp_service.dataset.tool.delete_dataset_metric import (
+    _find_affected_charts,
+)
+from superset.mcp_service.dataset.tool.update_dataset_column import (
+    _column_not_found_message,
+    _find_column,
+    _is_calculated,
+    _serialize_column,
+)
+from superset.utils import json
+
+# Chart config keys whose value is a column name or a list of column names.
+_COLUMN_KEYS = frozenset(
+    {
+        "all_columns",
+        "all_columns_x",
+        "all_columns_y",
+        "columns",
+        "entity",
+        "granularity_sqla",
+        "groupby",
+        "groupbyColumns",
+        "groupbyRows",
+        "order_by_cols",
+        "series",
+        "series_columns",
+        "x",
+        "x_axis",
+        "y",
+        "column",
+        "groupby_b",
+        "start_time",
+        "end_time",
+        "y_axis",
+        "tooltip_columns",
+        "source",
+        "target",
+        "dimension",
+        "granularity_sqla_b",
+        "latCol",
+        "lonCol",
+        "lonlatCol",
+        "geohashCol",
+    }
+)
+
+
+def _order_by_column(candidate: Any) -> Any:
+    """Return the column of an ``order_by_cols`` entry.
+
+    Entries are JSON strings such as ``'["col", true]'`` (column, ascending).
+    """
+    if isinstance(candidate, str):
+        try:
+            candidate = json.loads(candidate)
+        except (ValueError, RecursionError):
+            return candidate
+    if isinstance(candidate, list) and candidate:
+        return candidate[0]
+    return candidate
+
+
+def _key_matches(key: str, item: Any, column_name: str) -> bool:
+    """Whether a column-valued chart config key names ``column_name``."""
+    candidates = item if isinstance(item, list) else [item]
+    if key == "order_by_cols":
+        candidates = [_order_by_column(c) for c in candidates]
+    return any(candidate == column_name for candidate in candidates)
+
+
+def _references_column(value: Any, column_name: str) -> bool:
+    """Inspect dimension controls, simple filters, and simple adhoc metrics.
+
+    Only references by column name count, not SQL expressions (custom SQL
+    filters, adhoc columns or metrics written as SQL) or arbitrary strings
+    elsewhere in the chart configuration.
+    """
+    if isinstance(value, list):
+        return any(_references_column(item, column_name) for item in value)
+    if not isinstance(value, dict):
+        return False
+    # Simple adhoc filters (form data) and query-context filters.
+    if value.get("expressionType") == "SIMPLE" and value.get("subject") == 
column_name:
+        return True
+    if value.get("col") == column_name:
+        return True
+    # Simple adhoc metrics reference their column as {"column_name": ...}.
+    if value.get("column_name") == column_name:
+        return True
+    for key, item in value.items():
+        if key in _COLUMN_KEYS:
+            if _key_matches(key, item, column_name):
+                return True
+        if _references_column(item, column_name):
+            return True
+    return False
+
+
+@tool(
+    tags=["mutate"],
+    class_permission_name="Dataset",
+    method_permission_name="write",
+    annotations=ToolAnnotations(
+        title="Delete dataset calculated column",
+        readOnlyHint=False,
+        destructiveHint=True,
+        idempotentHint=False,
+        openWorldHint=False,
+    ),
+)
+async def delete_dataset_column(  # noqa: C901
+    request: DeleteDatasetColumnRequest, ctx: Context
+) -> DeleteDatasetColumnResponse:
+    """Delete a calculated column by ID, UUID, or column_name.
+
+    Only calculated columns can be deleted; physical columns mirror the source
+    table and are managed by syncing the dataset. Requires dataset editorship
+    (or Admin). Other columns are preserved. Returns accessible charts that
+    reference the deleted column by name so callers can warn users and repair
+    those charts. Chart definitions are not modified. Inspect the dataset with
+    get_dataset_info before deleting.
+    """
+    await ctx.info("Deleting dataset column: dataset_id=%s" % 
(request.dataset_id,))
+
+    try:
+        from sqlalchemy.orm import joinedload, subqueryload
+
+        from superset.commands.dataset.columns.delete import (
+            DeleteDatasetColumnCommand,
+        )
+        from superset.commands.dataset.columns.exceptions import (
+            DatasetColumnDeleteFailedError,
+            DatasetColumnForbiddenError,
+            DatasetColumnNotFoundError,
+        )
+        from superset.connectors.sqla.models import SqlaTable
+        from superset.exceptions import SupersetSecurityException
+        from superset.mcp_service.dataset.dataset_utils import resolve_dataset
+
+        eager_options = [
+            subqueryload(SqlaTable.columns),
+            joinedload(SqlaTable.database),
+        ]
+
+        with 
event_logger.log_context(action="mcp.delete_dataset_column.lookup"):
+            dataset = resolve_dataset(request.dataset_id, eager_options)
+
+        if dataset is None:
+            await ctx.warning("Dataset not found: %s" % (request.dataset_id,))
+            return DeleteDatasetColumnResponse(
+                error=(
+                    f"No dataset found with identifier: {request.dataset_id}."
+                    " Use list_datasets to get valid dataset IDs."
+                ),
+            )
+
+        # Check editorship before inspecting column names. The command repeats
+        # this check on the column before deleting it.
+        try:
+            security_manager.raise_for_editorship(dataset)
+        except SupersetSecurityException:
+            await ctx.warning(
+                "Dataset column delete forbidden: dataset_id=%s" % 
(dataset.id,)
+            )
+            return DeleteDatasetColumnResponse(
+                error="You must be an owner of this dataset (or an Admin) "
+                "to delete its columns.",
+            )
+
+        columns = list(dataset.columns)
+        target = _find_column(columns, request.column)
+        if target is None:
+            message = _column_not_found_message(columns, request.column)
+            await ctx.warning("Column not found: %s" % (request.column,))
+            return DeleteDatasetColumnResponse(
+                dataset_id=dataset.id,
+                dataset_name=dataset.table_name,
+                error=message,
+            )
+
+        if not _is_calculated(target):
+            await ctx.warning(
+                "Physical column delete rejected: %s" % (target.column_name,)
+            )
+            return DeleteDatasetColumnResponse(
+                dataset_id=dataset.id,
+                dataset_name=dataset.table_name,
+                error=f"'{target.column_name}' is a physical column from the "
+                "source table and cannot be deleted with this tool; only "
+                "calculated columns can.",
+            )
+
+        deleted_column = _serialize_column(target)
+        with 
event_logger.log_context(action="mcp.delete_dataset_column.references"):
+            affected_charts = _find_affected_charts(
+                dataset.id, target.column_name, is_reference=_references_column
+            )
+        with 
event_logger.log_context(action="mcp.delete_dataset_column.delete"):
+            DeleteDatasetColumnCommand(dataset.id, target.id).run()
+
+        await ctx.info(
+            "Dataset column deleted: dataset_id=%s, column_id=%s"
+            % (dataset.id, deleted_column.id)
+        )
+        return DeleteDatasetColumnResponse(
+            dataset_id=dataset.id,
+            dataset_name=dataset.table_name,
+            column=deleted_column,
+            affected_charts=affected_charts,
+        )
+
+    except DatasetColumnNotFoundError:
+        await ctx.warning("Column not found: %s" % (request.column,))
+        return DeleteDatasetColumnResponse(
+            error=f"Column '{request.column}' not found on this dataset.",
+        )
+    except DatasetColumnForbiddenError:
+        await ctx.warning(
+            "Dataset column delete forbidden: dataset_id=%s" % 
(request.dataset_id,)
+        )
+        return DeleteDatasetColumnResponse(
+            error="You must be an owner of this dataset (or an Admin) "
+            "to delete its columns.",
+        )
+    except DatasetColumnDeleteFailedError as exc:
+        await ctx.error("Dataset column delete failed: %s" % (str(exc),))
+        return DeleteDatasetColumnResponse(
+            error=f"Failed to delete column: {exc}",
+        )
+    except Exception as exc:
+        await ctx.error(
+            "Unexpected error deleting dataset column: %s: %s"
+            % (type(exc).__name__, str(exc))
+        )
+        raise
diff --git a/superset/mcp_service/dataset/tool/delete_dataset_metric.py 
b/superset/mcp_service/dataset/tool/delete_dataset_metric.py
index ee921146821..f4561a36e42 100644
--- a/superset/mcp_service/dataset/tool/delete_dataset_metric.py
+++ b/superset/mcp_service/dataset/tool/delete_dataset_metric.py
@@ -17,6 +17,7 @@
 
 """Delete a saved metric on a dataset (FastMCP tool)."""
 
+from collections.abc import Callable
 from typing import Any
 
 from fastmcp import Context
@@ -70,9 +71,16 @@ def _references_metric(value: Any, metric_name: str) -> bool:
 
 
 def _find_affected_charts(
-    dataset_id: int, metric_name: str
+    dataset_id: int,
+    name: str,
+    is_reference: Callable[[Any, str], bool] = _references_metric,
 ) -> list[MetricChartReference]:
-    """Return only accessible charts on this dataset referencing the metric."""
+    """Return accessible charts on this dataset whose config references 
``name``.
+
+    ``is_reference`` decides what counts as a reference; it defaults to saved
+    metric references and is swapped for column references by
+    delete_dataset_column.
+    """
     from superset import db
     from superset.exceptions import SupersetSecurityException
     from superset.models.slice import Slice
@@ -101,7 +109,7 @@ def _find_affected_charts(
             except json.JSONDecodeError:
                 # Chart impact is advisory; still inspect valid form data.
                 pass
-        if _references_metric(configs, metric_name):
+        if is_reference(configs, name):
             references.append(
                 MetricChartReference(
                     id=chart.id,
diff --git a/superset/mcp_service/dataset/tool/update_dataset_column.py 
b/superset/mcp_service/dataset/tool/update_dataset_column.py
new file mode 100644
index 00000000000..b315d766323
--- /dev/null
+++ b/superset/mcp_service/dataset/tool/update_dataset_column.py
@@ -0,0 +1,296 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Update a column on a dataset (FastMCP tool)."""
+
+import difflib
+from typing import Any
+
+from fastmcp import Context
+from superset_core.mcp.decorators import tool, ToolAnnotations
+
+from superset import security_manager
+from superset.extensions import event_logger
+from superset.mcp_service.dataset.schemas import (
+    _calculated_expression,
+    DatasetColumnDetail,
+    PHYSICAL_COLUMN_LOCKED_FIELDS,
+    UpdateDatasetColumnRequest,
+    UpdateDatasetColumnResponse,
+)
+
+
+def _is_calculated(column: Any) -> bool:
+    """A user-defined calculated column, not an expanded nested source 
field."""
+    from superset.connectors.sqla.models import _is_calculated_column
+
+    return _calculated_expression(column) is not None and 
_is_calculated_column(column)
+
+
+def _find_column(columns: list[Any], identifier: int | str) -> Any | None:
+    """Find a dataset column by ID, UUID, or column_name."""
+    if isinstance(identifier, str):
+        try:
+            identifier = int(identifier)
+        except ValueError:
+            pass
+
+    if isinstance(identifier, int):
+        return next((c for c in columns if c.id == identifier), None)
+
+    lowered = identifier.lower()
+    by_uuid = next(
+        (c for c in columns if c.uuid and str(c.uuid).lower() == lowered), None
+    )
+    if by_uuid is not None:
+        return by_uuid
+    return next((c for c in columns if c.column_name == identifier), None)
+
+
+def _column_not_found_message(columns: list[Any], identifier: int | str) -> 
str:
+    """Build a "column not found" error while preserving supplied text."""
+    names = [c.column_name for c in columns]
+    msg = f"Column '{identifier}' not found on this dataset."
+    if not names:
+        return f"{msg} This dataset has no columns."
+    suggestions = difflib.get_close_matches(str(identifier), names, n=3, 
cutoff=0.6)
+    if suggestions:
+        return f"{msg} Did you mean: {', '.join(suggestions)}?"
+    return f"{msg} Available columns: {', '.join(sorted(names))}."
+
+
+def _serialize_column(column: Any) -> DatasetColumnDetail:
+    """Build a ``DatasetColumnDetail`` from a ``TableColumn`` model."""
+    return DatasetColumnDetail(
+        id=getattr(column, "id", None),
+        uuid=str(column.uuid) if getattr(column, "uuid", None) else None,
+        column_name=column.column_name or "",
+        verbose_name=getattr(column, "verbose_name", None),
+        type=getattr(column, "type", None),
+        is_dttm=getattr(column, "is_dttm", None),
+        groupby=getattr(column, "groupby", None),
+        filterable=getattr(column, "filterable", None),
+        description=getattr(column, "description", None),
+        expression=_calculated_expression(column),
+        python_date_format=getattr(column, "python_date_format", None),
+        is_calculated=_is_calculated(column),
+    )
+
+
+@tool(
+    tags=["mutate"],
+    class_permission_name="Dataset",
+    method_permission_name="write",
+    annotations=ToolAnnotations(
+        title="Update dataset column",
+        readOnlyHint=False,
+        # Overwrites an existing column's definition and affects every chart
+        # that uses it, like update_dataset_metric.
+        destructiveHint=True,
+        idempotentHint=False,
+        openWorldHint=False,
+    ),
+)
+async def update_dataset_column(  # noqa: C901
+    request: UpdateDatasetColumnRequest, ctx: Context
+) -> UpdateDatasetColumnResponse:
+    """Update a column on a dataset.
+
+    Edits a calculated column (a named SQL expression stored on the dataset,
+    e.g. CASE WHEN amount > 100 THEN 'large' ELSE 'small' END) or the
+    display/behaviour settings of any column: verbose_name, description, type,
+    is_dttm, groupby, filterable, python_date_format. Changes apply to every
+    chart that uses the column.
+
+    Only calculated columns can change column_name or expression; physical
+    columns mirror the source table, so renaming them or giving them an
+    expression would break them. Only the properties you pass are changed;
+    everything else on the column, and all other columns, is left untouched.
+    Use create_dataset_column / delete_dataset_column to add or remove
+    calculated columns. Requires ownership of the dataset (or Admin).
+
+    Workflow:
+    1. Call get_dataset_info with column_fields including 'expression' to
+       inspect the dataset's columns
+    2. Call this tool with the dataset ID, the column identifier, and only
+       the properties to change
+
+    Example usage:
+    ```json
+    {
+        "dataset_id": 123,
+        "column": "order_size",
+        "expression": "CASE WHEN amount > 500 THEN 'large' ELSE 'small' END",
+        "verbose_name": "Order size"
+    }
+    ```
+    """
+    updates = request.updates()
+    await ctx.info(
+        "Updating dataset column: dataset_id=%s, column=%r, properties=%s"
+        % (request.dataset_id, request.column, sorted(updates))
+    )
+
+    try:
+        from sqlalchemy.orm import joinedload, subqueryload
+
+        from superset.commands.dataset.exceptions import (
+            DatasetForbiddenError,
+            DatasetInvalidError,
+            DatasetNotFoundError,
+            DatasetSoftDeletedTwinExistsError,
+            DatasetUpdateFailedError,
+        )
+        from superset.commands.dataset.update import UpdateDatasetCommand
+        from superset.connectors.sqla.models import SqlaTable
+        from superset.exceptions import SupersetSecurityException
+        from superset.mcp_service.dataset.dataset_utils import resolve_dataset
+        from superset.mcp_service.utils.url_utils import get_superset_base_url
+
+        eager_options = [
+            subqueryload(SqlaTable.columns),
+            joinedload(SqlaTable.database),
+        ]
+
+        with 
event_logger.log_context(action="mcp.update_dataset_column.lookup"):
+            dataset = resolve_dataset(request.dataset_id, eager_options)
+
+        if dataset is None:
+            await ctx.warning("Dataset not found: %s" % (request.dataset_id,))
+            return UpdateDatasetColumnResponse(
+                error=(
+                    f"No dataset found with identifier: {request.dataset_id}."
+                    " Use list_datasets to get valid dataset IDs."
+                ),
+            )
+
+        # Enforce editorship before touching the column list, so a caller who
+        # cannot edit the dataset cannot probe column names through the
+        # not-found suggestions.
+        try:
+            security_manager.raise_for_editorship(dataset)
+        except SupersetSecurityException:
+            await ctx.warning(
+                "Dataset column update forbidden: dataset_id=%s" % 
(dataset.id,)
+            )
+            return UpdateDatasetColumnResponse(
+                error="You must be an owner of this dataset (or an Admin) "
+                "to update its columns.",
+            )
+
+        columns = list(dataset.columns)
+        target = _find_column(columns, request.column)
+        if target is None:
+            message = _column_not_found_message(columns, request.column)
+            await ctx.warning("Column not found: %s" % (request.column,))
+            return UpdateDatasetColumnResponse(
+                dataset_id=dataset.id,
+                dataset_name=dataset.table_name,
+                error=message,
+            )
+
+        if not _is_calculated(target) and (
+            locked := PHYSICAL_COLUMN_LOCKED_FIELDS & set(updates)
+        ):
+            await ctx.warning(
+                "Physical column property change rejected: %s" % 
(sorted(locked),)
+            )
+            return UpdateDatasetColumnResponse(
+                dataset_id=dataset.id,
+                dataset_name=dataset.table_name,
+                error=f"'{target.column_name}' is a physical column from the "
+                f"source table, so {' and '.join(sorted(locked))} cannot be "
+                "changed. Use create_dataset_column to add a calculated column 
"
+                "instead.",
+            )
+
+        new_name = updates.get("column_name")
+        if new_name is not None and any(
+            c.column_name == new_name and c.id != target.id for c in columns
+        ):
+            await ctx.warning("Column name already exists: %s" % (new_name,))
+            return UpdateDatasetColumnResponse(
+                dataset_id=dataset.id,
+                dataset_name=dataset.table_name,
+                error=f"Column '{new_name}' already exists on this dataset. "
+                "Choose a unique column_name.",
+            )
+
+        # Send only the target column: preserve_existing_columns keeps every
+        # other column as stored when the command runs, including changes made
+        # by other writers since the lookup above. The command enforces dataset
+        # ownership and validates name uniqueness, the SQL expression, and the
+        # date format.
+        with 
event_logger.log_context(action="mcp.update_dataset_column.update"):
+            updated_dataset = UpdateDatasetCommand(
+                dataset.id,
+                {"columns": [{"id": target.id, **updates}]},
+                preserve_existing_columns=True,
+            ).run()
+
+        updated_column = next(
+            (c for c in updated_dataset.columns if c.id == target.id), None
+        )
+
+        await ctx.info(
+            "Dataset column updated: dataset_id=%s, column_id=%s, 
properties=%s"
+            % (updated_dataset.id, target.id, sorted(updates))
+        )
+
+        return UpdateDatasetColumnResponse(
+            dataset_id=updated_dataset.id,
+            dataset_name=updated_dataset.table_name,
+            column=_serialize_column(updated_column) if updated_column else 
None,
+            updated_properties=sorted(updates),
+            url=(
+                f"{get_superset_base_url()}/explore/"
+                f"?datasource_type=table&datasource_id={updated_dataset.id}"
+            ),
+        )
+
+    except DatasetNotFoundError:
+        await ctx.warning("Dataset not found: %s" % (request.dataset_id,))
+        return UpdateDatasetColumnResponse(
+            error=f"No dataset found with identifier: {request.dataset_id}.",
+        )
+    except DatasetForbiddenError:
+        await ctx.warning(
+            "Dataset column update forbidden: dataset_id=%s" % 
(request.dataset_id,)
+        )
+        return UpdateDatasetColumnResponse(
+            error="You must be an owner of this dataset (or an Admin) "
+            "to update its columns.",
+        )
+    except DatasetSoftDeletedTwinExistsError as exc:
+        collision_message: str = str(exc)
+        await ctx.warning("Dataset column validation failed: %s" % 
(collision_message,))
+        return UpdateDatasetColumnResponse(error=collision_message)
+    except DatasetInvalidError as exc:
+        messages = exc.normalized_messages()
+        await ctx.warning("Dataset column validation failed: %s" % (messages,))
+        return UpdateDatasetColumnResponse(error=str(messages))
+    except DatasetUpdateFailedError as exc:
+        await ctx.error("Dataset column update failed: %s" % (str(exc),))
+        return UpdateDatasetColumnResponse(
+            error=f"Failed to update column: {exc}",
+        )
+    except Exception as exc:
+        await ctx.error(
+            "Unexpected error updating dataset column: %s: %s"
+            % (type(exc).__name__, str(exc))
+        )
+        raise
diff --git a/superset/mcp_service/mcp_config.py 
b/superset/mcp_service/mcp_config.py
index bbb1467b8f2..beb39f84d78 100644
--- a/superset/mcp_service/mcp_config.py
+++ b/superset/mcp_service/mcp_config.py
@@ -424,12 +424,14 @@ MCP_CACHE_CONFIG: dict[str, Any] = {
         "add_chart_to_existing_dashboard",
         "apply_dashboard_filters",
         "create_dataset",
+        "create_dataset_column",
         "create_dataset_metric",
         "create_theme",
         "create_virtual_dataset",
         "delete_chart",
         "delete_dashboard",
         "delete_dataset",
+        "delete_dataset_column",
         "delete_dataset_metric",
         "duplicate_dashboard",
         "execute_sql",
@@ -450,6 +452,7 @@ MCP_CACHE_CONFIG: dict[str, Any] = {
         "update_chart_preview",
         "update_dashboard",
         "update_dataset",
+        "update_dataset_column",
         "update_dataset_metric",
     ],
 }
diff --git a/superset/mcp_service/utils/response_size_utils.py 
b/superset/mcp_service/utils/response_size_utils.py
index d8da286e393..cafa2bb64c2 100644
--- a/superset/mcp_service/utils/response_size_utils.py
+++ b/superset/mcp_service/utils/response_size_utils.py
@@ -653,12 +653,14 @@ COMMITTED_WRITE_SPECS: Dict[str, CommittedWriteSpec] = {
     "add_chart_to_existing_dashboard": _spec("dashboard", "dashboard"),
     "apply_dashboard_filters": _spec("dashboard"),
     "create_dataset": _spec("dataset"),
+    "create_dataset_column": _spec("dataset", "column"),
     "create_dataset_metric": _spec("dataset", "metric"),
     "create_theme": _spec("theme", reports_success=True),
     "create_virtual_dataset": _spec("dataset"),
     "delete_chart": _spec("chart", reports_success=True),
     "delete_dashboard": _spec("dashboard", reports_success=True),
     "delete_dataset": _spec("dataset", reports_success=True),
+    "delete_dataset_column": _spec("dataset", "column"),
     "delete_dataset_metric": _spec("dataset", "metric"),
     "duplicate_dashboard": _spec("dashboard", "dashboard"),
     "generate_chart": _spec("chart", "chart", reports_success=True),
@@ -676,6 +678,7 @@ COMMITTED_WRITE_SPECS: Dict[str, CommittedWriteSpec] = {
     "update_chart": _spec("chart", "chart", reports_success=True),
     "update_dashboard": _spec("dashboard", "dashboard"),
     "update_dataset": _spec("dataset", "updated_properties"),
+    "update_dataset_column": _spec("dataset", "column"),
     "update_dataset_metric": _spec("dataset", "metric"),
 }
 
diff --git 
a/tests/unit_tests/mcp_service/dataset/tool/test_dataset_column_mutations.py 
b/tests/unit_tests/mcp_service/dataset/tool/test_dataset_column_mutations.py
new file mode 100644
index 00000000000..61db465e129
--- /dev/null
+++ b/tests/unit_tests/mcp_service/dataset/tool/test_dataset_column_mutations.py
@@ -0,0 +1,654 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Calculated column tools exercised through MCP and the dataset commands."""
+
+from collections.abc import Iterator
+from typing import Any
+from unittest.mock import MagicMock, patch, PropertyMock
+
+import pytest
+from fastmcp import Client
+from pydantic import ValidationError
+from sqlalchemy import create_engine
+from sqlalchemy.engine import Engine
+from sqlalchemy.orm import Session
+from sqlalchemy.pool import StaticPool
+
+from superset.commands.dataset.columns.exceptions import (
+    DatasetColumnDeleteFailedError,
+    DatasetColumnForbiddenError,
+    DatasetColumnNotFoundError,
+)
+from superset.commands.dataset.exceptions import (
+    DatasetColumnsDuplicateValidationError,
+    DatasetForbiddenError,
+    DatasetInvalidError,
+    DatasetNotFoundError,
+    DatasetSoftDeletedTwinExistsError,
+    DatasetUpdateFailedError,
+)
+from superset.connectors.sqla.models import SqlaTable, TableColumn
+from superset.exceptions import SupersetSecurityException
+from superset.mcp_service.app import mcp
+from superset.mcp_service.dataset.schemas import (
+    CreateDatasetColumnRequest,
+    DeleteDatasetColumnRequest,
+    UpdateDatasetColumnRequest,
+)
+from superset.mcp_service.dataset.tool.delete_dataset_column import (
+    _order_by_column,
+    _references_column,
+)
+from superset.models.core import Database
+from superset.utils import json
+
+CREATE, UPDATE, DELETE = (
+    "create_dataset_column",
+    "update_dataset_column",
+    "delete_dataset_column",
+)
+TOOLS = [CREATE, UPDATE, DELETE]
+UUID = "a1b2c3d4-5678-90ab-cdef-1234567890ab"
+UPDATE_COMMAND = "superset.commands.dataset.update.UpdateDatasetCommand"
+DELETE_COMMAND = 
"superset.commands.dataset.columns.delete.DeleteDatasetColumnCommand"
+REFERENCES = (
+    
"superset.mcp_service.dataset.tool.delete_dataset_column._find_affected_charts"
+)
+
+
[email protected]
+def session_engine() -> Engine:
+    """Let the tool worker thread use the ``session`` built by this test."""
+    return create_engine(
+        "sqlite://", connect_args={"check_same_thread": False}, 
poolclass=StaticPool
+    )
+
+
[email protected](autouse=True)
+def mock_auth() -> Iterator[None]:
+    """Authenticate an MCP caller without testing authentication itself."""
+    with patch("superset.mcp_service.auth.get_user_from_request") as get_user:
+        get_user.return_value = MagicMock(id=1, username="admin")
+        yield
+
+
[email protected](autouse=True)
+def editorship() -> Iterator[MagicMock]:
+    """Permit editorship except in tests explicitly denying it."""
+    with patch(
+        "superset.security.SupersetSecurityManager.raise_for_editorship"
+    ) as check:
+        yield check
+
+
[email protected]
+def dataset() -> MagicMock:
+    """A dataset with one physical and one calculated column."""
+    dataset = MagicMock(id=1, table_name="sales")
+    dataset.columns = [
+        TableColumn(id=20, column_name="amount", type="DOUBLE"),
+        TableColumn(
+            id=21,
+            column_name="order_size",
+            expression="CASE WHEN amount > 100 THEN 'large' ELSE 'small' END",
+            type="VARCHAR",
+            uuid=UUID,
+        ),
+    ]
+    return dataset
+
+
[email protected]
+def references() -> Iterator[MagicMock]:
+    """Avoid database access in tool orchestration tests."""
+    with patch(REFERENCES, return_value=[]) as lookup:
+        yield lookup
+
+
+def request_for(tool: str) -> dict[str, Any]:
+    """Build a minimal valid request for each tool."""
+    if tool == CREATE:
+        return {
+            "dataset_id": 1,
+            "column_name": "double_amount",
+            "expression": "amount * 2",
+        }
+    if tool == UPDATE:
+        return {"dataset_id": 1, "column": "order_size", "verbose_name": 
"Size"}
+    return {"dataset_id": 1, "column": "order_size"}
+
+
+async def call(tool: str, request: dict[str, Any]) -> dict[str, Any]:
+    """Call the registered tool through MCP and decode its response."""
+    async with Client(mcp) as client:
+        result = await client.call_tool(tool, {"request": request})
+        return json.loads(result.content[0].text)
+
+
[email protected]("field", ["column_name", "expression"])
[email protected]("value", [None, "", "   "])
+def test_create_rejects_blank_required_properties(field: str, value: Any) -> 
None:
+    """Names and SQL expressions cannot be null, empty, or whitespace."""
+    request = {**request_for(CREATE), field: value}
+    with pytest.raises(ValidationError):
+        CreateDatasetColumnRequest.model_validate(request)
+
+
[email protected]("field", ["column_name", "expression"])
+def test_create_requires_properties(field: str) -> None:
+    """Both name and expression are mandatory."""
+    request = request_for(CREATE)
+    del request[field]
+    with pytest.raises(ValidationError):
+        CreateDatasetColumnRequest.model_validate(request)
+
+
+def test_rejects_invalid_python_date_format() -> None:
+    """Date formats are checked before the request reaches the command."""
+    with pytest.raises(ValidationError, match="python_date_format"):
+        CreateDatasetColumnRequest.model_validate(
+            {**request_for(CREATE), "python_date_format": "not a format"}
+        )
+    request = CreateDatasetColumnRequest.model_validate(
+        {**request_for(CREATE), "python_date_format": "epoch_ms"}
+    )
+    assert request.python_date_format == "epoch_ms"
+
+
+def test_update_requires_a_property() -> None:
+    """An update with nothing to change is rejected."""
+    with pytest.raises(ValidationError, match="At least one column property"):
+        UpdateDatasetColumnRequest.model_validate({"dataset_id": 1, "column": 
21})
+
+
+def test_update_rejects_clearing_expression() -> None:
+    """Clearing an expression is a delete, not an update."""
+    with pytest.raises(ValidationError, match="delete_dataset_column"):
+        UpdateDatasetColumnRequest.model_validate(
+            {"dataset_id": 1, "column": 21, "expression": None}
+        )
+
+
[email protected]
[email protected]("identifier", [1, "1", UUID])
+async def test_create_success(dataset: MagicMock, identifier: int | str) -> 
None:
+    """Optional properties pass through as one additive column write."""
+    request = {
+        **request_for(CREATE),
+        "dataset_id": identifier,
+        "verbose_name": "Double amount",
+        "description": "Exact <UNTRUSTED-CONTENT> text",
+        "type": "DOUBLE",
+        "is_dttm": False,
+        "groupby": True,
+        "filterable": False,
+    }
+    properties = {key: value for key, value in request.items() if key != 
"dataset_id"}
+    created = TableColumn(id=22, uuid=UUID, **properties)
+    updated = MagicMock(id=1, table_name="sales", columns=[*dataset.columns, 
created])
+    with (
+        patch(
+            "superset.daos.dataset.DatasetDAO.find_by_id", return_value=dataset
+        ) as find,
+        patch(UPDATE_COMMAND) as command,
+    ):
+        command.return_value.run.return_value = updated
+        result = await call(CREATE, request)
+    assert find.call_args.args == (1 if identifier != UUID else UUID,)
+    command.assert_called_once_with(
+        1, {"columns": [properties]}, preserve_existing_columns=True
+    )
+    assert result["error"] is None
+    assert result["column"]["id"] == 22
+    assert result["column"]["expression"] == "amount * 2"
+    assert result["column"]["is_calculated"] is True
+    assert result["column"]["filterable"] is False
+    assert "datasource_id=1" in result["url"]
+
+
[email protected]
+async def test_create_duplicate(dataset: MagicMock) -> None:
+    """Duplicate names produce actionable errors without invoking 
persistence."""
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=dataset),
+        patch(UPDATE_COMMAND) as command,
+    ):
+        result = await call(CREATE, {**request_for(CREATE), "column_name": 
"amount"})
+    command.assert_not_called()
+    assert result["column"] is None
+    assert "'amount' already exists" in result["error"]
+
+
[email protected]
[email protected]("identifier", [21, "21", UUID.upper(), "order_size"])
+async def test_update_success(dataset: MagicMock, identifier: int | str) -> 
None:
+    """Only the target column, with only the requested changes, is sent."""
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=dataset),
+        patch(UPDATE_COMMAND) as command,
+    ):
+        command.return_value.run.return_value = dataset
+        result = await call(
+            UPDATE,
+            {
+                "dataset_id": 1,
+                "column": identifier,
+                "column_name": "size_bucket",
+                "expression": "CASE WHEN amount > 500 THEN 'large' END",
+            },
+        )
+    command.assert_called_once_with(
+        1,
+        {
+            "columns": [
+                {
+                    "id": 21,
+                    "column_name": "size_bucket",
+                    "expression": "CASE WHEN amount > 500 THEN 'large' END",
+                }
+            ]
+        },
+        preserve_existing_columns=True,
+    )
+    assert result["error"] is None
+    assert result["updated_properties"] == ["column_name", "expression"]
+    assert result["column"]["id"] == 21
+
+
[email protected]
+async def test_update_physical_column_display_properties(dataset: MagicMock) 
-> None:
+    """Physical columns accept label and behaviour changes."""
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=dataset),
+        patch(UPDATE_COMMAND) as command,
+    ):
+        command.return_value.run.return_value = dataset
+        result = await call(
+            UPDATE,
+            {"dataset_id": 1, "column": "amount", "verbose_name": "Amount 
($)"},
+        )
+    command.assert_called_once()
+    assert result["error"] is None
+    assert result["column"]["is_calculated"] is False
+
+
[email protected]
[email protected](
+    "change", [{"column_name": "amt"}, {"expression": "amount / 100"}]
+)
+async def test_update_rejects_physical_identity_changes(
+    dataset: MagicMock, change: dict[str, str]
+) -> None:
+    """Renaming a physical column or giving it an expression would break it."""
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=dataset),
+        patch(UPDATE_COMMAND) as command,
+    ):
+        result = await call(UPDATE, {"dataset_id": 1, "column": "amount", 
**change})
+    command.assert_not_called()
+    assert "physical column" in result["error"]
+
+
[email protected]
+async def test_update_rename_collision(dataset: MagicMock) -> None:
+    """Renaming onto another column's name is refused up front."""
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=dataset),
+        patch(UPDATE_COMMAND) as command,
+    ):
+        result = await call(
+            UPDATE,
+            {"dataset_id": 1, "column": "order_size", "column_name": "amount"},
+        )
+    command.assert_not_called()
+    assert "'amount' already exists" in result["error"]
+
+
[email protected]
[email protected]("tool", [UPDATE, DELETE])
[email protected]("empty", [False, True])
+async def test_unknown_column(tool: str, dataset: MagicMock, empty: bool) -> 
None:
+    """Reuse did-you-mean guidance, including the empty dataset case."""
+    if empty:
+        dataset.columns = []
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=dataset),
+        patch(UPDATE_COMMAND) as update,
+        patch(DELETE_COMMAND) as delete,
+    ):
+        result = await call(tool, {**request_for(tool), "column": "order_siz"})
+    update.assert_not_called()
+    delete.assert_not_called()
+    assert result["column"] is None
+    assert ("no columns" if empty else "Did you mean: order_size?") in 
result["error"]
+
+
[email protected]
[email protected]("identifier", [21, UUID, "order_size"])
+async def test_delete_success(
+    dataset: MagicMock, references: MagicMock, identifier: int | str
+) -> None:
+    """Delete only the target column and report referencing charts."""
+    references.return_value = [{"id": 5, "uuid": UUID, "slice_name": "Sizes"}]
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=dataset),
+        patch(DELETE_COMMAND) as command,
+    ):
+        result = await call(DELETE, {"dataset_id": 1, "column": identifier})
+    command.assert_called_once_with(1, 21)
+    command.return_value.run.assert_called_once_with()
+    assert references.call_args.args == (1, "order_size")
+    assert references.call_args.kwargs["is_reference"] is _references_column
+    assert result["error"] is None
+    assert result["column"]["column_name"] == "order_size"
+    assert result["affected_charts"] == references.return_value
+
+
[email protected]
+async def test_delete_rejects_expanded_nested_field(
+    dataset: MagicMock, references: MagicMock
+) -> None:
+    """An expanded nested field carries an expression but is still physical."""
+    dataset.columns.append(
+        TableColumn(
+            id=22,
+            column_name="meta.uuid",
+            expression='"meta"."uuid"',
+            type="VARCHAR",
+        )
+    )
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=dataset),
+        patch(DELETE_COMMAND) as command,
+    ):
+        result = await call(DELETE, {"dataset_id": 1, "column": "meta.uuid"})
+    command.assert_not_called()
+    assert "physical column" in result["error"]
+
+
[email protected]
+async def test_delete_rejects_physical_column(
+    dataset: MagicMock, references: MagicMock
+) -> None:
+    """Physical columns are managed by syncing the dataset, not deleted 
here."""
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=dataset),
+        patch(DELETE_COMMAND) as command,
+    ):
+        result = await call(DELETE, {"dataset_id": 1, "column": "amount"})
+    command.assert_not_called()
+    references.assert_not_called()
+    assert "physical column" in result["error"]
+
+
[email protected]
[email protected]("tool", TOOLS)
+async def test_unknown_dataset(tool: str) -> None:
+    """An unknown dataset yields a clear error and no writes."""
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=None),
+        patch(UPDATE_COMMAND) as update,
+        patch(DELETE_COMMAND) as delete,
+    ):
+        result = await call(tool, request_for(tool))
+    update.assert_not_called()
+    delete.assert_not_called()
+    assert "No dataset found" in result["error"]
+    assert result["column"] is None
+
+
[email protected]
[email protected]("tool", TOOLS)
+async def test_non_editor_cannot_inspect_columns(
+    tool: str, dataset: MagicMock, editorship: MagicMock
+) -> None:
+    """Deny before duplicate checks, name suggestions, or chart inspection."""
+    editorship.side_effect = 
SupersetSecurityException(MagicMock(message="denied"))
+    type(dataset).columns = PropertyMock(side_effect=AssertionError("columns 
read"))
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=dataset),
+        patch(UPDATE_COMMAND) as update,
+        patch(DELETE_COMMAND) as delete,
+    ):
+        result = await call(tool, request_for(tool))
+    update.assert_not_called()
+    delete.assert_not_called()
+    assert "owner" in result["error"]
+    assert "order_size" not in result["error"]
+
+
[email protected]
[email protected]("tool", [CREATE, UPDATE])
[email protected](
+    "exception, message",
+    [
+        (DatasetNotFoundError(), "No dataset found"),
+        (DatasetForbiddenError(), "owner"),
+        (DatasetUpdateFailedError(), "Failed to"),
+        (DatasetSoftDeletedTwinExistsError(UUID), 
f"/api/v1/dataset/{UUID}/restore"),
+        (
+            
DatasetInvalidError(exceptions=[DatasetColumnsDuplicateValidationError()]),
+            "duplicate",
+        ),
+    ],
+)
+async def test_update_command_errors(
+    tool: str, exception: Exception, message: str, dataset: MagicMock
+) -> None:
+    """Surface the dataset update command's validation and failures."""
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=dataset),
+        patch(UPDATE_COMMAND) as command,
+    ):
+        command.return_value.run.side_effect = exception
+        result = await call(tool, request_for(tool))
+    assert result["column"] is None
+    assert message in result["error"]
+
+
[email protected]
[email protected](
+    "exception, message",
+    [
+        (DatasetColumnNotFoundError(), "not found"),
+        (DatasetColumnForbiddenError(), "owner"),
+        (DatasetColumnDeleteFailedError(), "Failed to delete column"),
+    ],
+)
+async def test_delete_command_errors(
+    exception: Exception, message: str, dataset: MagicMock, references: 
MagicMock
+) -> None:
+    """Surface the column delete command's failures."""
+    with (
+        patch("superset.daos.dataset.DatasetDAO.find_by_id", 
return_value=dataset),
+        patch(DELETE_COMMAND) as command,
+    ):
+        command.return_value.run.side_effect = exception
+        result = await call(DELETE, request_for(DELETE))
+    assert result["column"] is None
+    assert message in result["error"]
+    assert not result.get("affected_charts")
+
+
[email protected](
+    "config, expected",
+    [
+        ({"groupby": ["region", "order_size"]}, True),
+        ({"columns": ["order_size"]}, True),
+        ({"x_axis": "order_size"}, True),
+        ({"granularity_sqla": "order_size"}, True),
+        ({"all_columns": ["order_size"]}, True),
+        ({"series": "order_size"}, True),
+        (
+            {"adhoc_filters": [{"expressionType": "SIMPLE", "subject": 
"order_size"}]},
+            True,
+        ),
+        ({"queries": [{"filters": [{"col": "order_size", "op": "=="}]}]}, 
True),
+        ({"queries": [{"columns": ["order_size"]}]}, True),
+        ({"metrics": [{"column": {"column_name": "order_size"}}]}, True),
+        (
+            {"adhoc_filters": [{"expressionType": "SQL", "subject": 
"order_size"}]},
+            False,
+        ),
+        ({"metrics": ["order_size"], "slice_name": "order_size"}, False),
+        ({"groupby": ["order_size_v2"]}, False),
+        ({"groupby_b": ["order_size"]}, True),
+        ({"column": "order_size"}, True),
+        ({"start_time": "order_size"}, True),
+        ({"end_time": "order_size"}, True),
+        ({"y_axis": "order_size"}, True),
+        ({"tooltip_columns": ["order_size"]}, True),
+        ({"source": "order_size", "target": "other"}, True),
+        ({"dimension": "order_size"}, True),
+        ({"granularity_sqla_b": "order_size"}, True),
+        ({"spatial": {"latCol": "order_size", "lonCol": "lon"}}, True),
+        ({"order_by_cols": ['["order_size", true]']}, True),
+        ({"order_by_cols": ['["order_size_v2", false]']}, False),
+        ({}, False),
+    ],
+)
+def test_column_references(config: dict[str, Any], expected: bool) -> None:
+    """Detect references by column name, not names elsewhere in the config."""
+    assert _references_column(config, "order_size") is expected
+
+
+def _make_dataset(session: Session, name: str) -> tuple[SqlaTable, 
TableColumn]:
+    """Persist a dataset with one physical column."""
+    Database.metadata.create_all(session.bind)
+    database = Database(database_name=name, sqlalchemy_uri="sqlite://")
+    physical = TableColumn(column_name="amount", type="DOUBLE")
+    dataset = SqlaTable(database=database, table_name=name, columns=[physical])
+    session.add(dataset)
+    session.commit()
+    return dataset, physical
+
+
[email protected]
+async def test_real_commands_create_update_delete(session: Session) -> None:
+    """Persist a calculated column, edit it, and delete it via the real 
commands."""
+    from superset.daos.dataset import DatasetDAO
+
+    dataset, physical = _make_dataset(session, "column_mutations")
+    dataset_id, physical_id = dataset.id, physical.id
+    with (
+        patch.object(DatasetDAO, "base_filter", None),
+        patch("superset.security.SupersetSecurityManager.is_admin", 
return_value=True),
+        patch(REFERENCES, return_value=[]),
+    ):
+        created = await call(CREATE, {**request_for(CREATE), "dataset_id": 
dataset_id})
+        assert created["error"] is None
+        column_id = created["column"]["id"]
+        assert created["column"]["uuid"]
+        session.expire_all()
+        assert session.get(TableColumn, column_id).expression == "amount * 2"
+
+        updated = await call(
+            UPDATE,
+            {
+                "dataset_id": dataset_id,
+                "column": column_id,
+                "expression": "amount * 3",
+                "verbose_name": "Triple",
+            },
+        )
+        assert updated["error"] is None
+        session.expire_all()
+        stored = session.get(TableColumn, column_id)
+        assert (stored.expression, stored.verbose_name) == ("amount * 3", 
"Triple")
+        assert stored.column_name == "double_amount"
+
+        deleted = await call(DELETE, {"dataset_id": dataset_id, "column": 
column_id})
+        assert deleted["error"] is None
+        session.expire_all()
+        assert session.get(TableColumn, column_id) is None
+        assert session.get(TableColumn, physical_id) is not None
+
+
[email protected]
[email protected]("tool", [CREATE, UPDATE])
+async def test_writes_preserve_column_changes_after_lookup(
+    session: Session, tool: str
+) -> None:
+    """A concurrent addition and rename must survive the column write."""
+    from superset.daos.dataset import DatasetDAO
+
+    dataset, physical = _make_dataset(session, f"concurrent_{tool}")
+    target = TableColumn(column_name="order_size", expression="amount > 100")
+    dataset.columns.append(target)
+    session.commit()
+    dataset_id, physical_id = dataset.id, physical.id
+    find_by_id = DatasetDAO.find_by_id
+    lookup_count = 0
+    added = TableColumn(column_name="concurrent", expression="amount + 1")
+
+    def find_with_concurrent_change(*args: Any, **kwargs: Any) -> SqlaTable | 
None:
+        """Commit another writer's changes between tool lookup and 
validation."""
+        nonlocal lookup_count
+        lookup_count += 1
+        if lookup_count == 2:
+            physical.verbose_name = "changed elsewhere"
+            dataset.columns.append(added)
+            session.commit()
+        return find_by_id(*args, **kwargs)
+
+    request = (
+        {**request_for(CREATE), "dataset_id": dataset_id}
+        if tool == CREATE
+        else {"dataset_id": dataset_id, "column": "order_size", 
"verbose_name": "Size"}
+    )
+    with (
+        patch.object(DatasetDAO, "base_filter", None),
+        patch.object(DatasetDAO, "find_by_id", 
side_effect=find_with_concurrent_change),
+        patch("superset.security.SupersetSecurityManager.is_admin", 
return_value=True),
+    ):
+        result = await call(tool, request)
+    assert result["error"] is None
+    session.expire_all()
+    assert session.get(TableColumn, physical_id).verbose_name == "changed 
elsewhere"
+    names = {
+        column.column_name for column in session.get(SqlaTable, 
dataset_id).columns
+    }
+    expected = {"amount", "order_size", "concurrent"}
+    assert names == (expected | {"double_amount"} if tool == CREATE else 
expected)
+
+
[email protected](
+    "model, payload",
+    [
+        (UpdateDatasetColumnRequest, {"dataset_id": True, "column": 1, "type": 
"INT"}),
+        (UpdateDatasetColumnRequest, {"dataset_id": 1, "column": True, "type": 
"INT"}),
+        (DeleteDatasetColumnRequest, {"dataset_id": True, "column": 1}),
+        (DeleteDatasetColumnRequest, {"dataset_id": 1, "column": True}),
+    ],
+)
+def test_boolean_identifiers_rejected(model, payload):
+    with pytest.raises(ValidationError):
+        model.model_validate(payload)
+
+
[email protected]("flag", ["groupby", "filterable"])
+def test_null_flags_rejected(flag):
+    with pytest.raises(ValidationError):
+        UpdateDatasetColumnRequest.model_validate(
+            {"dataset_id": 1, "column": 1, flag: None}
+        )
+
+
+def test_order_by_column_survives_deeply_nested_json():
+    nested = "[" * 100000 + "]" * 100000
+    assert _order_by_column(nested) == nested
diff --git a/tests/unit_tests/mcp_service/native_tool_inventory.json 
b/tests/unit_tests/mcp_service/native_tool_inventory.json
index f0a6b3a5f13..3c8019a49bc 100644
--- a/tests/unit_tests/mcp_service/native_tool_inventory.json
+++ b/tests/unit_tests/mcp_service/native_tool_inventory.json
@@ -42,11 +42,27 @@
       "compact_description_chars": 256,
       "description_chars": 1145,
       "entry_bytes": {
-        "structured": 8529,
+        "structured": 8684,
         "text_only": 2602
       },
       "input_schema_bytes": 1114,
-      "output_schema_bytes": 5911
+      "output_schema_bytes": 6066
+    },
+    "create_dataset_column": {
+      "annotations": {
+        "destructiveHint": false,
+        "idempotentHint": false,
+        "openWorldHint": false,
+        "readOnlyHint": false
+      },
+      "compact_description_chars": 264,
+      "description_chars": 920,
+      "entry_bytes": {
+        "structured": 4973,
+        "text_only": 2904
+      },
+      "input_schema_bytes": 1652,
+      "output_schema_bytes": 2053
     },
     "create_dataset_metric": {
       "annotations": {
@@ -136,13 +152,29 @@
         "readOnlyHint": false
       },
       "compact_description_chars": 263,
-      "description_chars": 903,
+      "description_chars": 972,
       "entry_bytes": {
-        "structured": 3069,
-        "text_only": 1534
+        "structured": 3186,
+        "text_only": 1604
       },
       "input_schema_bytes": 351,
-      "output_schema_bytes": 1519
+      "output_schema_bytes": 1566
+    },
+    "delete_dataset_column": {
+      "annotations": {
+        "destructiveHint": true,
+        "idempotentHint": false,
+        "openWorldHint": false,
+        "readOnlyHint": false
+      },
+      "compact_description_chars": 246,
+      "description_chars": 489,
+      "entry_bytes": {
+        "structured": 3752,
+        "text_only": 1283
+      },
+      "input_schema_bytes": 491,
+      "output_schema_bytes": 2453
     },
     "delete_dataset_metric": {
       "annotations": {
@@ -506,11 +538,11 @@
       "compact_description_chars": 222,
       "description_chars": 2045,
       "entry_bytes": {
-        "structured": 13879,
-        "text_only": 4683
+        "structured": 14101,
+        "text_only": 4750
       },
-      "input_schema_bytes": 2326,
-      "output_schema_bytes": 9180
+      "input_schema_bytes": 2393,
+      "output_schema_bytes": 9335
     },
     "get_instance_info": {
       "annotations": {
@@ -810,11 +842,11 @@
       "compact_description_chars": 230,
       "description_chars": 2331,
       "entry_bytes": {
-        "structured": 15092,
+        "structured": 15247,
         "text_only": 6798
       },
       "input_schema_bytes": 4146,
-      "output_schema_bytes": 8278
+      "output_schema_bytes": 8433
     },
     "list_layer_annotations": {
       "annotations": {
@@ -1210,10 +1242,10 @@
       "compact_description_chars": 45,
       "description_chars": 2416,
       "entry_bytes": {
-        "structured": 27063,
-        "text_only": 6689
+        "structured": 27225,
+        "text_only": 6851
       },
-      "input_schema_bytes": 3913,
+      "input_schema_bytes": 4075,
       "output_schema_bytes": 20358
     },
     "update_chart_preview": {
@@ -1264,6 +1296,22 @@
       "input_schema_bytes": 1534,
       "output_schema_bytes": 1390
     },
+    "update_dataset_column": {
+      "annotations": {
+        "destructiveHint": true,
+        "idempotentHint": false,
+        "openWorldHint": false,
+        "readOnlyHint": false
+      },
+      "compact_description_chars": 294,
+      "description_chars": 1270,
+      "entry_bytes": {
+        "structured": 5917,
+        "text_only": 3660
+      },
+      "input_schema_bytes": 2073,
+      "output_schema_bytes": 2241
+    },
     "update_dataset_metric": {
       "annotations": {
         "destructiveHint": true,
@@ -1283,16 +1331,16 @@
   },
   "totals": {
     "catalog_bytes": {
-      "structured": 540013,
-      "text_only": 220447
+      "structured": 555469,
+      "text_only": 228596
     },
     "compact_catalog_bytes": {
-      "structured": 484466,
-      "text_only": 164900
+      "structured": 497902,
+      "text_only": 171029
     },
     "largest_entry": {
       "structured": {
-        "bytes": 27063,
+        "bytes": 27225,
         "name": "update_chart"
       },
       "text_only": {
@@ -1300,6 +1348,6 @@
         "name": "manage_native_filters"
       }
     },
-    "tool_count": 80
+    "tool_count": 83
   }
 }
diff --git a/tests/unit_tests/mcp_service/test_mcp_tool_registration.py 
b/tests/unit_tests/mcp_service/test_mcp_tool_registration.py
index 7b1e582bc6c..5f63aef2e83 100644
--- a/tests/unit_tests/mcp_service/test_mcp_tool_registration.py
+++ b/tests/unit_tests/mcp_service/test_mcp_tool_registration.py
@@ -42,12 +42,14 @@ EXPECTED_TOOL_OUTPUT_FIELDS = {
     "add_chart_to_existing_dashboard": "dashboard_url",
     "apply_dashboard_filters": "permalink_key",
     "create_dataset": "table_name",
+    "create_dataset_column": "column",
     "create_dataset_metric": "metric",
     "create_theme": "theme_name",
     "create_virtual_dataset": "dataset_name",
     "delete_chart": "deleted_id",
     "delete_dashboard": "deleted_id",
     "delete_dataset": "deleted_id",
+    "delete_dataset_column": "affected_charts",
     "delete_dataset_metric": "affected_charts",
     "duplicate_dashboard": "duplicated_slices",
     "execute_sql": "statements",
@@ -118,6 +120,7 @@ EXPECTED_TOOL_OUTPUT_FIELDS = {
     "update_chart_preview": "previous_form_data_key",
     "update_dashboard": "changed_fields",
     "update_dataset": "updated_properties",
+    "update_dataset_column": "updated_properties",
     "update_dataset_metric": "updated_properties",
 }
 
@@ -136,12 +139,14 @@ MUTATING_TOOLS = {
     "add_chart_to_existing_dashboard",
     "apply_dashboard_filters",
     "create_dataset",
+    "create_dataset_column",
     "create_dataset_metric",
     "create_theme",
     "create_virtual_dataset",
     "delete_chart",
     "delete_dashboard",
     "delete_dataset",
+    "delete_dataset_column",
     "delete_dataset_metric",
     "duplicate_dashboard",
     "execute_sql",
@@ -162,6 +167,7 @@ MUTATING_TOOLS = {
     "update_chart_preview",
     "update_dashboard",
     "update_dataset",
+    "update_dataset_column",
     "update_dataset_metric",
 }
 
@@ -182,6 +188,7 @@ DESTRUCTIVE_TOOLS = {
     "delete_chart",
     "delete_dashboard",
     "delete_dataset",
+    "delete_dataset_column",
     "delete_dataset_metric",
     "execute_sql",
     "manage_dashboard_markdown",
@@ -192,6 +199,7 @@ DESTRUCTIVE_TOOLS = {
     "update_chart",
     "update_dashboard",
     "update_dataset",
+    "update_dataset_column",
     "update_dataset_metric",
 }
 
@@ -280,6 +288,7 @@ OMITTED_MEANS_UNCHANGED_TOOLS = (
     "update_chart",
     "update_dashboard",
     "update_dataset",
+    "update_dataset_column",
     "update_dataset_metric",
 )
 
diff --git a/tests/unit_tests/mcp_service/test_rbac_tool_enforcement.py 
b/tests/unit_tests/mcp_service/test_rbac_tool_enforcement.py
index 9a965ae4690..12f6cae4404 100644
--- a/tests/unit_tests/mcp_service/test_rbac_tool_enforcement.py
+++ b/tests/unit_tests/mcp_service/test_rbac_tool_enforcement.py
@@ -140,6 +140,24 @@ _MUTATING_TOOLS: list[tuple[str, dict[str, Any], str, 
str]] = [
         "write",
         "Dataset",
     ),
+    (
+        "create_dataset_column",
+        {"dataset_id": 1, "column_name": "size", "expression": "amount * 2"},
+        "write",
+        "Dataset",
+    ),
+    (
+        "update_dataset_column",
+        {"dataset_id": 1, "column": "size", "verbose_name": "Size"},
+        "write",
+        "Dataset",
+    ),
+    (
+        "delete_dataset_column",
+        {"dataset_id": 1, "column": "size"},
+        "write",
+        "Dataset",
+    ),
     (
         "create_theme",
         {"theme_name": "Denied Theme", "json_data": {"token": {}}},
diff --git a/tests/unit_tests/mcp_service/test_sanitization_warning_inputs.py 
b/tests/unit_tests/mcp_service/test_sanitization_warning_inputs.py
index a42686e3feb..a5dd312db13 100644
--- a/tests/unit_tests/mcp_service/test_sanitization_warning_inputs.py
+++ b/tests/unit_tests/mcp_service/test_sanitization_warning_inputs.py
@@ -45,9 +45,11 @@ from superset.mcp_service.dashboard.schemas import (
     UpdateDashboardRequest,
 )
 from superset.mcp_service.dataset.schemas import (
+    CreateDatasetColumnRequest,
     CreateDatasetMetricRequest,
     CreateDatasetRequest,
     CreateVirtualDatasetRequest,
+    UpdateDatasetColumnRequest,
     UpdateDatasetMetricRequest,
     UpdateDatasetRequest,
 )
@@ -247,6 +249,16 @@ def make_name_server() -> FastMCP:
         """Validate metric updates."""
         return "ok"
 
+    @server.tool
+    def create_dataset_column(request: CreateDatasetColumnRequest) -> str:
+        """Validate calculated column creation."""
+        return "ok"
+
+    @server.tool
+    def update_dataset_column(request: UpdateDatasetColumnRequest) -> str:
+        """Validate column updates."""
+        return "ok"
+
     @server.tool
     def update_dataset(request: UpdateDatasetRequest) -> str:
         """Validate dataset updates."""
@@ -669,6 +681,18 @@ _REQUIRED_NAME_CASES: list[tuple[str, dict[str, Any], str, 
list[str | None]]] =
         "metric_name",
         ["", " \t\n", None],
     ),
+    (
+        "create_dataset_column",
+        {"dataset_id": 1, "expression": "amount * 2"},
+        "column_name",
+        ["", " \t\n"],
+    ),
+    (
+        "update_dataset_column",
+        {"dataset_id": 1, "column": 1},
+        "column_name",
+        ["", " \t\n", None],
+    ),
     ("update_dataset", {"dataset_id": 1}, "table_name", ["", " \t\n", None]),
     (
         "save_sql_query",
@@ -696,6 +720,13 @@ _BLANK_ERROR_LIMIT_CASES: list[tuple[type[BaseModel], 
dict[str, Any], str, int]]
         255,
     ),
     (UpdateDatasetMetricRequest, {"dataset_id": 1, "metric": 1}, 
"metric_name", 255),
+    (
+        CreateDatasetColumnRequest,
+        {"dataset_id": 1, "expression": "amount * 2"},
+        "column_name",
+        255,
+    ),
+    (UpdateDatasetColumnRequest, {"dataset_id": 1, "column": 1}, 
"column_name", 255),
     (UpdateDatasetRequest, {"dataset_id": 1}, "table_name", 250),
     (
         SaveSqlQueryRequest,
diff --git a/tests/unit_tests/mcp_service/test_tool_inventory.py 
b/tests/unit_tests/mcp_service/test_tool_inventory.py
index f907548e715..b84b9e0bcbd 100644
--- a/tests/unit_tests/mcp_service/test_tool_inventory.py
+++ b/tests/unit_tests/mcp_service/test_tool_inventory.py
@@ -56,12 +56,14 @@ TOOL_BUDGETS = {
     "add_chart_to_existing_dashboard": 1_500,
     "apply_dashboard_filters": 3_700,
     "create_dataset": 1_800,
+    "create_dataset_column": 2_400,
     "create_dataset_metric": 2_800,
     "create_theme": 1_200,
     "create_virtual_dataset": 3_700,
     "delete_chart": 1_100,
     "delete_dashboard": 1_100,
     "delete_dataset": 1_100,
+    "delete_dataset_column": 1_200,
     "delete_dataset_metric": 1_300,
     "duplicate_dashboard": 1_900,
     "execute_sql": 2_100,
@@ -143,6 +145,7 @@ TOOL_BUDGETS = {
     "update_chart_preview": 2_200,
     "update_dashboard": 4_200,
     "update_dataset": 2_300,
+    "update_dataset_column": 2_900,
     "update_dataset_metric": 3_100,
 }
 

Reply via email to