Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Ticket IDs restart per tenant, and other things I learned wiring a .NET backend to an MCP server

Description and use

Integrating a .NET backend with an MCP server caused tenant isolation issues. The solution involved a dedicated internal controller, strict validation, re‑keying jobs, and improved telemetry.

Problem

Integrating a .NET multi‑tenant backend with an MCP server caused tenant‑resolution bugs, data leakage, and incorrect job keys.

Outcome

Tenant isolation was restored, job keys no longer collide, telemetry accurately reflects per‑tenant usage, and agent‑initiated actions are safer and more transparent.

Workflow

  • 1. Create a dedicated internal controller for service‑to‑service calls. 2. Require org and user IDs in every internal request. 3. Validate ticket existence, status, and link conflicts before performing actions. 4. Re‑key asynchronous jobs to (TenantId, TicketId). 5. Add optional user ID to usage records and map via usage controller. 6. Migrate connector records into per‑tenant tables. 7. Test with multiple tenants to ensure isolation and correct telemetry.

Evidence

Ticket IDs restart per tenant… Jobs are keyed on (TenantId, TicketId) now.

Source

Internal endpoints are not your public API… Different trust models.

Source

  • Record date: 2026-09-15T12:16:53.066Z