Skip to content
FACUNDO.DEV
Work

CASE STUDY · Founder · Fullstack · 2026

Orbys

An agency management suite that your AI assistant can operate

Multi-tenant SaaS for agencies: clients, projects, time tracking, billing and partner splits. Next.js and Supabase with RLS, plus a remote MCP server.

Role
Founder · Fullstack
Year
2026
Stack
  • Next.js 15
  • React 19
  • Supabase
  • Postgres RLS
  • Stripe
  • next-intl
  • Zod
  • Tailwind 4
  • Sentry
  • MCP
  • Vitest
Orbys case study cover

The problem

A small agency runs on five tools that do not talk to each other. Clients live in a spreadsheet, hours in a timer app, invoices in another tool, and the split between partners in someone’s head. At the end of the month somebody reconciles it by hand, and approving hours or chasing what is ready to invoice takes a day. I wanted one place where the work, the time and the money are the same data.

The solution

Orbys is my own product: a multi-tenant platform where each agency gets a workspace with clients, projects and tasks, time tracking with an approval flow, billing through Stripe, analytics, and a team and partners section. It is live at getorbys.com, with the interface in Spanish, English and Italian.

The part I like most is that it ships with a remote MCP server. The same app that serves the web UI exposes a Model Context Protocol endpoint, so an AI assistant can list clients, log hours, approve a timesheet or ask what is ready to invoice, with the same permissions as the person who owns the key.

The stack is Next.js 15 with the App Router and React 19, Supabase for auth and Postgres, Stripe, next-intl, Zod, Tailwind 4 and Sentry. The screenshots use fake seed data.

Stack and key decisions

  • Tenant isolation in the database: every business table carries a company_id, and row level security makes a query unable to leave its tenant, whatever the application code does. There are 85 migrations, and tenants also resolve from the subdomain in the middleware
  • The MCP server lives inside the app: it is a route handler plus a folder of tools grouped by domain (workspace, operations, finance, delivery, time tracking), not a separate service. Requests authenticate with an admin-approved API key as a bearer token, and the transport is stateless, so there is no session store to run
  • Cache by tenant, invalidated by writes: analytics queries are cached with a tag per company, and the mutations that move the numbers (hours, invoices, expenses) revalidate that tag. The invalidation is wrapped so a cache problem can never fail a write that already committed
  • One error and origin policy for the API: mutating requests pass an origin check and a rate limit in the middleware, with deliberate exceptions for the Stripe and Resend webhooks, which authenticate by signature, and for MCP, which authenticates by key
  • Validation at the edge: Zod schemas guard every route and every MCP tool input, so a date like 2026-02-31 is rejected with a clear message instead of becoming a wrong invoice

[INFO] Why MCP in the same app

Duplicating the domain rules in a second service would have meant two places to keep correct. By reusing the same data layer, the assistant and the web UI cannot disagree about what a user is allowed to do.

What I learned

Multi-tenancy is a database problem first. Once isolation is a policy, forgetting a where company_id stops being a data leak.

An API for machines is a product surface. Designing the MCP tools forced me to name the domain operations clearly, and that cleaned up the web code too.

Exceptions to a security rule should be explicit and short. A list of three paths that skip the origin check is easy to review; an implicit one is not.

And build the boring parts early. Calendar days versus timestamps, rate limits and cache invalidation are not exciting, and they are where the trust in a billing product comes from.