Business software and compliance Case study
MCP server for a database-performance SaaS
A Model Context Protocol (MCP) server that lets customers use their own AI assistant to read their database findings and ask the platform to analyse a query, with scoped sign-in, read-mostly tools and an audit trail.

- Client
- Database performance SaaS
- Service
- AI, Integrations, Web apps
- Years
- 2026
- Stack
- Next.js, TypeScript, PostgreSQL, Redis and 4 more
- Platforms
- Web
Client details are private, so this study describes the client by type.
Overview
The platform analyses customers' databases and recommends fixes. Customers increasingly work inside an AI assistant or coding tool, so we added an MCP server on its own hostname. A customer connects their assistant once, signs in, and can then ask about their projects, databases and recommendations, or send a slow query to the platform for analysis, without leaving the assistant. It reuses the platform's existing analysis pipeline, sign-in and billing rather than copying them, and it is live in production.
The challenge
Giving an outside AI model access to customer data safely, with analyses that take longer than a normal request, assistants that retry, and sign-in that has to work with standard OAuth for chat assistants as well as simple keys for coding tools.
What we built
- An MCP server on its own hostname, as a stateless HTTP endpoint, so any instance can answer and no session store is needed
- Two ways to sign in that resolve to one identity: scoped keys for coding tools and scripts, and standard OAuth 2.1 for chat assistants
- The platform acting as the OAuth authorisation server for assistants, with a consent screen, a list of connected apps with revoke, and sign-up in the middle of a sign-in
- A small set of narrowly scoped tools for projects, databases, recommendations, usage and analysis, most of them read-only
- Results formatted for models, with safeguards on what is returned
- Handling of long-running analyses and repeated requests, so assistants do not cause duplicate work or charges
- One shared analysis pipeline for the web chat and the MCP tools, so rate limits, locking, live updates and billing behave the same in both
- A rate limit per credential, an audit record of every call, and error messages in plain sentences
- A settings area to connect and revoke assistants, and a public setup guide for each kind of assistant
- Hostname, proxy configuration and deployment added to the existing container and CI pipeline
- A test suite with a test for each tool and each security rule, and a browser end-to-end test of the full sign-in
Technology used
| Layer | Choice | Purpose |
|---|---|---|
| Backend | TypeScript and Next.js, shared with the web app | reuse of analysis, billing and rate limits |
| Data | PostgreSQL and Redis | findings and audit records; limits and retry keys |
| Delivery | Docker and GitHub Actions | gated tests and deployment to a dedicated hostname |
| Protocol | MCP over stateless HTTP | any instance can answer; no session store |
| Sign-in | Scoped keys and OAuth 2.1 with PKCE | one identity for every tool; consent and revoke for assistants |
| Quality | Automated tests | each tool and security rule checked; repeatable AI mode |
What happened next
- Delivered
The work described above was delivered to the client.
- Operational facts
- Our work on this project took place in 2026.
Screens


Could this be your project?
- You have a defined job in a real process that automation or AI could take on. AI services
- Your product has to connect to payment, accounting, messaging or other third-party systems.
- You work in business software and compliance and want a team that has built for it before. Business software and compliance work
Questions about this project
How long did this project take?
Our work on it took place in 2026.
What technology was used?
Next.js, TypeScript, PostgreSQL, Redis, Docker, MCP (Model Context Protocol), OAuth 2.1, GitHub Actions.
Similar work

Also Next.js and TypeScript, same industry
AI-assisted database performance SaaS
A SaaS platform that finds slow queries and missing indexes in live databases and returns ranked, AI-assisted fixes with risk and rollback, optionally as pull requests.

Also TypeScript and PostgreSQL, also a web app
Reactor: AI assistant and Web3 data back end
A Node.js back end for Reactor, an AI chat assistant with Web3 tools: streaming chat and voice, a keyed language-model API for businesses, and a crypto service for token audits, swaps and rewards.

Also TypeScript and PostgreSQL, also a web app
Froono: customer loyalty platform
A multi-tenant customer loyalty platform: web admin, customer API, a mobile app and a PWA, with receipt checking, lucky draws, WhatsApp campaigns, AI image generation and online payments.
