Azure-Samples / Azure-Samples/remote-mcp-functions-dotnet

Supports from streaming output

Open
#85 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
134
Forks
74
PR merge metrics
No merged PRs in 30d

Description

As far as I can tell, I do not see support for streaming output.

Let’s consider the fowlloing use case:

```csharp
[Function(nameof(McpFunction))]
public async Task McpFunction(
[McpToolTrigger("return_string", "returns the numbers in the Fibonacci sequence up to a given limit.")] ToolInvocationContext context,
FunctionContext functionContext,
CancellationToken cancellationToken
)
{

return "1, 1, 2, 3, 5, 8, 13, 21";
}
```

What If I want to stream the results up to a potentially unbounded limit?
I think this use case is not realistic, but it is really to drive the point home.

I would expect to be able to use `ToolInvocationContext` and from there, acquire some kind of `SendResponseAsync(…)`-ish method to the client, while the function is still running and computing results.

Am I missing something obvious ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.