Back to Integrations

ASP.NET Core Quickstart

Use Swashbuckle to publish OpenAPI and generate MCP servers. Follow the flowchart below to set up your spec and link it with LegacyAI.

01

Expose OpenAPI Specification

Enable Swagger support in your ASP.NET Core API using Swashbuckle to generate and host the OpenAPI schema definition.

// Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

var app = builder.Build();
if (app.Environment.IsDevelopment())
{
    app.UseSwagger(); // Generates raw swagger.json
    app.UseSwaggerUI();
}

app.MapControllers();
app.Run();
csharp
Tip:

Run the application and check the generated schema at http://localhost:5000/swagger/v1/swagger.json.

02

Generate the MCP Server

Link the Swagger endpoint in LegacyAI. Choose "ASP.NET Core" in the project wizard and submit http://localhost:5000/swagger/v1/swagger.json.

Tip:

You can upload the swagger.json file directly if your local dev port is not publicly accessible.

03

Register in Claude Desktop

Add the generated server configuration block into the Claude Desktop configuration.

{
  "mcpServers": {
    "legacy-aspnet-tools": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-openapi", "http://localhost:5000/swagger/v1/swagger.json"]
    }
  }
}
json
Tip:

Locate your config file at %APPDATA%\Claude\claude_desktop_config.json on Windows.

04

Test in Claude Desktop

Open Claude Desktop. Ask: "retrieve data using my aspnet tools" to check if the connection is active.

Flowchart Complete