You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "aminghadersohi (via GitHub)" <gi...@apache.org> on 2026/04/14 16:05:53 UTC

[PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

aminghadersohi opened a new pull request, #39348:
URL: https://github.com/apache/superset/pull/39348

   ### SUMMARY
   
   Updates `superset/mcp_service/CLAUDE.md` to reflect the current state of the MCP codebase after 90+ merged PRs since Jan 2025. This doc is used by LLM agents to understand MCP service conventions.
   
   **Key changes:**
   - Remove stale `@parse_request` decorator references (removed in #38918)
   - Fix decorator import path to `superset_core.mcp.decorators` (was incorrectly documented as `superset_core.api.mcp`)
   - Add `ToolAnnotations` pattern (required since #38641)
   - Add RBAC permission checking docs (#38407)
   - Add `event_logger` instrumentation pattern (#37859)
   - Add middleware documentation (#38523)
   - Add compile check pattern for chart creation (#38408)
   - Update auth docs: `mcp_auth_hook` is only for resources, `@tool` handles tool auth
   - Update config section with `MCP_RBAC_ENABLED`, cache, and store configs
   - Update testing conventions: async `Client` pattern, `conftest` fixtures
   - Update architecture tree with all current modules (database, sql_lab, explore, etc.)
   - Add dependency injection architecture explanation
   - Remove stale line number references that break on every PR
   - Fix broken pitfall #9 (had identical good/bad examples)
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A - documentation only
   
   ### TESTING INSTRUCTIONS
   
   1. Read through the updated `superset/mcp_service/CLAUDE.md`
   2. Verify the documented patterns match what exists in the codebase (e.g., grep for `from superset_core.mcp.decorators import tool`)
   3. Confirm no references to removed patterns like `@parse_request` or `superset_core.api.mcp`
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #39348:
URL: https://github.com/apache/superset/pull/39348#discussion_r3080881162


##########
superset/mcp_service/CLAUDE.md:
##########
@@ -151,97 +197,90 @@ def get_my_resource() -> str:
     return "Resource data here..."
 ```
 
-**Note**: Resources continue to use the direct FastMCP decorators (`@mcp.resource`) rather than the unified `@tool()` decorator.
-
-**Then add to `chart/resources/__init__.py`**:
-```python
-# superset/mcp_service/chart/resources/__init__.py
-from . import chart_configs  # existing
-from . import my_new_resource  # ADD YOUR RESOURCE HERE
-```
-
-**Verify module import exists in `app.py`** (around line 249):
-```python
-# superset/mcp_service/app.py
-from superset.mcp_service.chart import resources as chart_resources  # This imports all resources
-```
-
-**Why this matters**: Prompts and resources work similarly to tools - they use decorators and register on import. The module-level imports (`chart/prompts/__init__.py`, `chart/resources/__init__.py`) ensure individual files are imported when the module is imported. The `app.py` imports ensure the modules are loaded when the MCP service starts.
-
 ## Tool Development Patterns
 
-### 1. Use Core Classes for Reusability
+### 1. Tool Decorator Parameters
 
-The `mcp_core.py` module provides reusable patterns:
+The `@tool` decorator from `superset_core.mcp.decorators` accepts:
 
-- **`ModelListCore`**: For listing resources (dashboards, charts, datasets)
-- **`ModelGetInfoCore`**: For getting resource details by ID/UUID
-- **`ModelGetSchemaCore`**: For retrieving comprehensive schema metadata (columns, filters, sortable columns)
+| Parameter | Description | Default |
+|-----------|-------------|---------|
+| `tags` | List of tags (e.g., `["core"]`, `["mutate"]`) | `[]` |
+| `class_permission_name` | FAB permission class (e.g., `"Chart"`, `"Dashboard"`) | `None` |
+| `method_permission_name` | Permission action (e.g., `"read"`, `"write"`) | Auto: `"write"` if `"mutate"` in tags, else `"read"` |
+| `protect` | Enable authentication wrapping | `True` |
+| `annotations` | MCP `ToolAnnotations` object | `None` |

Review Comment:
   These table rows start with double pipes (`||`), which will render as an empty first column (or break table formatting) in Markdown. Change them to single-pipe table rows (`| Parameter | ... |`) so the table renders correctly.



##########
superset/mcp_service/CLAUDE.md:
##########
@@ -255,418 +294,317 @@ dashboard = DashboardDAO.find_by_id(dashboard_id)
 dashboard = db.session.query(Dashboard).filter_by(id=dashboard_id).first()
 ```
 
-### 5. Python Type Hints (Python 3.10+ Style)
+### 6. Python Type Hints (Python 3.10+ Style)
 
 **CRITICAL**: Always use modern Python 3.10+ union syntax for type hints.
 
 ```python
 # GOOD - Modern Python 3.10+ syntax
-from typing import List, Dict, Any
 from pydantic import BaseModel, Field
 
 class MySchema(BaseModel):
     name: str | None = Field(None, description="Optional name")
-    tags: List[str] = Field(default_factory=list)
-    metadata: Dict[str, Any] = Field(default_factory=dict)
+    tags: list[str] = Field(default_factory=list)
+    metadata: dict[str, Any] = Field(default_factory=dict)
 
 def my_function(
     id: int,
-    filters: List[str] | None = None,
-    options: Dict[str, Any] | None = None
+    filters: list[str] | None = None,
 ) -> MySchema | None:
     pass
 
-# BAD - Old-style Optional (DO NOT USE)
-from typing import Optional, List, Dict, Any
-
-class MySchema(BaseModel):
-    name: Optional[str] = Field(None, description="Optional name")  # Wrong!
-
-def my_function(
-    id: int,
-    filters: Optional[List[str]] = None,  # Wrong!
-    options: Optional[Dict[str, Any]] = None  # Wrong!
-) -> Optional[MySchema]:  # Wrong!
-    pass
+# BAD - Old-style (DO NOT USE)
+from typing import Optional, List, Dict
+name: Optional[str]  # Wrong! Use str | None
+tags: List[str]      # Wrong! Use list[str]
 ```
 
-**Key rules:**
-- Use `T | None` instead of `Optional[T]`
-- Do NOT import `Optional`, `List`, `Dict` from typing, prefer `| None`, `list[]` etc
-- All new code must follow this pattern
-
-### 6. Flexible Input Parsing (JSON String or Object)
-
-**MCP tools accept both JSON string and native object formats for parameters** using utilities from `superset.mcp_service.utils.schema_utils`. This makes tools flexible for different client types (LLM clients send objects, CLI tools send JSON strings).
+### 7. Event Logger Instrumentation
 
-**PREFERRED: Use the `@parse_request` decorator** for tool functions to automatically handle request parsing:
+**All tool operations should use `event_logger`** for observability:
 
 ```python
-from superset.mcp_service.utils.schema_utils import parse_request
+from superset.extensions import event_logger
 
-@mcp.tool
-@mcp_auth_hook
-@parse_request(ListChartsRequest)  # Automatically parses string requests!
-async def list_charts(request: ListChartsRequest | str, ctx: Context) -> ChartList:
-    """List charts with filtering and search."""
-    # request is guaranteed to be ListChartsRequest here - no manual parsing needed!
-    await ctx.info(f"Listing charts: page={request.page}")
-    ...
-```
-
-**Benefits:**
-- Eliminates 5 lines of boilerplate code per tool
-- Handles both async and sync functions automatically
-- Works with Claude Code bug (GitHub issue #5504)
-- Cleaner, more maintainable code
-
-**Available utilities for other use cases:**
-
-#### parse_json_or_passthrough
-Parse JSON string or return object as-is:
-
-```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_passthrough
-
-# Accepts both formats
-config = parse_json_or_passthrough(value, param_name="config")
-# value can be: '{"key": "value"}' (JSON string) OR {"key": "value"} (dict)
+@tool(...)
+async def my_tool(request: MyRequest, ctx: Context) -> MyResponse:
+    with event_logger.log_context(action="mcp.my_tool.step_name"):
+        result = do_something()
+    return MyResponse(data=result)
 ```
 
-#### parse_json_or_list
-Parse to list from JSON, list, or comma-separated string:
+### 8. Context Logging
 
-```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_list
-
-# Accepts multiple formats
-items = parse_json_or_list(value, param_name="items")
-# value can be:
-#   '["a", "b"]' (JSON array)
-#   ["a", "b"] (Python list)
-#   "a, b, c" (comma-separated string)
-```
-
-#### parse_json_or_model
-Parse to Pydantic model from JSON or dict:
+Use the FastMCP `Context` object for structured logging within tools:
 
 ```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_model
-
-# Accepts JSON string or dict
-config = parse_json_or_model(value, ConfigModel, param_name="config")
-# value can be: '{"name": "test"}' OR {"name": "test"}
+async def my_tool(request: MyRequest, ctx: Context) -> MyResponse:
+    await ctx.info("Starting: param=%s" % (request.param,))
+    await ctx.debug("Details: keys=%s" % (sorted(request.dict().keys()),))
+    await ctx.warning("Something unexpected: %s" % (warning_msg,))
+    await ctx.error("Failed: %s" % (str(exc),))
+    await ctx.report_progress(1, 5, "Step 1 of 5")
 ```
 
-#### parse_json_or_model_list
-Parse to list of Pydantic models:
+### 9. Error Handling
 
-```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_model_list
-
-# Accepts JSON array or list of dicts
-filters = parse_json_or_model_list(value, FilterModel, param_name="filters")
-# value can be: '[{"col": "name"}]' OR [{"col": "name"}]
-```
-
-**Using with Pydantic validators:**
+**Pattern**: Catch specific exceptions for known failure modes, use broad `Exception` only as the outermost safety net that re-raises:
 
 ```python
-from pydantic import BaseModel, field_validator
-from superset.mcp_service.utils.schema_utils import parse_json_or_list
+from superset.commands.dataset.exceptions import DatasetInvalidError, DatasetCreateFailedError
 
-class MyToolRequest(BaseModel):
-    filters: List[FilterModel] = Field(default_factory=list)
-    select_columns: List[str] = Field(default_factory=list)
-
-    @field_validator("filters", mode="before")
-    @classmethod
-    def parse_filters(cls, v):
-        """Accept both JSON string and list of objects."""
-        return parse_json_or_model_list(v, FilterModel, "filters")
-
-    @field_validator("select_columns", mode="before")
-    @classmethod
-    def parse_columns(cls, v):
-        """Accept JSON array, list, or comma-separated string."""
-        return parse_json_or_list(v, "select_columns")
-```
-
-**Core classes already use these utilities:**
-- `ModelListCore` uses them for `filters` and `select_columns`
-- No need to add parsing logic in individual tools that use core classes
-
-**When to use:**
-- Tool parameters that accept complex objects (dicts, lists)
-- Parameters that may come from CLI tools (JSON strings) or LLM clients (objects)
-- Any field where you want maximum flexibility
-
-### 7. Error Handling
+@tool(...)
+async def my_tool(request: MyRequest, ctx: Context) -> MyResponse:
+    try:
+        # Specific exception handling for known failure modes
+        with event_logger.log_context(action="mcp.my_tool"):
+            result = SomeCommand(properties).run()
+        return MyResponse(data=result)
 
-**Use consistent error schemas**:
+    except DatasetInvalidError as exc:
+        # Return structured error response (don't raise)
+        await ctx.error("Validation failed: %s" % (exc.normalized_messages(),))
+        return MyResponse(error=str(exc.normalized_messages()))
 
-```python
-class MyError(BaseModel):
-    error: str = Field(..., description="Error message")
-    error_type: str = Field(..., description="Type of error")
-    timestamp: datetime = Field(
-        default_factory=lambda: datetime.now(timezone.utc),
-        description="Error timestamp"
-    )
+    except DatasetCreateFailedError as exc:
+        await ctx.error("Creation failed: %s" % (str(exc),))
+        return MyResponse(error=f"Failed: {exc}")
 
-@tool
-def my_tool(id: int) -> MyResponse:
-    try:
-        result = process_data(id)
-        return MyResponse(data=result)
-    except NotFound:
-        raise ValueError(f"Resource {id} not found")
+    except Exception as exc:
+        # Outermost safety net: log and re-raise (middleware handles it)
+        await ctx.error("Unexpected: %s: %s" % (type(exc).__name__, str(exc)))
+        raise
 ```
 
-### 8. Dataset Validation for Chart Tools
+### 10. Dataset Validation for Chart Tools
 
-**IMPORTANT**: All chart-related tools must validate that the chart's dataset is accessible before performing operations. Use the shared `validate_chart_dataset` utility from `chart_utils.py`.
+All chart-related tools must validate that the chart's dataset is accessible:
 
-**Why this matters**: Charts can reference datasets that have been deleted or become inaccessible. Without validation, users may see confusing errors when trying to preview or get data from charts with missing datasets.
-
-**Usage pattern**:
 ```python
 from superset.mcp_service.chart.chart_utils import validate_chart_dataset
 
-# After retrieving a chart, validate its dataset
 validation_result = validate_chart_dataset(chart, check_access=True)
 if not validation_result.is_valid:
     await ctx.warning("Dataset not accessible: %s" % (validation_result.error,))
     return ChartError(
         error=validation_result.error or "Chart's dataset is not accessible",
         error_type="DatasetNotAccessible",
     )
-
-# Log any warnings (e.g., virtual dataset warnings)
-for warning in validation_result.warnings:
-    await ctx.warning("Dataset warning: %s" % (warning,))
 ```
 
-**Tools that use this pattern**:
-- `get_chart_info` - Validates after retrieving chart metadata
-- `get_chart_preview` - Validates before generating preview
-- `get_chart_data` - Validates before querying data
-- `generate_chart` - Validates after chart creation (post-creation validation)
-
-**The `DatasetValidationResult` contains**:
-- `is_valid`: Whether the dataset exists and is accessible
-- `dataset_id`: The dataset ID being validated
-- `dataset_name`: The dataset name (if found)
-- `warnings`: List of warnings (e.g., "virtual dataset may be deleted")
-- `error`: Error message if validation failed
-
-## Testing Conventions
+Used by: `get_chart_info`, `get_chart_preview`, `get_chart_data`, `generate_chart`
 
-### Unit Tests
+### 11. Compile Check for Chart Creation
 
-Place unit tests in `tests/unit_tests/mcp_service/{module}/tool/test_{tool_name}.py`
+When creating or saving charts, run a compile check to verify the query executes:
 
-**Test structure**:
 ```python
-from unittest.mock import MagicMock, patch
-import pytest
+from superset.mcp_service.chart.tool.generate_chart import _compile_chart
 
-class TestMyTool:
-    @pytest.fixture
-    def mock_dao(self):
-        """Create mock DAO for testing."""
-        dao = MagicMock()
-        dao.find_by_id.return_value = create_mock_object()
-        return dao
+compile_result = _compile_chart(form_data, dataset.id)
+if not compile_result.success:
+    # Delete broken chart, return error
+    ...
+```
 
-    @patch("superset.mcp_service.chart.tool.my_tool.ChartDAO")
-    def test_my_tool_success(self, mock_dao_class, mock_dao):
-        """Test successful tool execution."""
-        mock_dao_class.return_value = mock_dao
+### 12. Flexible Input Parsing
 
-        result = my_tool(id=1)
+`ModelListCore` handles JSON string vs. native object parsing automatically via utilities in `superset.mcp_service.utils.schema_utils`:
 
-        assert result.data is not None
-        mock_dao.find_by_id.assert_called_once_with(1)
-```
+- `parse_json_or_passthrough(value, param_name)` - JSON string or dict
+- `parse_json_or_list(value, param_name)` - JSON array, list, or comma-separated string
+- `parse_json_or_model(value, model_class, param_name)` - JSON string or dict to Pydantic model
+- `parse_json_or_model_list(value, model_class, param_name)` - JSON array to list of Pydantic models
 
-### Integration Tests
+These are used internally by `ModelListCore` for `filters` and `select_columns`. Individual tools using core classes do NOT need to add parsing logic.
 
-Use Flask test client for integration tests:
+## Middleware
 
-```python
-def test_tool_with_flask_context(app):
-    """Test tool with full Flask app context."""
-    with app.app_context():
-        result = my_tool(id=1)
-        assert result is not None
-```
+The MCP service uses FastMCP middleware (registered in `server.py`):
 
-## Common Pitfalls to Avoid
+| Middleware | Purpose |
+|-----------|---------|
+| `LoggingMiddleware` | Logs tool calls with duration, entity IDs, sanitizes sensitive data |
+| `GlobalErrorHandlerMiddleware` | Catches unhandled exceptions, converts to ToolError |
+| `StructuredContentStripperMiddleware` | Strips structuredContent from responses (Claude.ai compatibility) |
+| `ResponseSizeGuardMiddleware` | Prevents oversized responses from crashing clients |
+| `ResponseCachingMiddleware` | Optional response caching (Redis-backed) |

Review Comment:
   Same Markdown table issue as above: the `||` prefix will create an extra blank column / mis-render. Use single leading `|` for each row so the middleware table renders properly.



##########
superset/mcp_service/CLAUDE.md:
##########
@@ -255,418 +294,317 @@ dashboard = DashboardDAO.find_by_id(dashboard_id)
 dashboard = db.session.query(Dashboard).filter_by(id=dashboard_id).first()
 ```
 
-### 5. Python Type Hints (Python 3.10+ Style)
+### 6. Python Type Hints (Python 3.10+ Style)
 
 **CRITICAL**: Always use modern Python 3.10+ union syntax for type hints.
 
 ```python
 # GOOD - Modern Python 3.10+ syntax
-from typing import List, Dict, Any
 from pydantic import BaseModel, Field
 
 class MySchema(BaseModel):
     name: str | None = Field(None, description="Optional name")
-    tags: List[str] = Field(default_factory=list)
-    metadata: Dict[str, Any] = Field(default_factory=dict)
+    tags: list[str] = Field(default_factory=list)
+    metadata: dict[str, Any] = Field(default_factory=dict)

Review Comment:
   This example uses `Any` but doesn’t import it, so copy/pasting will fail. Add `from typing import Any` (or qualify it appropriately) in the snippet to keep the guidance executable.



##########
superset/mcp_service/CLAUDE.md:
##########
@@ -255,418 +294,317 @@ dashboard = DashboardDAO.find_by_id(dashboard_id)
 dashboard = db.session.query(Dashboard).filter_by(id=dashboard_id).first()
 ```
 
-### 5. Python Type Hints (Python 3.10+ Style)
+### 6. Python Type Hints (Python 3.10+ Style)
 
 **CRITICAL**: Always use modern Python 3.10+ union syntax for type hints.
 
 ```python
 # GOOD - Modern Python 3.10+ syntax
-from typing import List, Dict, Any
 from pydantic import BaseModel, Field
 
 class MySchema(BaseModel):
     name: str | None = Field(None, description="Optional name")
-    tags: List[str] = Field(default_factory=list)
-    metadata: Dict[str, Any] = Field(default_factory=dict)
+    tags: list[str] = Field(default_factory=list)
+    metadata: dict[str, Any] = Field(default_factory=dict)
 
 def my_function(
     id: int,
-    filters: List[str] | None = None,
-    options: Dict[str, Any] | None = None
+    filters: list[str] | None = None,
 ) -> MySchema | None:
     pass
 
-# BAD - Old-style Optional (DO NOT USE)
-from typing import Optional, List, Dict, Any
-
-class MySchema(BaseModel):
-    name: Optional[str] = Field(None, description="Optional name")  # Wrong!
-
-def my_function(
-    id: int,
-    filters: Optional[List[str]] = None,  # Wrong!
-    options: Optional[Dict[str, Any]] = None  # Wrong!
-) -> Optional[MySchema]:  # Wrong!
-    pass
+# BAD - Old-style (DO NOT USE)
+from typing import Optional, List, Dict
+name: Optional[str]  # Wrong! Use str | None
+tags: List[str]      # Wrong! Use list[str]
 ```
 
-**Key rules:**
-- Use `T | None` instead of `Optional[T]`
-- Do NOT import `Optional`, `List`, `Dict` from typing, prefer `| None`, `list[]` etc
-- All new code must follow this pattern
-
-### 6. Flexible Input Parsing (JSON String or Object)
-
-**MCP tools accept both JSON string and native object formats for parameters** using utilities from `superset.mcp_service.utils.schema_utils`. This makes tools flexible for different client types (LLM clients send objects, CLI tools send JSON strings).
+### 7. Event Logger Instrumentation
 
-**PREFERRED: Use the `@parse_request` decorator** for tool functions to automatically handle request parsing:
+**All tool operations should use `event_logger`** for observability:
 
 ```python
-from superset.mcp_service.utils.schema_utils import parse_request
+from superset.extensions import event_logger
 
-@mcp.tool
-@mcp_auth_hook
-@parse_request(ListChartsRequest)  # Automatically parses string requests!
-async def list_charts(request: ListChartsRequest | str, ctx: Context) -> ChartList:
-    """List charts with filtering and search."""
-    # request is guaranteed to be ListChartsRequest here - no manual parsing needed!
-    await ctx.info(f"Listing charts: page={request.page}")
-    ...
-```
-
-**Benefits:**
-- Eliminates 5 lines of boilerplate code per tool
-- Handles both async and sync functions automatically
-- Works with Claude Code bug (GitHub issue #5504)
-- Cleaner, more maintainable code
-
-**Available utilities for other use cases:**
-
-#### parse_json_or_passthrough
-Parse JSON string or return object as-is:
-
-```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_passthrough
-
-# Accepts both formats
-config = parse_json_or_passthrough(value, param_name="config")
-# value can be: '{"key": "value"}' (JSON string) OR {"key": "value"} (dict)
+@tool(...)
+async def my_tool(request: MyRequest, ctx: Context) -> MyResponse:
+    with event_logger.log_context(action="mcp.my_tool.step_name"):
+        result = do_something()
+    return MyResponse(data=result)
 ```
 
-#### parse_json_or_list
-Parse to list from JSON, list, or comma-separated string:
+### 8. Context Logging
 
-```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_list
-
-# Accepts multiple formats
-items = parse_json_or_list(value, param_name="items")
-# value can be:
-#   '["a", "b"]' (JSON array)
-#   ["a", "b"] (Python list)
-#   "a, b, c" (comma-separated string)
-```
-
-#### parse_json_or_model
-Parse to Pydantic model from JSON or dict:
+Use the FastMCP `Context` object for structured logging within tools:
 
 ```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_model
-
-# Accepts JSON string or dict
-config = parse_json_or_model(value, ConfigModel, param_name="config")
-# value can be: '{"name": "test"}' OR {"name": "test"}
+async def my_tool(request: MyRequest, ctx: Context) -> MyResponse:
+    await ctx.info("Starting: param=%s" % (request.param,))
+    await ctx.debug("Details: keys=%s" % (sorted(request.dict().keys()),))

Review Comment:
   The doc uses `request.dict()` while other examples indicate Pydantic v2 usage (`ConfigDict`). In Pydantic v2, `dict()` is deprecated in favor of `model_dump()`. Updating this example avoids encouraging deprecated APIs (e.g., `sorted(request.model_dump().keys())`).
   ```suggestion
       await ctx.debug("Details: keys=%s" % (sorted(request.model_dump().keys()),))
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #39348:
URL: https://github.com/apache/superset/pull/39348#discussion_r3080866052


##########
superset/mcp_service/CLAUDE.md:
##########
@@ -255,418 +294,317 @@ dashboard = DashboardDAO.find_by_id(dashboard_id)
 dashboard = db.session.query(Dashboard).filter_by(id=dashboard_id).first()
 ```
 
-### 5. Python Type Hints (Python 3.10+ Style)
+### 6. Python Type Hints (Python 3.10+ Style)
 
 **CRITICAL**: Always use modern Python 3.10+ union syntax for type hints.
 
 ```python
 # GOOD - Modern Python 3.10+ syntax
-from typing import List, Dict, Any
 from pydantic import BaseModel, Field
 
 class MySchema(BaseModel):
     name: str | None = Field(None, description="Optional name")
-    tags: List[str] = Field(default_factory=list)
-    metadata: Dict[str, Any] = Field(default_factory=dict)
+    tags: list[str] = Field(default_factory=list)
+    metadata: dict[str, Any] = Field(default_factory=dict)
 
 def my_function(
     id: int,
-    filters: List[str] | None = None,
-    options: Dict[str, Any] | None = None
+    filters: list[str] | None = None,
 ) -> MySchema | None:
     pass
 
-# BAD - Old-style Optional (DO NOT USE)
-from typing import Optional, List, Dict, Any
-
-class MySchema(BaseModel):
-    name: Optional[str] = Field(None, description="Optional name")  # Wrong!
-
-def my_function(
-    id: int,
-    filters: Optional[List[str]] = None,  # Wrong!
-    options: Optional[Dict[str, Any]] = None  # Wrong!
-) -> Optional[MySchema]:  # Wrong!
-    pass
+# BAD - Old-style (DO NOT USE)
+from typing import Optional, List, Dict
+name: Optional[str]  # Wrong! Use str | None
+tags: List[str]      # Wrong! Use list[str]
 ```
 
-**Key rules:**
-- Use `T | None` instead of `Optional[T]`
-- Do NOT import `Optional`, `List`, `Dict` from typing, prefer `| None`, `list[]` etc
-- All new code must follow this pattern
-
-### 6. Flexible Input Parsing (JSON String or Object)
-
-**MCP tools accept both JSON string and native object formats for parameters** using utilities from `superset.mcp_service.utils.schema_utils`. This makes tools flexible for different client types (LLM clients send objects, CLI tools send JSON strings).
+### 7. Event Logger Instrumentation
 
-**PREFERRED: Use the `@parse_request` decorator** for tool functions to automatically handle request parsing:
+**All tool operations should use `event_logger`** for observability:
 
 ```python
-from superset.mcp_service.utils.schema_utils import parse_request
+from superset.extensions import event_logger
 
-@mcp.tool
-@mcp_auth_hook
-@parse_request(ListChartsRequest)  # Automatically parses string requests!
-async def list_charts(request: ListChartsRequest | str, ctx: Context) -> ChartList:
-    """List charts with filtering and search."""
-    # request is guaranteed to be ListChartsRequest here - no manual parsing needed!
-    await ctx.info(f"Listing charts: page={request.page}")
-    ...
-```
-
-**Benefits:**
-- Eliminates 5 lines of boilerplate code per tool
-- Handles both async and sync functions automatically
-- Works with Claude Code bug (GitHub issue #5504)
-- Cleaner, more maintainable code
-
-**Available utilities for other use cases:**
-
-#### parse_json_or_passthrough
-Parse JSON string or return object as-is:
-
-```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_passthrough
-
-# Accepts both formats
-config = parse_json_or_passthrough(value, param_name="config")
-# value can be: '{"key": "value"}' (JSON string) OR {"key": "value"} (dict)
+@tool(...)
+async def my_tool(request: MyRequest, ctx: Context) -> MyResponse:
+    with event_logger.log_context(action="mcp.my_tool.step_name"):
+        result = do_something()
+    return MyResponse(data=result)
 ```
 
-#### parse_json_or_list
-Parse to list from JSON, list, or comma-separated string:
+### 8. Context Logging
 
-```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_list
-
-# Accepts multiple formats
-items = parse_json_or_list(value, param_name="items")
-# value can be:
-#   '["a", "b"]' (JSON array)
-#   ["a", "b"] (Python list)
-#   "a, b, c" (comma-separated string)
-```
-
-#### parse_json_or_model
-Parse to Pydantic model from JSON or dict:
+Use the FastMCP `Context` object for structured logging within tools:
 
 ```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_model
-
-# Accepts JSON string or dict
-config = parse_json_or_model(value, ConfigModel, param_name="config")
-# value can be: '{"name": "test"}' OR {"name": "test"}
+async def my_tool(request: MyRequest, ctx: Context) -> MyResponse:
+    await ctx.info("Starting: param=%s" % (request.param,))
+    await ctx.debug("Details: keys=%s" % (sorted(request.dict().keys()),))
+    await ctx.warning("Something unexpected: %s" % (warning_msg,))
+    await ctx.error("Failed: %s" % (str(exc),))
+    await ctx.report_progress(1, 5, "Step 1 of 5")
 ```
 
-#### parse_json_or_model_list
-Parse to list of Pydantic models:
+### 9. Error Handling
 
-```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_model_list
-
-# Accepts JSON array or list of dicts
-filters = parse_json_or_model_list(value, FilterModel, param_name="filters")
-# value can be: '[{"col": "name"}]' OR [{"col": "name"}]
-```
-
-**Using with Pydantic validators:**
+**Pattern**: Catch specific exceptions for known failure modes, use broad `Exception` only as the outermost safety net that re-raises:
 
 ```python
-from pydantic import BaseModel, field_validator
-from superset.mcp_service.utils.schema_utils import parse_json_or_list
+from superset.commands.dataset.exceptions import DatasetInvalidError, DatasetCreateFailedError
 
-class MyToolRequest(BaseModel):
-    filters: List[FilterModel] = Field(default_factory=list)
-    select_columns: List[str] = Field(default_factory=list)
-
-    @field_validator("filters", mode="before")
-    @classmethod
-    def parse_filters(cls, v):
-        """Accept both JSON string and list of objects."""
-        return parse_json_or_model_list(v, FilterModel, "filters")
-
-    @field_validator("select_columns", mode="before")
-    @classmethod
-    def parse_columns(cls, v):
-        """Accept JSON array, list, or comma-separated string."""
-        return parse_json_or_list(v, "select_columns")
-```
-
-**Core classes already use these utilities:**
-- `ModelListCore` uses them for `filters` and `select_columns`
-- No need to add parsing logic in individual tools that use core classes
-
-**When to use:**
-- Tool parameters that accept complex objects (dicts, lists)
-- Parameters that may come from CLI tools (JSON strings) or LLM clients (objects)
-- Any field where you want maximum flexibility
-
-### 7. Error Handling
+@tool(...)
+async def my_tool(request: MyRequest, ctx: Context) -> MyResponse:
+    try:
+        # Specific exception handling for known failure modes
+        with event_logger.log_context(action="mcp.my_tool"):
+            result = SomeCommand(properties).run()
+        return MyResponse(data=result)
 
-**Use consistent error schemas**:
+    except DatasetInvalidError as exc:
+        # Return structured error response (don't raise)
+        await ctx.error("Validation failed: %s" % (exc.normalized_messages(),))
+        return MyResponse(error=str(exc.normalized_messages()))
 
-```python
-class MyError(BaseModel):
-    error: str = Field(..., description="Error message")
-    error_type: str = Field(..., description="Type of error")
-    timestamp: datetime = Field(
-        default_factory=lambda: datetime.now(timezone.utc),
-        description="Error timestamp"
-    )
+    except DatasetCreateFailedError as exc:
+        await ctx.error("Creation failed: %s" % (str(exc),))
+        return MyResponse(error=f"Failed: {exc}")
 
-@tool
-def my_tool(id: int) -> MyResponse:
-    try:
-        result = process_data(id)
-        return MyResponse(data=result)
-    except NotFound:
-        raise ValueError(f"Resource {id} not found")
+    except Exception as exc:
+        # Outermost safety net: log and re-raise (middleware handles it)
+        await ctx.error("Unexpected: %s: %s" % (type(exc).__name__, str(exc)))
+        raise
 ```
 
-### 8. Dataset Validation for Chart Tools
+### 10. Dataset Validation for Chart Tools
 
-**IMPORTANT**: All chart-related tools must validate that the chart's dataset is accessible before performing operations. Use the shared `validate_chart_dataset` utility from `chart_utils.py`.
+All chart-related tools must validate that the chart's dataset is accessible:
 
-**Why this matters**: Charts can reference datasets that have been deleted or become inaccessible. Without validation, users may see confusing errors when trying to preview or get data from charts with missing datasets.
-
-**Usage pattern**:
 ```python
 from superset.mcp_service.chart.chart_utils import validate_chart_dataset
 
-# After retrieving a chart, validate its dataset
 validation_result = validate_chart_dataset(chart, check_access=True)
 if not validation_result.is_valid:
     await ctx.warning("Dataset not accessible: %s" % (validation_result.error,))
     return ChartError(
         error=validation_result.error or "Chart's dataset is not accessible",
         error_type="DatasetNotAccessible",
     )
-
-# Log any warnings (e.g., virtual dataset warnings)
-for warning in validation_result.warnings:
-    await ctx.warning("Dataset warning: %s" % (warning,))
 ```
 
-**Tools that use this pattern**:
-- `get_chart_info` - Validates after retrieving chart metadata
-- `get_chart_preview` - Validates before generating preview
-- `get_chart_data` - Validates before querying data
-- `generate_chart` - Validates after chart creation (post-creation validation)
-
-**The `DatasetValidationResult` contains**:
-- `is_valid`: Whether the dataset exists and is accessible
-- `dataset_id`: The dataset ID being validated
-- `dataset_name`: The dataset name (if found)
-- `warnings`: List of warnings (e.g., "virtual dataset may be deleted")
-- `error`: Error message if validation failed
-
-## Testing Conventions
+Used by: `get_chart_info`, `get_chart_preview`, `get_chart_data`, `generate_chart`
 
-### Unit Tests
+### 11. Compile Check for Chart Creation
 
-Place unit tests in `tests/unit_tests/mcp_service/{module}/tool/test_{tool_name}.py`
+When creating or saving charts, run a compile check to verify the query executes:
 
-**Test structure**:
 ```python
-from unittest.mock import MagicMock, patch
-import pytest
+from superset.mcp_service.chart.tool.generate_chart import _compile_chart
 
-class TestMyTool:
-    @pytest.fixture
-    def mock_dao(self):
-        """Create mock DAO for testing."""
-        dao = MagicMock()
-        dao.find_by_id.return_value = create_mock_object()
-        return dao
+compile_result = _compile_chart(form_data, dataset.id)
+if not compile_result.success:
+    # Delete broken chart, return error
+    ...
+```
 
-    @patch("superset.mcp_service.chart.tool.my_tool.ChartDAO")
-    def test_my_tool_success(self, mock_dao_class, mock_dao):
-        """Test successful tool execution."""
-        mock_dao_class.return_value = mock_dao
+### 12. Flexible Input Parsing
 
-        result = my_tool(id=1)
+`ModelListCore` handles JSON string vs. native object parsing automatically via utilities in `superset.mcp_service.utils.schema_utils`:
 
-        assert result.data is not None
-        mock_dao.find_by_id.assert_called_once_with(1)
-```
+- `parse_json_or_passthrough(value, param_name)` - JSON string or dict
+- `parse_json_or_list(value, param_name)` - JSON array, list, or comma-separated string
+- `parse_json_or_model(value, model_class, param_name)` - JSON string or dict to Pydantic model
+- `parse_json_or_model_list(value, model_class, param_name)` - JSON array to list of Pydantic models
 
-### Integration Tests
+These are used internally by `ModelListCore` for `filters` and `select_columns`. Individual tools using core classes do NOT need to add parsing logic.
 
-Use Flask test client for integration tests:
+## Middleware
 
-```python
-def test_tool_with_flask_context(app):
-    """Test tool with full Flask app context."""
-    with app.app_context():
-        result = my_tool(id=1)
-        assert result is not None
-```
+The MCP service uses FastMCP middleware (registered in `server.py`):
 
-## Common Pitfalls to Avoid
+| Middleware | Purpose |
+|-----------|---------|
+| `LoggingMiddleware` | Logs tool calls with duration, entity IDs, sanitizes sensitive data |
+| `GlobalErrorHandlerMiddleware` | Catches unhandled exceptions, converts to ToolError |
+| `StructuredContentStripperMiddleware` | Strips structuredContent from responses (Claude.ai compatibility) |
+| `ResponseSizeGuardMiddleware` | Prevents oversized responses from crashing clients |
+| `ResponseCachingMiddleware` | Optional response caching (Redis-backed) |
 
-### 1. ❌ Forgetting Tool Import in app.py
-**Problem**: Tool exists but isn't available to MCP clients.
-**Solution**: Always add tool import to `app.py` (at the bottom) after creating it. Never add to `server.py`.
+Middleware is applied in `server.py` and should NOT be modified in individual tools.
 
-### 2. ❌ Adding Tool Imports to server.py
-**Problem**: Tools won't register properly, causing runtime errors.
-**Solution**: Tool imports must be in `app.py` at the bottom of the file, not in `server.py`. The `server.py` file is only for running the server.
+## Configuration
 
-### 3. ❌ Missing Authentication
-**Problem**: Tool bypasses authentication and authorization.
-**Solution**: Always use `@tool` with default protect=True, or explicitly set protect=False only for public tools.
+Default configuration is in `mcp_config.py`. Override in `superset_config.py`:
 
-### 4. ❌ Using `Optional` Instead of Union Syntax
-**Problem**: Old-style Optional[T] is not Python 3.10+ style.
-**Solution**: Use `T | None` instead of `Optional[T]` for all type hints.
 ```python
-# GOOD - Modern Python 3.10+ syntax
-def my_function(param: str | None = None) -> int | None:
-    pass
-
-# BAD - Old-style Optional
-from typing import Optional
-def my_function(param: Optional[str] = None) -> Optional[int]:
-    pass
+# Authentication
+MCP_DEV_USERNAME = None          # Fallback username for dev mode
+MCP_AUTH_ENABLED = False         # Enable JWT/API key auth
+MCP_AUTH_FACTORY = None          # Custom auth factory function
+MCP_JWT_PUBLIC_KEY = None
+MCP_JWT_SECRET = None
+MCP_JWKS_URI = None
+MCP_USER_RESOLVER = None         # Custom function to extract username from JWT
+
+# RBAC
+MCP_RBAC_ENABLED = True          # Enable permission checking (default: True)
+
+# Request Parsing
+MCP_PARSE_REQUEST_ENABLED = True # Accept JSON string requests (workaround for client bugs)
+
+# Response Caching (optional, requires Redis)
+MCP_CACHE_CONFIG = {

Review Comment:
   **🟠 Architect Review — HIGH**
   
   The configuration section states response caching "requires Redis", but `mcp_config.py` and `caching.py` implement MCP response caching using FastMCP's in-memory store when `MCP_CACHE_CONFIG["enabled"]` is true and `MCP_STORE_CONFIG["enabled"]` is false, making Redis optional rather than required.
   
   **Suggestion:** Update the response caching documentation to explain that caching can use FastMCP's in-memory store by default, and only switches to Redis when `MCP_STORE_CONFIG` is enabled and configured with a Redis URL and cache key prefix.
   



##########
superset/mcp_service/CLAUDE.md:
##########
@@ -39,106 +39,152 @@ Use this exact template at the top of EVERY Python file:
 
 ## Architecture Overview
 
-The MCP service provides programmatic access to Superset via the Model Context Protocol, allowing AI assistants to interact with dashboards, charts, datasets, SQL Lab, and instance metadata.
+The MCP service provides programmatic access to Superset via the Model Context Protocol, allowing AI assistants to interact with dashboards, charts, datasets, databases, SQL Lab, and instance metadata.
 
 ### Key Components
 
 ```
 superset/mcp_service/
 ├── app.py                      # FastMCP app factory and tool registration
-├── auth.py                     # Authentication and authorization
+├── auth.py                     # Authentication, authorization, and RBAC
 ├── mcp_config.py              # Default configuration
 ├── mcp_core.py                # Reusable core classes for tools
 ├── flask_singleton.py         # Flask app singleton for MCP context
-├── chart/                     # Chart-related tools
-│   ├── schemas.py            # Pydantic schemas for chart responses
-│   └── tool/                 # Chart tool implementations
-│       ├── __init__.py       # Tool exports
-│       ├── list_charts.py
-│       └── get_chart_info.py
-├── dashboard/                 # Dashboard-related tools
+├── middleware.py              # FastMCP middleware (logging, errors, size guards)
+├── server.py                  # Server startup (streamable-http, multi-pod)
+├── jwt_verifier.py            # JWT token validation
+├── chart/                     # Chart tools, schemas, prompts, resources
+│   ├── schemas.py
+│   ├── chart_utils.py
+│   ├── preview_utils.py
+│   ├── validation.py
+│   ├── tool/
+│   ├── prompts/
+│   └── resources/
+├── dashboard/                 # Dashboard tools and schemas
+│   ├── schemas.py
+│   └── tool/
+├── dataset/                   # Dataset tools and schemas
+│   ├── schemas.py
+│   └── tool/
+├── database/                  # Database connection tools and schemas
 │   ├── schemas.py
 │   └── tool/

Review Comment:
   **🟠 Architect Review — HIGH**
   
   The architecture tree in CLAUDE.md lists a top-level `database/` MCP module under `superset/mcp_service`, but there is no `superset/mcp_service/database` package or corresponding MCP tools/tests in the codebase, so the doc describes a nonexistent module and extension point.
   
   **Suggestion:** Remove the `database/` entry from the architecture tree or clearly label it as future/planned so that the diagram only includes directories that actually exist in the current repo.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on PR #39348:
URL: https://github.com/apache/superset/pull/39348#issuecomment-4251107910

   🎪 ⚡ showtime-trigger-start


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #39348:
URL: https://github.com/apache/superset/pull/39348#discussion_r3081174596


##########
superset/mcp_service/CLAUDE.md:
##########
@@ -39,106 +39,149 @@ Use this exact template at the top of EVERY Python file:
 
 ## Architecture Overview
 
-The MCP service provides programmatic access to Superset via the Model Context Protocol, allowing AI assistants to interact with dashboards, charts, datasets, SQL Lab, and instance metadata.
+The MCP service provides programmatic access to Superset via the Model Context Protocol, allowing AI assistants to interact with dashboards, charts, datasets, databases, SQL Lab, and instance metadata.
 
 ### Key Components
 
 ```
 superset/mcp_service/
 ├── app.py                      # FastMCP app factory and tool registration
-├── auth.py                     # Authentication and authorization
+├── auth.py                     # Authentication, authorization, and RBAC
 ├── mcp_config.py              # Default configuration
 ├── mcp_core.py                # Reusable core classes for tools
 ├── flask_singleton.py         # Flask app singleton for MCP context
-├── chart/                     # Chart-related tools
-│   ├── schemas.py            # Pydantic schemas for chart responses
-│   └── tool/                 # Chart tool implementations
-│       ├── __init__.py       # Tool exports
-│       ├── list_charts.py
-│       └── get_chart_info.py
-├── dashboard/                 # Dashboard-related tools
+├── middleware.py              # FastMCP middleware (logging, errors, size guards)
+├── server.py                  # Server startup (streamable-http, multi-pod)
+├── jwt_verifier.py            # JWT token validation
+├── chart/                     # Chart tools, schemas, prompts, resources
+│   ├── schemas.py
+│   ├── chart_utils.py
+│   ├── preview_utils.py
+│   ├── validation.py
+│   ├── tool/
+│   ├── prompts/
+│   └── resources/
+├── dashboard/                 # Dashboard tools and schemas
+│   ├── schemas.py
+│   └── tool/
+├── dataset/                   # Dataset tools and schemas
+│   ├── schemas.py
+│   └── tool/
+├── explore/                   # Explore link generation
 │   ├── schemas.py
 │   └── tool/
-├── dataset/                   # Dataset-related tools
+├── sql_lab/                   # SQL Lab tools (execute, save, open)
 │   ├── schemas.py
 │   └── tool/
-└── system/                    # System/instance tools
-    ├── schemas.py
-    └── tool/
+├── system/                    # System tools (health, instance info, schema)
+│   ├── schemas.py
+│   ├── tool/
+│   ├── prompts/
+│   └── resources/
+├── common/                    # Shared error schemas
+├── commands/                  # MCP-specific command classes
+└── utils/                     # Utilities (URL, schema parsing, error builders)
 ```
 
+### Dependency Injection Architecture
+
+The `@tool` and `@prompt` decorators are defined as stubs in the `superset-core` package (`superset_core.mcp.decorators`). At startup, `app.py` calls `initialize_core_mcp_dependencies()` which replaces these stubs with concrete implementations that register tools/prompts with the FastMCP instance. This avoids circular imports between `superset_core` and `superset`.
+
+**Startup flow**:
+1. `app.py` creates the FastMCP `mcp` instance
+2. `initialize_core_mcp_dependencies()` injects the real decorator implementations
+3. Tool/prompt/resource imports at the bottom of `app.py` trigger registration
+4. `server.py` adds middleware and starts the transport
+
 ## Critical Convention: Tool, Prompt, and Resource Registration
 
 **IMPORTANT**: When creating new MCP tools, prompts, or resources, you MUST add their imports to `app.py` for auto-registration. Do NOT add them to `server.py` - that approach doesn't work properly.
 
 ### How to Add a New Tool
 
 1. **Create the tool file** in the appropriate directory (e.g., `chart/tool/my_new_tool.py`)
-2. **Decorate with `@tool`** to register it with the decorator
-3. **Add import to `app.py`** at the bottom of the file where other tools are imported (around line 210-242)
+2. **Decorate with `@tool`** using the decorator from `superset_core.mcp.decorators`
+3. **Export from the module's `__init__.py`** (e.g., `chart/tool/__init__.py`)
+4. **Add import to `app.py`** at the bottom of the file where other tools are imported
 
-**Example**:
+**Example (read-only tool)**:
 ```python
 # superset/mcp_service/chart/tool/my_new_tool.py
-from superset_core.api.mcp import tool
-
-@tool
-def my_new_tool(param: str) -> dict:
+from fastmcp import Context
+from superset_core.mcp.decorators import tool, ToolAnnotations
+
+from superset.extensions import event_logger
+
+@tool(
+    tags=["core"],
+    class_permission_name="Chart",
+    annotations=ToolAnnotations(
+        title="My new tool",
+        readOnlyHint=True,
+        destructiveHint=False,
+    ),
+)
+async def my_new_tool(request: MyRequest, ctx: Context) -> MyResponse:
     """Tool description for LLMs."""
-    return {"result": "success"}
+    await ctx.info("Doing something: param=%s" % (request.param,))
+    with event_logger.log_context(action="mcp.my_new_tool"):
+        result = do_something()
+    return MyResponse(data=result)
+```
+
+**Example (mutating tool)**:
+```python
+@tool(
+    tags=["mutate"],
+    class_permission_name="Chart",
+    method_permission_name="write",
+    annotations=ToolAnnotations(
+        title="Create something",
+        readOnlyHint=False,
+        destructiveHint=False,
+    ),
+)
+async def create_something(request: CreateRequest, ctx: Context) -> CreateResponse:
+    """Creates a new resource."""
+    ...
 ```
 
 **Then add to app.py**:
 ```python
-# superset/mcp_service/app.py (at the bottom, around line 207-224)
+# superset/mcp_service/app.py (at the bottom, after initialize_core_mcp_dependencies())
 from superset.mcp_service.chart.tool import (  # noqa: F401, E402
     get_chart_info,
     list_charts,
     my_new_tool,  # ADD YOUR TOOL HERE
 )
 ```
 
-**Why this matters**: Tools use `@tool` decorators and register automatically on import. The import MUST be in `app.py` at the bottom of the file (after dependency injection is initialized). If you don't import the tool in `app.py`, it won't be available to MCP clients. DO NOT add imports to `server.py` - that file is for running the server only.
+**Why this matters**: Tools register automatically on import via the `@tool` decorator. The import MUST be in `app.py` at the bottom (after `initialize_core_mcp_dependencies()` is called). DO NOT add imports to `server.py`.
 
 ### How to Add a New Prompt
 
 1. **Create the prompt file** in the appropriate directory (e.g., `chart/prompts/my_new_prompt.py`)
-2. **Decorate with `@prompt`** to register it with the unified decorator
+2. **Decorate with `@prompt`** from `superset_core.mcp.decorators`
 3. **Add import to module's `__init__.py`** (e.g., `chart/prompts/__init__.py`)
-4. **Ensure module is imported in `app.py`** (around line 244-253)
+4. **Ensure module is imported in `app.py`**
 
 **Example**:
 ```python
 # superset/mcp_service/chart/prompts/my_new_prompt.py
-from superset_core.api.mcp import prompt
+from superset_core.mcp.decorators import prompt
 
 @prompt("my_new_prompt")
-async def my_new_prompt_handler(ctx: Context) -> str:
+async def my_new_prompt_handler(
+    chart_type: str = "auto", business_goal: str = "exploration"
+) -> str:
     """Interactive prompt for doing something."""
     return "Prompt instructions here..."
 ```
 
-**Then add to `chart/prompts/__init__.py`**:
-```python
-# superset/mcp_service/chart/prompts/__init__.py
-from . import create_chart_guided  # existing
-from . import my_new_prompt  # ADD YOUR PROMPT HERE
-```
-
-**Verify module import exists in `app.py`** (around line 248):
-```python
-# superset/mcp_service/app.py
-from superset.mcp_service.chart import prompts as chart_prompts  # This imports all prompts
-```
-
 ### How to Add a New Resource
 
-1. **Create the resource file** in the appropriate directory (e.g., `chart/resources/my_new_resource.py`)
-2. **Decorate with `@mcp.resource`** to register it with FastMCP (resources still use direct FastMCP)
-3. **Add import to module's `__init__.py`** (e.g., `chart/resources/__init__.py`)
-4. **Ensure module is imported in `app.py`** (around line 244-253)
+Resources still use direct FastMCP decorators plus `@mcp_auth_hook` for authentication:

Review Comment:
   The text states resources should use `@mcp_auth_hook`, but the example does not include it. This is a concrete inconsistency that can mislead readers copying the snippet; either add `@mcp_auth_hook` to the example (and show the correct import) or adjust the preceding sentence to match the example.



##########
superset/mcp_service/CLAUDE.md:
##########
@@ -151,97 +194,90 @@ def get_my_resource() -> str:
     return "Resource data here..."
 ```
 
-**Note**: Resources continue to use the direct FastMCP decorators (`@mcp.resource`) rather than the unified `@tool()` decorator.
-
-**Then add to `chart/resources/__init__.py`**:
-```python
-# superset/mcp_service/chart/resources/__init__.py
-from . import chart_configs  # existing
-from . import my_new_resource  # ADD YOUR RESOURCE HERE
-```
-
-**Verify module import exists in `app.py`** (around line 249):
-```python
-# superset/mcp_service/app.py
-from superset.mcp_service.chart import resources as chart_resources  # This imports all resources
-```
-
-**Why this matters**: Prompts and resources work similarly to tools - they use decorators and register on import. The module-level imports (`chart/prompts/__init__.py`, `chart/resources/__init__.py`) ensure individual files are imported when the module is imported. The `app.py` imports ensure the modules are loaded when the MCP service starts.
-
 ## Tool Development Patterns
 
-### 1. Use Core Classes for Reusability
+### 1. Tool Decorator Parameters
 
-The `mcp_core.py` module provides reusable patterns:
+The `@tool` decorator from `superset_core.mcp.decorators` accepts:
 
-- **`ModelListCore`**: For listing resources (dashboards, charts, datasets)
-- **`ModelGetInfoCore`**: For getting resource details by ID/UUID
-- **`ModelGetSchemaCore`**: For retrieving comprehensive schema metadata (columns, filters, sortable columns)
+| Parameter | Description | Default |
+|-----------|-------------|---------|
+| `tags` | List of tags (e.g., `["core"]`, `["mutate"]`) | `[]` |
+| `class_permission_name` | FAB permission class (e.g., `"Chart"`, `"Dashboard"`) | `None` |
+| `method_permission_name` | Permission action (e.g., `"read"`, `"write"`) | Auto: `"write"` if `"mutate"` in tags, else `"read"` |
+| `protect` | Enable authentication wrapping | `True` |
+| `annotations` | MCP `ToolAnnotations` object | `None` |

Review Comment:
   The markdown table uses `||` at the start of multiple rows, which will render incorrectly in many markdown parsers. Use a single leading `|` for each row and keep the separator row to standard markdown table syntax.



##########
superset/mcp_service/CLAUDE.md:
##########
@@ -255,418 +291,318 @@ dashboard = DashboardDAO.find_by_id(dashboard_id)
 dashboard = db.session.query(Dashboard).filter_by(id=dashboard_id).first()
 ```
 
-### 5. Python Type Hints (Python 3.10+ Style)
+### 6. Python Type Hints (Python 3.10+ Style)
 
 **CRITICAL**: Always use modern Python 3.10+ union syntax for type hints.
 
 ```python
 # GOOD - Modern Python 3.10+ syntax
-from typing import List, Dict, Any
+from typing import Any
+
 from pydantic import BaseModel, Field
 
 class MySchema(BaseModel):
     name: str | None = Field(None, description="Optional name")
-    tags: List[str] = Field(default_factory=list)
-    metadata: Dict[str, Any] = Field(default_factory=dict)
+    tags: list[str] = Field(default_factory=list)
+    metadata: dict[str, Any] = Field(default_factory=dict)
 
 def my_function(
     id: int,
-    filters: List[str] | None = None,
-    options: Dict[str, Any] | None = None
+    filters: list[str] | None = None,
 ) -> MySchema | None:
     pass
 
-# BAD - Old-style Optional (DO NOT USE)
-from typing import Optional, List, Dict, Any
-
-class MySchema(BaseModel):
-    name: Optional[str] = Field(None, description="Optional name")  # Wrong!
-
-def my_function(
-    id: int,
-    filters: Optional[List[str]] = None,  # Wrong!
-    options: Optional[Dict[str, Any]] = None  # Wrong!
-) -> Optional[MySchema]:  # Wrong!
-    pass
-```
-
-**Key rules:**
-- Use `T | None` instead of `Optional[T]`
-- Do NOT import `Optional`, `List`, `Dict` from typing, prefer `| None`, `list[]` etc
-- All new code must follow this pattern
-
-### 6. Flexible Input Parsing (JSON String or Object)
-
-**MCP tools accept both JSON string and native object formats for parameters** using utilities from `superset.mcp_service.utils.schema_utils`. This makes tools flexible for different client types (LLM clients send objects, CLI tools send JSON strings).
-
-**PREFERRED: Use the `@parse_request` decorator** for tool functions to automatically handle request parsing:
-
-```python
-from superset.mcp_service.utils.schema_utils import parse_request
-
-@mcp.tool
-@mcp_auth_hook
-@parse_request(ListChartsRequest)  # Automatically parses string requests!
-async def list_charts(request: ListChartsRequest | str, ctx: Context) -> ChartList:
-    """List charts with filtering and search."""
-    # request is guaranteed to be ListChartsRequest here - no manual parsing needed!
-    await ctx.info(f"Listing charts: page={request.page}")
-    ...
+# BAD - Old-style (DO NOT USE)
+from typing import Optional, List, Dict
+name: Optional[str]  # Wrong! Use str | None
+tags: List[str]      # Wrong! Use list[str]
 ```
 
-**Benefits:**
-- Eliminates 5 lines of boilerplate code per tool
-- Handles both async and sync functions automatically
-- Works with Claude Code bug (GitHub issue #5504)
-- Cleaner, more maintainable code
-
-**Available utilities for other use cases:**
+### 7. Event Logger Instrumentation
 
-#### parse_json_or_passthrough
-Parse JSON string or return object as-is:
+**All tool operations should use `event_logger`** for observability:
 
 ```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_passthrough
+from superset.extensions import event_logger
 
-# Accepts both formats
-config = parse_json_or_passthrough(value, param_name="config")
-# value can be: '{"key": "value"}' (JSON string) OR {"key": "value"} (dict)
+@tool(...)
+async def my_tool(request: MyRequest, ctx: Context) -> MyResponse:
+    with event_logger.log_context(action="mcp.my_tool.step_name"):
+        result = do_something()
+    return MyResponse(data=result)
 ```
 
-#### parse_json_or_list
-Parse to list from JSON, list, or comma-separated string:
+### 8. Context Logging
 
-```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_list
-
-# Accepts multiple formats
-items = parse_json_or_list(value, param_name="items")
-# value can be:
-#   '["a", "b"]' (JSON array)
-#   ["a", "b"] (Python list)
-#   "a, b, c" (comma-separated string)
-```
-
-#### parse_json_or_model
-Parse to Pydantic model from JSON or dict:
+Use the FastMCP `Context` object for structured logging within tools:
 
 ```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_model
-
-# Accepts JSON string or dict
-config = parse_json_or_model(value, ConfigModel, param_name="config")
-# value can be: '{"name": "test"}' OR {"name": "test"}
+async def my_tool(request: MyRequest, ctx: Context) -> MyResponse:
+    await ctx.info("Starting: param=%s" % (request.param,))
+    await ctx.debug("Details: keys=%s" % (sorted(request.model_dump().keys()),))
+    await ctx.warning("Something unexpected: %s" % (warning_msg,))
+    await ctx.error("Failed: %s" % (str(exc),))
+    await ctx.report_progress(1, 5, "Step 1 of 5")
 ```
 
-#### parse_json_or_model_list
-Parse to list of Pydantic models:
+### 9. Error Handling
 
-```python
-from superset.mcp_service.utils.schema_utils import parse_json_or_model_list
-
-# Accepts JSON array or list of dicts
-filters = parse_json_or_model_list(value, FilterModel, param_name="filters")
-# value can be: '[{"col": "name"}]' OR [{"col": "name"}]
-```
-
-**Using with Pydantic validators:**
+**Pattern**: Catch specific exceptions for known failure modes, use broad `Exception` only as the outermost safety net that re-raises:
 
 ```python
-from pydantic import BaseModel, field_validator
-from superset.mcp_service.utils.schema_utils import parse_json_or_list
-
-class MyToolRequest(BaseModel):
-    filters: List[FilterModel] = Field(default_factory=list)
-    select_columns: List[str] = Field(default_factory=list)
-
-    @field_validator("filters", mode="before")
-    @classmethod
-    def parse_filters(cls, v):
-        """Accept both JSON string and list of objects."""
-        return parse_json_or_model_list(v, FilterModel, "filters")
-
-    @field_validator("select_columns", mode="before")
-    @classmethod
-    def parse_columns(cls, v):
-        """Accept JSON array, list, or comma-separated string."""
-        return parse_json_or_list(v, "select_columns")
-```
-
-**Core classes already use these utilities:**
-- `ModelListCore` uses them for `filters` and `select_columns`
-- No need to add parsing logic in individual tools that use core classes
+from superset.commands.dataset.exceptions import DatasetInvalidError, DatasetCreateFailedError
 
-**When to use:**
-- Tool parameters that accept complex objects (dicts, lists)
-- Parameters that may come from CLI tools (JSON strings) or LLM clients (objects)
-- Any field where you want maximum flexibility
-
-### 7. Error Handling
+@tool(...)
+async def my_tool(request: MyRequest, ctx: Context) -> MyResponse:
+    try:
+        # Specific exception handling for known failure modes
+        with event_logger.log_context(action="mcp.my_tool"):
+            result = SomeCommand(properties).run()
+        return MyResponse(data=result)
 
-**Use consistent error schemas**:
+    except DatasetInvalidError as exc:
+        # Return structured error response (don't raise)
+        await ctx.error("Validation failed: %s" % (exc.normalized_messages(),))
+        return MyResponse(error=str(exc.normalized_messages()))
 
-```python
-class MyError(BaseModel):
-    error: str = Field(..., description="Error message")
-    error_type: str = Field(..., description="Type of error")
-    timestamp: datetime = Field(
-        default_factory=lambda: datetime.now(timezone.utc),
-        description="Error timestamp"
-    )
+    except DatasetCreateFailedError as exc:
+        await ctx.error("Creation failed: %s" % (str(exc),))
+        return MyResponse(error=f"Failed: {exc}")
 
-@tool
-def my_tool(id: int) -> MyResponse:
-    try:
-        result = process_data(id)
-        return MyResponse(data=result)
-    except NotFound:
-        raise ValueError(f"Resource {id} not found")
+    except Exception as exc:
+        # Outermost safety net: log and re-raise (middleware handles it)
+        await ctx.error("Unexpected: %s: %s" % (type(exc).__name__, str(exc)))
+        raise
 ```
 
-### 8. Dataset Validation for Chart Tools
+### 10. Dataset Validation for Chart Tools
 
-**IMPORTANT**: All chart-related tools must validate that the chart's dataset is accessible before performing operations. Use the shared `validate_chart_dataset` utility from `chart_utils.py`.
+All chart-related tools must validate that the chart's dataset is accessible:
 
-**Why this matters**: Charts can reference datasets that have been deleted or become inaccessible. Without validation, users may see confusing errors when trying to preview or get data from charts with missing datasets.
-
-**Usage pattern**:
 ```python
 from superset.mcp_service.chart.chart_utils import validate_chart_dataset
 
-# After retrieving a chart, validate its dataset
 validation_result = validate_chart_dataset(chart, check_access=True)
 if not validation_result.is_valid:
     await ctx.warning("Dataset not accessible: %s" % (validation_result.error,))
     return ChartError(
         error=validation_result.error or "Chart's dataset is not accessible",
         error_type="DatasetNotAccessible",
     )
-
-# Log any warnings (e.g., virtual dataset warnings)
-for warning in validation_result.warnings:
-    await ctx.warning("Dataset warning: %s" % (warning,))
 ```
 
-**Tools that use this pattern**:
-- `get_chart_info` - Validates after retrieving chart metadata
-- `get_chart_preview` - Validates before generating preview
-- `get_chart_data` - Validates before querying data
-- `generate_chart` - Validates after chart creation (post-creation validation)
-
-**The `DatasetValidationResult` contains**:
-- `is_valid`: Whether the dataset exists and is accessible
-- `dataset_id`: The dataset ID being validated
-- `dataset_name`: The dataset name (if found)
-- `warnings`: List of warnings (e.g., "virtual dataset may be deleted")
-- `error`: Error message if validation failed
-
-## Testing Conventions
+Used by: `get_chart_info`, `get_chart_preview`, `get_chart_data`, `generate_chart`
 
-### Unit Tests
+### 11. Compile Check for Chart Creation
 
-Place unit tests in `tests/unit_tests/mcp_service/{module}/tool/test_{tool_name}.py`
+When creating or saving charts, run a compile check to verify the query executes:
 
-**Test structure**:
 ```python
-from unittest.mock import MagicMock, patch
-import pytest
+from superset.mcp_service.chart.tool.generate_chart import _compile_chart
 
-class TestMyTool:
-    @pytest.fixture
-    def mock_dao(self):
-        """Create mock DAO for testing."""
-        dao = MagicMock()
-        dao.find_by_id.return_value = create_mock_object()
-        return dao
+compile_result = _compile_chart(form_data, dataset.id)
+if not compile_result.success:
+    # Delete broken chart, return error
+    ...
+```
 
-    @patch("superset.mcp_service.chart.tool.my_tool.ChartDAO")
-    def test_my_tool_success(self, mock_dao_class, mock_dao):
-        """Test successful tool execution."""
-        mock_dao_class.return_value = mock_dao
+### 12. Flexible Input Parsing
 
-        result = my_tool(id=1)
+`ModelListCore` handles JSON string vs. native object parsing automatically via utilities in `superset.mcp_service.utils.schema_utils`:
 
-        assert result.data is not None
-        mock_dao.find_by_id.assert_called_once_with(1)
-```
+- `parse_json_or_passthrough(value, param_name)` - JSON string or dict
+- `parse_json_or_list(value, param_name)` - JSON array, list, or comma-separated string
+- `parse_json_or_model(value, model_class, param_name)` - JSON string or dict to Pydantic model
+- `parse_json_or_model_list(value, model_class, param_name)` - JSON array to list of Pydantic models
 
-### Integration Tests
+These are used internally by `ModelListCore` for `filters` and `select_columns`. Individual tools using core classes do NOT need to add parsing logic.
 
-Use Flask test client for integration tests:
+## Middleware
 
-```python
-def test_tool_with_flask_context(app):
-    """Test tool with full Flask app context."""
-    with app.app_context():
-        result = my_tool(id=1)
-        assert result is not None
-```
+The MCP service uses FastMCP middleware (registered in `server.py`):
 
-## Common Pitfalls to Avoid
+| Middleware | Purpose |
+|-----------|---------|
+| `LoggingMiddleware` | Logs tool calls with duration, entity IDs, sanitizes sensitive data |
+| `GlobalErrorHandlerMiddleware` | Catches unhandled exceptions, converts to ToolError |
+| `StructuredContentStripperMiddleware` | Strips structuredContent from responses (Claude.ai compatibility) |
+| `ResponseSizeGuardMiddleware` | Prevents oversized responses from crashing clients |
+| `ResponseCachingMiddleware` | Optional response caching (in-memory by default, Redis when store enabled) |
 
-### 1. ❌ Forgetting Tool Import in app.py
-**Problem**: Tool exists but isn't available to MCP clients.
-**Solution**: Always add tool import to `app.py` (at the bottom) after creating it. Never add to `server.py`.
+Middleware is applied in `server.py` and should NOT be modified in individual tools.
 
-### 2. ❌ Adding Tool Imports to server.py
-**Problem**: Tools won't register properly, causing runtime errors.
-**Solution**: Tool imports must be in `app.py` at the bottom of the file, not in `server.py`. The `server.py` file is only for running the server.
+## Configuration
 
-### 3. ❌ Missing Authentication
-**Problem**: Tool bypasses authentication and authorization.
-**Solution**: Always use `@tool` with default protect=True, or explicitly set protect=False only for public tools.
+Default configuration is in `mcp_config.py`. Override in `superset_config.py`:
 
-### 4. ❌ Using `Optional` Instead of Union Syntax
-**Problem**: Old-style Optional[T] is not Python 3.10+ style.
-**Solution**: Use `T | None` instead of `Optional[T]` for all type hints.
 ```python
-# GOOD - Modern Python 3.10+ syntax
-def my_function(param: str | None = None) -> int | None:
-    pass
-
-# BAD - Old-style Optional
-from typing import Optional
-def my_function(param: Optional[str] = None) -> Optional[int]:
-    pass
+# Authentication
+MCP_DEV_USERNAME = None          # Fallback username for dev mode
+MCP_AUTH_ENABLED = False         # Enable JWT/API key auth
+MCP_AUTH_FACTORY = None          # Custom auth factory function
+MCP_JWT_PUBLIC_KEY = None
+MCP_JWT_SECRET = None
+MCP_JWKS_URI = None
+MCP_USER_RESOLVER = None         # Custom function to extract username from JWT
+
+# RBAC
+MCP_RBAC_ENABLED = True          # Enable permission checking (default: True)
+
+# Request Parsing
+MCP_PARSE_REQUEST_ENABLED = True # Accept JSON string requests (workaround for client bugs)
+
+# Response Caching (optional, uses in-memory store by default; Redis when MCP_STORE_CONFIG enabled)
+MCP_CACHE_CONFIG = {
+    "enabled": False,
+    "list_tools_ttl": 300,
+    "call_tool_ttl": 3600,
+    "excluded_tools": ["execute_sql", "generate_dashboard", ...],

Review Comment:
   The config example includes an ellipsis (`...`) inside a Python list, which is not copy/paste-safe for users applying this snippet directly to `superset_config.py`. Consider replacing it with a commented placeholder (e.g., `# ...`) or a clearly indicated sentinel string so the example remains valid Python.
   ```suggestion
       "excluded_tools": [
           "execute_sql",
           "generate_dashboard",
           # Add other tool names here
       ],
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39348:
URL: https://github.com/apache/superset/pull/39348#issuecomment-4253452040

   **Bito Automatic Review Skipped – PR Already Merged**<br/><br/>Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.<br/>No action is needed if you didn't intend to review it. To get a review, you can type `/review` in a comment and save it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39348:
URL: https://github.com/apache/superset/pull/39348#issuecomment-4253018992

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/24460784148) for [9ffb504](https://github.com/apache/superset/commit/9ffb504)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on PR #39348:
URL: https://github.com/apache/superset/pull/39348#issuecomment-4252984991

   This is jus a claude.md change. it doesnt change the code. not sure why we need to test the environtment as this is really only for the development cycle. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39348:
URL: https://github.com/apache/superset/pull/39348#issuecomment-4251030804

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/24447953235) for [82354d1](https://github.com/apache/superset/commit/82354d1)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39348:
URL: https://github.com/apache/superset/pull/39348#issuecomment-4251144994

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) deployed environment on [GHA](https://github.com/apache/superset/actions/runs/24447953235) for [82354d1](https://github.com/apache/superset/commit/82354d1)
   
   • **Environment:** http://54.68.169.30:8080 (admin/admin)
   • **Lifetime:** 48h auto-cleanup
   • **Updates:** New commits create fresh environments automatically


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #39348:
URL: https://github.com/apache/superset/pull/39348#issuecomment-4245547530

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/39348?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 55.11%. Comparing base ([`1aac6c9`](https://app.codecov.io/gh/apache/superset/commit/1aac6c94741aa24b00b46f910052e2e1f946a081?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`baa2874`](https://app.codecov.io/gh/apache/superset/commit/baa287499f7a5fbcd63cf04814c22cb1303be28c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 119 commits behind head on master.
   > :exclamation:  There is a different number of reports uploaded between BASE (1aac6c9) and HEAD (baa2874). Click for more details.
   > 
   > <details><summary>HEAD has 47 uploads less than BASE</summary>
   >
   >| Flag | BASE (1aac6c9) | HEAD (baa2874) |
   >|------|------|------|
   >|python|44|1|
   >|presto|5|1|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #39348      +/-   ##
   ==========================================
   - Coverage   64.41%   55.11%   -9.30%     
   ==========================================
     Files        2536     2544       +8     
     Lines      131155   132111     +956     
     Branches    30450    30591     +141     
   ==========================================
   - Hits        84485    72815   -11670     
   - Misses      45207    58644   +13437     
   + Partials     1463      652     -811     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/39348/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/39348/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/39348/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/39348/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/39348/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.75% <ø> (+1.66%)` | :arrow_up: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/39348/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.75% <ø> (-20.84%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/39348/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/39348/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/39348?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi merged PR #39348:
URL: https://github.com/apache/superset/pull/39348


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39348:
URL: https://github.com/apache/superset/pull/39348#issuecomment-4245393787

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #39348:
URL: https://github.com/apache/superset/pull/39348#issuecomment-4245424276

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | baa287499f7a5fbcd63cf04814c22cb1303be28c |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/69de65e2abae190008fa75d3 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-39348--superset-docs-preview.netlify.app](https://deploy-preview-39348--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTM5MzQ4LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.rJttVQZzSsCp3sJ17sRG5wCAK5bfsn549yoV0x08Lfo)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-39348--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(mcp): update CLAUDE.md to reflect current codebase patterns [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39348:
URL: https://github.com/apache/superset/pull/39348#issuecomment-4253163771

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) deployed environment on [GHA](https://github.com/apache/superset/actions/runs/24460784148) for [9ffb504](https://github.com/apache/superset/commit/9ffb504)
   
   • **Environment:** http://44.248.57.88:8080 (admin/admin)
   • **Lifetime:** 48h auto-cleanup
   • **Updates:** New commits create fresh environments automatically


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org