Never tried it, although ServiceStack itself is just another middleware in an ASP .NET Core App, it shouldn’t affect other middleware that’s registered before it. Does it work without running ServiceStack? (i.e. app.UseServiceStack())
Yes I tried to use it before registering ServiceStack
app.UseServiceStack(new AppHost());
but i couldn’t connect to the MCP Server.
It works in a normal WebApp
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using ModelContextProtocol.Server;
namespace MyMcpServer
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMcpServer().WithHttpTransport().WithToolsFromAssembly();
var app = builder.Build();
app.MapMcp();
app.Run();
}
}
}