manojshetty2004 opened a new pull request, #38525:
URL: https://github.com/apache/superset/pull/38525
fix(mcp): make fastmcp optional during MCP tool registration
### SUMMARY
`fastmcp` is currently imported directly in
`superset/core/mcp/core_mcp_injection.py` when registering MCP tools. Since
`fastmcp` is an optional dependency, this can cause Superset to fail during
startup if the package is not installed.
This change wraps the `fastmcp` import in a try/except ImportError block.
When `fastmcp` is not available, MCP tool registration is skipped and a warning
is logged instead.
This allows Superset to start normally without requiring the optional
`fastmcp` dependency while preserving existing behavior when `fastmcp` is
installed.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable (backend change).
### TESTING INSTRUCTIONS
1. Uninstall fastmcp
pip uninstall fastmcp
2. Start Superset
superset run -p 8088
3. Verify Superset starts without ModuleNotFoundError: fastmcp
4. Install fastmcp again
pip install fastmcp
5. Restart Superset and confirm MCP tools register normally
### ADDITIONAL INFORMATION
- [x] Has associated issue: Fixes #38514
- [ ] Required feature flags
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]