-
Notifications
You must be signed in to change notification settings - Fork 660
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When setting extensions in server capabilities, they are not being included in the initialize message.
To Reproduce
Steps to reproduce the behavior:
- Start up a very minimal asp.net server with the following (add an extension):
using System.Text.Json.Nodes;
using ModelContextProtocol.Protocol;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();
builder
.Services.AddMcpServer(options =>
{
options.Capabilities ??= new ServerCapabilities();
#pragma warning disable MCPEXP001
options.Capabilities.Extensions ??= new Dictionary<string, object>();
options.Capabilities.Extensions.Add("io.myext", new JsonObject { ["required"] = true });
#pragma warning restore MCPEXP001
})
.WithHttpTransport();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
}
app.UseHttpsRedirection();
app.MapMcp("/mcp");
app.Run();- Use postman, send a json request. Observe extensions are not included:
Expected behavior
The server capabilities should have the extensions property, which should include io.myext as configured.
Logs
Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working