aminghadersohi commented on issue #29839:
URL: https://github.com/apache/superset/issues/29839#issuecomment-3815555581
Really clean work on this. The ambient context pattern with contextvars is
slick - having tasks call get_context() anywhere without threading it through
every function signature is way nicer than what we have in MCP right now where
context gets passed explicitly.
The on_abort auto-registration is clever too - first handler registered =
marks abortable + starts listener. No ceremony required.
One question on integration: if I wanted to trigger a GTF task from an MCP
tool and have the MCP client track its progress, what would that look like? I'm
thinking something like:
```
@mcp_tool(task=True)
async def run_report(report_id: int, ctx: MCPContext):
# Create GTF task
gtf_task = generate_report.schedule(report_id=report_id)
# Bridge GTF progress → MCP progress?
while not gtf_task.is_terminal:
status = gtf_task.poll()
await ctx.report_progress(status.progress, 100, status.message)
```
Is there a way to subscribe to GTF task updates (maybe via the Redis pub/sub
channel) so MCP doesn't have to poll? Or would you see GTF eventually
supporting a callback/webhook pattern for external integrations?
--
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]