Declare what your application knows. Declare how the world reaches it.
public sealed class Todo : Entity<Todo>
{
public string Title { get; set; } = "";
public bool Done { get; set; }
}
[Route("api/todos")]
public sealed class TodosController : EntityController<Todo>;Entity. Controller. Done.
Run it and /api/todos is a persisted, queryable HTTP API.
No DbContext. No repository. No schema script. No CRUD service. No endpoint mapping.
dotnet new install Sylin.Koan.Templates
dotnet new koan-web -o TodoApi
cd TodoApi
dotnet run -- --urls http://localhost:5000Create a Todo. Read it back. It survives the restart.
Invoke-RestMethod -Method Post -Uri http://localhost:5000/api/todos `
-ContentType application/json -Body '{"title":"buy milk"}'
Invoke-RestMethod http://localhost:5000/api/todosAdd Koan's MCP package and one declaration:
dotnet add package Sylin.Koan.Mcp+using Koan.Mcp;
+
+[McpEntity(Name = "Todo", Description = "Work the team intends to finish")]
public sealed class Todo : Entity<Todo>Now an MCP client can discover and work with the same Todo, through the same model and access
rules as the rest of your application.
No second domain model. No mirrored service. No handwritten tool handlers.
Today it is a local SQLite API. Tomorrow it can use Postgres, run durable work, publish events, search semantically, serve media, or collaborate with an agent.
Add only what the application needs. The code keeps saying Todo.
Underneath, it's still ASP.NET Core. Reach for a normal controller or service whenever you want one. Want to look behind the magic? Koan tells you what it chose and why.
- Build your first Koan application
- Bring Koan into an existing ASP.NET Core application
- Run complete applications
- Build for agents
- Understand the architecture
- See what works today
Koan 0.20 is a .NET 10 preview.