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

[PR] (feat): Allow specific mcp tools to be disabled [superset]

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

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   Adds a new `MCP_DISABLED_TOOLS` configuration option that lets operators remove specific built-in MCP tools from the server at startup. Disabled tools are silently omitted from tool discovery, so AI clients never see them.
   
   **Motivation**: Deployments that add custom extension tools may need to suppress the built-in versions to avoid conflicts or to restrict access to specific capabilities (e.g. disabling `execute_sql`). 
   
   Design:
   
   - `MCP_DISABLED_TOOLS: set[str]` is set in superset_config.py (the standard Superset config entry-point).
   - The new `_remove_disabled_tools()` helper is called from `init_fastmcp_server()` before the server starts serving, using `flask_app.config.get("MCP_DISABLED_TOOLS", set())` — the standard Superset Flask config pattern.
   - Unknown tool names log a WARNING instead of raising, so a typo doesn't crash the server.
   - The default is `set()` (empty) — no tools are disabled out of the box.
   
   Example `superset_config.py`:
   
   ```python
   # Disable tools that are replaced by custom extension tools in this deployment
   MCP_DISABLED_TOOLS = {"execute_sql", "health_check"}
   ```
   
   Extension-prefixed tools can also be disabled by full name:
   ```python
   MCP_DISABLED_TOOLS = {"extensions.myorg.myext.some_tool"}
   ```
   
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   https://github.com/user-attachments/assets/9310f299-894c-4346-b4f1-4b06428a01f8
   
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] 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] (feat): Allow specific mcp tools to be disabled [superset]

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

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/39835?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `11.11111%` with `8 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 55.36%. Comparing base ([`ad73395`](https://app.codecov.io/gh/apache/superset/commit/ad73395c89421de2ca365cb1595f5c77ac3be988?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`2c14b98`](https://app.codecov.io/gh/apache/superset/commit/2c14b98e7e90939124e6cc99757424a8506bb2b8?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/39835?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset/mcp\_service/app.py](https://app.codecov.io/gh/apache/superset/pull/39835?src=pr&el=tree&filepath=superset%2Fmcp_service%2Fapp.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvbWNwX3NlcnZpY2UvYXBwLnB5) | 12.50% | [7 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/39835?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/mcp\_service/mcp\_config.py](https://app.codecov.io/gh/apache/superset/pull/39835?src=pr&el=tree&filepath=superset%2Fmcp_service%2Fmcp_config.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvbWNwX3NlcnZpY2UvbWNwX2NvbmZpZy5weQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/39835?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #39835      +/-   ##
   ==========================================
   - Coverage   64.35%   55.36%   -9.00%     
   ==========================================
     Files        2569     2569              
     Lines      134684   134693       +9     
     Branches    31254    31255       +1     
   ==========================================
   - Hits        86679    74567   -12112     
   - Misses      46509    59467   +12958     
   + Partials     1496      659     -837     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/39835/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/39835/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/39835/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/39835/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.42% <11.11%> (-0.01%)` | :arrow_down: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/39835/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.42% <11.11%> (-20.09%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/39835/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/39835/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/39835?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] feat: Allow specific mcp tools to be disabled [superset]

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

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </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] feat: Allow specific mcp tools to be disabled [superset]

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

   Hey @richardfogaca @aminghadersohi. Thanks both for taking a look. About the second set of comments:
   
   
   ### Point 1 — Instruction/tool-registry drift
   
   `get_instance_info` is now fully handled: all five prose references to it (the "Feature Availability" block, the `get_instance_info returns current_user.roles` Permission Awareness bullet, the `accessible_menus from get_instance_info` bullet, the "start with get_instance_info" paragraph, and the "When you first connect, call get_instance_info" paragraph) are omitted when that tool is disabled — not just the bullet entry.
   
   For every other tool the current implementation only removes the `- tool_name: description` bullet line. I ran an analysis of the full instructions string to map out all prose references beyond the bullet list:
   
   | Tool | Prose refs | What's affected |
   |------|-----------|-----------------|
   | `execute_sql` | 6 | "To explore data with SQL" workflow steps + CRITICAL RULES reference |
   | `generate_chart` | 8 | "To create a chart" workflow, `generate_explore_link vs generate_chart` section |
   | `generate_explore_link` | 7 | Same as above |
   | `add_chart_to_existing_dashboard` | 4 | "To add a chart to an existing dashboard" + CRITICAL RULES |
   | `generate_dashboard` | 4 | CRITICAL RULES + "To add a chart" workflow |
   | `get_dataset_info` | 5 | "Using Saved Metrics vs Columns", workflow examples |
   | `list_charts` / `list_dashboards` / `list_datasets` / `list_databases` | 2–9 | Workflow examples, query examples |
   | `get_chart_info` | 3 | Request Wrapper example, "To modify an existing chart" workflow |
   | `update_chart` | 5 | "To modify an existing chart" workflow, CRITICAL RULES |
   | `get_schema` | 2 | General tips section |
   | `create_virtual_dataset`, `query_dataset`, `save_sql_query`, `open_sql_lab_with_context` | 1–2 | Workflow steps |
   
   Two options to close this gap:
   
   **Option A — More `_SNIPPET_*` constants** (what was done for `get_instance_info`): gate entire workflow sections behind a check on their key tool. More explicit, but each tool's prose is scattered across multiple sections (e.g. `execute_sql` appears in the workflow section _and_ in CRITICAL RULES), making this hard to do cleanly without fragmenting the instructions string further.
   
   **Option B — General line filter** (extension of the existing bullet filter): after building the f-string, remove any line that contains a disabled tool name anywhere on the line. The existing filtering loop already iterates every line; it just needs a second pass that checks `any(tool in line for tool in _disabled)`. This handles all of the above in ~5 extra lines and is robust to future additions to the instructions string. False positives are extremely low given these names (`execute_sql`, `generate_chart`, etc.) are specific.
   
   My preference is **Option B** — it closes the gap comprehensively and keeps the instructions string readable. Happy to implement it if you agree.
   
   ---
   
   ### Point 2 — `local_provider.remove_tool` vs `mcp.disable()`
   
   FastMCP 3.2.4 does expose a public visibility API:
   
   ```python
   mcp.disable(names={"tool_name"}, components={"tool"})
   ```
   
   This adds a visibility transform that marks the tool as disabled in the tool listing. It is the cleaner, officially public API.
   
   However, there is a meaningful behavioural difference worth considering:
   
   - **`mcp.disable()`** — hides the tool from `tools/list` responses so clients won't discover it during tool enumeration, but a client that already knows the tool name _may_ still be able to call it directly (depending on whether FastMCP enforces visibility on execution as well as listing).
   - **`mcp.local_provider.remove_tool()`** — removes the tool entirely from the provider registry; it cannot be called at all.
   
   For an operator escape hatch intended to prevent misuse (e.g. replacing `execute_sql` with a stricter extension), the `remove_tool` behaviour is stronger. But if FastMCP enforces visibility on both listing _and_ execution then `mcp.disable()` is equivalent and preferable as the public API.
   
   I can switch to `mcp.disable()` — would you like me to verify whether FastMCP enforces visibility on call execution as well as listing, and switch if it does? Or would you prefer `remove_tool` be kept for the stronger guarantee?


-- 
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] (feat): Allow specific mcp tools to be disabled [superset]

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

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 2c14b98e7e90939124e6cc99757424a8506bb2b8 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/69f5d75345be8d00088634fa |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-39835--superset-docs-preview.netlify.app](https://deploy-preview-39835--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.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTM5ODM1LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.yflVbA9nD7sAgLVAqY8GTuIN4LIhQfFKCELuX_O4SCc)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcvBCcMwDEDRXXSuwJA4dbpBx5AtmRqUSsSGUkJ3ry-ff3kX-GmHD3gA3CCf9C6v-VVoIKnaB7tLabUVPIrjMNM-i1mQW6eswtOxuNr3yVNue418j8sasyQOIaS0LWsl-P0B) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-39835--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] feat: Allow specific mcp tools to be disabled [superset]

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

   Thanks for the thorough analysis — the `get_instance_info` snippet approach is clean and the table of prose refs per tool is exactly the right way to scope the remaining work.
   
   **Option B — go for it.** A general line-level filter (`any(tool in line for tool in _disabled)`) is the right trade-off: Option A would fragment the instructions into ~60 constants across ~15 tools, which hurts readability. Option B closes the gap in ~5 lines. One thing worth adding alongside the implementation: a test for at least one prose-heavy tool (e.g., `execute_sql`) mirroring `test_disabling_get_instance_info_removes_all_prose_references` — just assert that the SQL workflow examples or the `execute_sql` request wrapper example are absent when `execute_sql` is disabled.
   
   **`remove_tool()` — keep it.** Your analysis is right. `disable()` hides from listing but may still allow direct invocation; `remove_tool()` removes the tool entirely. For an operator escape hatch designed to replace built-in tools with stricter versions, the hard-removal semantics are the correct choice. If FastMCP later documents that `disable()` enforces on execution too, switching can be a follow-up.
   
   The `local_provider` fix, the `set(MCP_DISABLED_TOOLS)` copy, and the dead-patch cleanup all look good — those are done.


-- 
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] feat: Allow specific mcp tools to be disabled [superset]

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

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </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] feat: Allow specific mcp tools to be disabled [superset]

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


-- 
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] feat: Allow specific mcp tools to be disabled [superset]

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

   <!-- Bito Reply -->
   The flagged logic error is valid. The default instructions are generated statically before disabled tools are removed from the runtime registry, causing the instructions to include descriptions of tools that clients can't actually call. To resolve this, modify `get_default_instructions` to dynamically generate tool descriptions based on the active tool registry (`mcp.list_tools()`) after disabled tools are removed. Move the `_remove_disabled_tools` call before instructions generation in `init_fastmcp_server`.
   
   **superset/mcp_service/app.py**
   ```
   def init_fastmcp_server(
       name: str | None = None,
       instructions: str | None = None,
       # ... other params
   ):
       # ... existing code ...
   
       disabled_tools = flask_app.config.get("MCP_DISABLED_TOOLS", set())
       _remove_disabled_tools(disabled_tools)
   
       if instructions is None:
           instructions = get_default_instructions(branding)
   
       # ... rest of function ...
   
   def get_default_instructions(branding):
       tools = mcp.list_tools()
       instructions = f"You are {branding}, an AI assistant with access to Superset tools.\n\nAvailable tools:\n"
       for tool in tools:
           instructions += f"{tool.name}: {tool.description}\n"
       # Add any static instructions after the tools
       return instructions
   ```


-- 
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] (feat): Allow specific mcp tools to be disabled [superset]

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

   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] feat: Allow specific mcp tools to be disabled [superset]

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

   I like the direction of `MCP_DISABLED_TOOLS` as an operator escape hatch, especially for deployments that want to replace built-in write/object-creation tools with stricter extension tools.
   
   One thing I’d like to see before merge: can we make the default instructions fully capability-aware, not just filter the `- tool_name:` bullets? For example, if `execute_sql` is disabled, several SQL workflow examples/rules still mention it; if `get_instance_info` is disabled, the startup guidance still tells clients to call it. That could leave clients with instructions for tools they cannot call.
   
   Also, would it be worth using the public server visibility API if available in our pinned dependency version, e.g. disabling `tool:<name>` via the server visibility layer, instead of removing from `_local_provider` directly? That seems closer to the intent: hide from listing and prevent calls without mutating provider internals.
   
   Overall I’m +1 on the feature direction; I think the main thing is avoiding instruction/tool-registry drift.
   


-- 
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] feat: Allow specific mcp tools to be disabled [superset]

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


##########
superset/mcp_service/app.py:
##########
@@ -596,6 +615,8 @@ def init_fastmcp_server(
     if instructions is None:
         instructions = get_default_instructions(branding)
 
+    _remove_disabled_tools(flask_app.config.get("MCP_DISABLED_TOOLS", set()))

Review Comment:
   Nice spot. Did not see this before



-- 
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] feat: Allow specific mcp tools to be disabled [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 #39835:
URL: https://github.com/apache/superset/pull/39835#discussion_r3176529003


##########
superset/mcp_service/app.py:
##########
@@ -596,6 +615,8 @@ def init_fastmcp_server(
     if instructions is None:
         instructions = get_default_instructions(branding)
 
+    _remove_disabled_tools(flask_app.config.get("MCP_DISABLED_TOOLS", set()))

Review Comment:
   **Suggestion:** Disabled tools are removed from runtime registration but the default instructions text is still generated with the full static tool list, so clients can still be told to call tools that were disabled and will then fail at runtime with tool-not-found errors. Regenerate/filter the instructions based on the active tool registry after applying `MCP_DISABLED_TOOLS`. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Instructions reference tools removed by MCP_DISABLED_TOOLS configuration.
   - ⚠️ Tool discovery via mcp.list_tools remains accurate for clients.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. In `superset/mcp_service/app.py`, `get_default_instructions()` at lines 34–128 returns
   a long static instructions string that explicitly documents built-in tools such as
   `execute_sql`, `list_charts`, and `health_check` (e.g., `health_check: Simple health check
   tool` around line 88).
   
   2. The global MCP instance `mcp` is created once via `create_mcp_app()` and tools are
   registered by the imports at lines 104–159;
   `tests/unit_tests/mcp_service/test_mcp_tool_registration.py:32–42` verifies that
   `mcp.list_tools()` initially includes `health_check` and `list_charts`.
   
   3. `init_fastmcp_server()` in `superset/mcp_service/app.py` at lines 181–252 derives
   branding from the Flask app and, when `instructions` is `None`, sets `instructions =
   get_default_instructions(branding)` at line 221 before applying
   `_remove_disabled_tools(flask_app.config.get("MCP_DISABLED_TOOLS", set()))` at line 618.
   
   4. Configure `MCP_DISABLED_TOOLS = {"health_check"}` via Flask config (matching the
   pattern in `superset/mcp_service/mcp_config.py:10–21` and the mocks in
   `tests/unit_tests/mcp_service/test_mcp_tool_registration.py:109–123`), then call
   `init_fastmcp_server()`. After the call, `mcp._local_provider.remove_tool("health_check")`
   (line 566) ensures `health_check` no longer appears in `mcp.list_tools()`, while
   `mcp._mcp_server.instructions` still contains the `health_check` description from
   `get_default_instructions()`. This produces a concrete mismatch where server instructions
   advertise a tool that is no longer in the active tool registry. Although MCP clients
   typically rely on tool discovery (so protocol-level calls will fail early if they only use
   discovered tools), the textual instructions remain stale and can mislead LLM-driven
   clients that follow them verbatim.
   ```
   </details>
   
   [Fix in Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset%2Fmcp_service%2Fapp.py%0A%2A%2ALine%3A%2A%2A%20618%3A618%0A%2A%2AComment%3A%2A%2A%0A%09%2ALogic%20Error%3A%20Disabled%20tools%20are%20removed%20from%20runtime%20registration%20but%20the%20default%20instructions%20text%20is%20still%20generated%20with%20the%20full%20static%20tool%20list%2C%20so%20clients%20can%20still%20be%20told%20to%20call%20tools%20that%20were%20disabled%20and%20will%20then%20fail%20at%20runtime%20with%20tool-not-found%20errors.%20Regenerate%2Ffilter%20the%20instructions%20based%20on%20the%20active%20tool%20registry%20after%20applying%20%60MCP_DISABLED_TOOLS%60.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F%20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%
 20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A) | [Fix in VSCode Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset%2Fmcp_service%2Fapp.py%0A%2A%2ALine%3A%2A%2A%20618%3A618%0A%2A%2AComment%3A%2A%2A%0A%09%2ALogic%20Error%3A%20Disabled%20tools%20are%20removed%20from%20runtime%20registration%20but%20the%20default%20instructions%20text%20is%20still%20generated%20with%20the%20full%20static%20tool%20list%2C%20so%20clients%20can%20still%20be%20told%20to%20call%20tools%20that%20were%20disabled%20and%20will%20then%20fail%20at%20runtime%20with%20tool-not-found%20errors.%20Regenerate%2Ffilter%20the%20instructions%20based%20on%20the%20acti
 ve%20tool%20registry%20after%20applying%20%60MCP_DISABLED_TOOLS%60.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F%20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/mcp_service/app.py
   **Line:** 618:618
   **Comment:**
   	*Logic Error: Disabled tools are removed from runtime registration but the default instructions text is still generated with the full static tool list, so clients can still be told to call tools that were disabled and will then fail at runtime with tool-not-found errors. Regenerate/filter the instructions based on the active tool registry after applying `MCP_DISABLED_TOOLS`.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39835&comment_hash=f32840d7417eaef8b012a5ce059a3cf6c4185baead80b37e3e515ac65b6078c8&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39835&comment_hash=f32840d7417eaef8b012a5ce059a3cf6c4185baead80b37e3e515ac65b6078c8&reaction=dislike'>👎</a>



-- 
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] feat: Allow specific mcp tools to be disabled [superset]

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

   Hey @richardfogaca, think it's ready when you are 😄 


-- 
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] feat: Allow specific mcp tools to be disabled [superset]

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

   Thanks so much @aminghadersohi! I _think_ this removes any mention of a disabled tool. When you have a chance, give it a look and let me know


-- 
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