Skip to content

Context: Support stream message api #304

Closed as duplicate
Closed as duplicate

Description

@ioo0s

Is your feature request related to a problem? Please describe.
Implement context to support stream message transmission

Describe the solution you'd like
example:

@mcp.tool()
async def demo_tool(ctx: Context):
    for i in range(3):
        message: dict = {"content": "id:{}".format(i), "type": "ai"}
        await ctx.stream(message)

Activity

  1. tanhaipeng commented on Mar 18, 2025

    @tanhaipeng

    need this feature!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions