Skip to content
Clean Model Context Protocol
Lean Mean Clean Apps

Five templates, one brand, one search box. Everything in the docs is in here, including the bits we hoped you'd skim.

Try one of these

Results say which template they came from, so you won't end up reading about Lambda when you wanted GraphQL. Again.

Ship the container

The run stage of the Dockerfile is the whole server: one image, built on mcr.microsoft.com/dotnet/aspnet:10.0-alpine, that listens on port 7320 and runs as the image’s non-root app user. It runs anywhere a container runs, which these days is everywhere, including a surprising number of fridges.

Terminal window
docker build . --target run --tag worksonmymachine-movies:1.2.3 \
--build-arg VERSION_PREFIX=1.2.3

The version is stamped into the assemblies, so the version tool tells you exactly which build is running. See the configuration reference for every build argument.

DOTNET_ENVIRONMENT chooses which appsettings.*.json file is layered on top of appsettings.json.

Environment Logs Sample data Meant for
local Console On dotnet run on your machine
docker Console, and OTLP through the collector On docker compose up on your machine
Anything else Whatever you configure Off Production, staging, and anywhere data matters

For production, pick a name like production, add an appsettings.production.json with a Serilog sink you can read, and leave Database:SeedSampleData alone. The default is off, so a fresh database stays empty until something real writes to it.

The container only listens on HTTP, and it expects something in front of it to end TLS: a load balancer, a reverse proxy or your platform’s ingress. Outside the local and Development environments it sends an HSTS header, and it redirects HTTP to HTTPS once it knows an HTTPS port to send people to, such as ASPNETCORE_HTTPS_PORT=443. Tell it about the proxy too:

Terminal window
ASPNETCORE_FORWARDEDHEADERS_ENABLED=true

Without that, the server thinks every request arrived over plain HTTP. Give it an HTTPS port in that state and it redirects the proxy’s requests, the proxy sends them back, and the two of them go round and round until someone’s pager goes off.

Endpoint Checks Use it for
/health/live Nothing beyond the process answering Liveness probes and the image’s own HEALTHCHECK
/health/ready The database can be reached Readiness probes, so traffic waits until the server can actually serve it

Both answer without a token, even when authentication is on.

The SQLite file lives in /app/data. Mount a volume there or, better, point Infrastructure at a real database before anyone relies on it. A database inside a container that gets replaced on every deploy is a database with a short memory.

In a solution created with --include-auth, set Authentication__Authority and Authentication__Audience as environment variables to point each environment at its own authorization server. Without --include-auth there’s nothing to turn on yet. The security guide has the details.

docker-compose.yml starts the MCP Inspector next to the server because it’s handy on a laptop. It’s a development tool, not part of the server, so don’t ship it. In production, the only thing listening is the server on port 7320.