Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Authentication

Out of the box the server runs with auth disabled — an empty auth secret leaves every REST and MCP endpoint open. That’s convenient for local development and trusted networks. Do not expose an open instance to the internet.

Set an auth secret on the server (see Self-hosting for where env vars go):

Terminal window
MEMFORGE_Auth__Secret=<a-long-random-string>

Then mint a key for a user with the bundled CLI inside the container:

Terminal window
docker exec -it <container> dotnet Cortadel.Api.dll mint-key alice
# prints a bearer token bound to userId "alice"

The SDK sends the key as a bearer token — just pass it to the constructor:

using var cortadel = new CortadelClient(
"http://localhost:3001", userId: "alice", apiKey: "<token>");

Over raw HTTP, any of these work:

Authorization: Bearer <token>
API_KEY: <token>
GET /api/v1/memories?user_id=alice&api_key=<token>

A key is bound to a userId. Memories are namespaced per user, and the server rejects requests whose user_id (or MCP {userId} path segment) doesn’t match the key’s user. Always construct the client with the same userId the key was minted for.

GET /api/health is unauthenticated by design so orchestrators can probe it. It never returns memory content.

The MCP endpoint uses the same credentials. See MCP integration.