Fix AspNetCore README (#170)
* Use Cache-Control: no-store * Fix AspNetCore README * remove and sort
This commit is contained in:
parent
4c537ef86b
commit
ce89fa0b50
2 changed files with 5 additions and 4 deletions
|
|
@ -40,7 +40,7 @@ public static class McpEndpointRouteBuilderExtensions
|
|||
var requestAborted = context.RequestAborted;
|
||||
|
||||
response.Headers.ContentType = "text/event-stream";
|
||||
response.Headers.CacheControl = "no-cache";
|
||||
response.Headers.CacheControl = "no-store";
|
||||
|
||||
var sessionId = MakeNewSessionId();
|
||||
await using var transport = new SseResponseStreamTransport(response.Body, $"/message?sessionId={sessionId}");
|
||||
|
|
@ -53,10 +53,10 @@ public static class McpEndpointRouteBuilderExtensions
|
|||
try
|
||||
{
|
||||
var transportTask = transport.RunAsync(cancellationToken: requestAborted);
|
||||
runSession ??= RunSession;
|
||||
|
||||
try
|
||||
{
|
||||
runSession ??= RunSession;
|
||||
await runSession(context, server, requestAborted);
|
||||
}
|
||||
finally
|
||||
|
|
|
|||
|
|
@ -23,15 +23,16 @@ To get started, install the package from NuGet
|
|||
|
||||
```
|
||||
dotnet new web
|
||||
dotnet add package ModelContextProtocol.AspNetcore --prerelease
|
||||
dotnet add package ModelContextProtocol.AspNetCore --prerelease
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
```csharp
|
||||
// Program.cs
|
||||
using ModelContextProtocol;
|
||||
using ModelContextProtocol.AspNetCore;
|
||||
using ModelContextProtocol.Server;
|
||||
using System.ComponentModel;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.WebHost.ConfigureKestrel(options =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue