You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2026/07/01 06:37:39 UTC

(superset) 02/02: feat(mcp): add semantic layer MCP tools (list_metrics, get_table, get_compatible_dimensions, get_compatible_metrics)

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

aminghadersohi pushed a commit to branch aminghadersohi/mcp-semantic-layer-tools
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 37bdb423716829c17a4973896bccc9c51a55bb03
Author: Amin Ghadersohi <am...@gmail.com>
AuthorDate: Wed Jul 1 06:36:30 2026 +0000

    feat(mcp): add semantic layer MCP tools (list_metrics, get_table, get_compatible_dimensions, get_compatible_metrics)
    
    Implements Phase 1 of SC-98803. Adds 4 new MCP tools that surface Superset's
    semantic layer to LLM clients, spanning both built-in SqlaTable datasets and
    external SemanticView implementations:
    
    - list_metrics: unified metric discovery across all data sources; includes
      compatible_dimensions inline per metric for progressive query building
    - get_table: routes queries to ChartDataCommand (built-in) or the semantic
      view's query path (external) based on dataset_id vs view_id
    - get_compatible_dimensions: returns valid dimensions for a given metric
      selection; delegates to SemanticView.get_compatible_dimensions for external
    - get_compatible_metrics: returns valid metrics for a given dimension
      selection; delegates to SemanticView.get_compatible_metrics for external
    
    External semantic view calls degrade gracefully when the registry is empty
    (OSS default). All tools follow existing patterns: @tool decorator, Pydantic
    schemas, DAO-based lookups, event_logger, ctx logging, and ASF license headers.
---
 .pre-commit-config.yaml                                               | 0
 superset/mcp_service/app.py                                           | 0
 superset/mcp_service/semantic_layer/__init__.py                       | 0
 superset/mcp_service/semantic_layer/schemas.py                        | 0
 superset/mcp_service/semantic_layer/tool/__init__.py                  | 0
 superset/mcp_service/semantic_layer/tool/get_compatible_dimensions.py | 0
 superset/mcp_service/semantic_layer/tool/get_compatible_metrics.py    | 0
 superset/mcp_service/semantic_layer/tool/get_table.py                 | 0
 superset/mcp_service/semantic_layer/tool/list_metrics.py              | 0
 9 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
old mode 100644
new mode 100755
diff --git a/superset/mcp_service/app.py b/superset/mcp_service/app.py
old mode 100644
new mode 100755
diff --git a/superset/mcp_service/semantic_layer/__init__.py b/superset/mcp_service/semantic_layer/__init__.py
old mode 100644
new mode 100755
diff --git a/superset/mcp_service/semantic_layer/schemas.py b/superset/mcp_service/semantic_layer/schemas.py
old mode 100644
new mode 100755
diff --git a/superset/mcp_service/semantic_layer/tool/__init__.py b/superset/mcp_service/semantic_layer/tool/__init__.py
old mode 100644
new mode 100755
diff --git a/superset/mcp_service/semantic_layer/tool/get_compatible_dimensions.py b/superset/mcp_service/semantic_layer/tool/get_compatible_dimensions.py
old mode 100644
new mode 100755
diff --git a/superset/mcp_service/semantic_layer/tool/get_compatible_metrics.py b/superset/mcp_service/semantic_layer/tool/get_compatible_metrics.py
old mode 100644
new mode 100755
diff --git a/superset/mcp_service/semantic_layer/tool/get_table.py b/superset/mcp_service/semantic_layer/tool/get_table.py
old mode 100644
new mode 100755
diff --git a/superset/mcp_service/semantic_layer/tool/list_metrics.py b/superset/mcp_service/semantic_layer/tool/list_metrics.py
old mode 100644
new mode 100755