# SaaS Template Product documentation for this application: how it works, how to run and deploy it, and how to use its features. ## Documentation ## Search API AI agents can find relevant docs with `GET https://nextjs-saas-template.lubomirgeorgiev.com/api/docs/search?q=authentication&limit=8`. The `q` parameter is required, `limit` defaults to 8 and accepts 1-20, and the JSON response returns a `results` array with `title`, `resolvedPath`, `snippet`, `slug`, `seoDescription`, and `entryId`. ## API and MCP - OpenAPI 3.1 document: `GET https://nextjs-saas-template.lubomirgeorgiev.com/api/v1/openapi.json` — every public REST operation with its scopes, request and response schemas, and error shape. - MCP endpoint (Streamable HTTP): `https://nextjs-saas-template.lubomirgeorgiev.com/mcp` — the same operations as agent tools. Authenticate with an API key as a bearer token, or connect over OAuth. - Authenticated REST requests and MCP tool calls share a limit of 300 requests per 60 seconds per credential. Every response carries `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset` (seconds until the window resets); a 429 also includes `retry-after`. - [API reference](https://nextjs-saas-template.lubomirgeorgiev.com/docs/api): browsable reference rendered from the OpenAPI document. - [API error codes](https://nextjs-saas-template.lubomirgeorgiev.com/docs/api/errors): every stable error `code` with its HTTP status; problem responses' `type` member links here, anchored at the code. - [Authentication](https://nextjs-saas-template.lubomirgeorgiev.com/docs/authentication): API keys, OAuth 2.1, scopes, and revocation. - [Connecting AI agents (MCP)](https://nextjs-saas-template.lubomirgeorgiev.com/docs/mcp): per-client setup for agent clients. ### [Features](https://nextjs-saas-template.lubomirgeorgiev.com/markdown/docs/features): Explore SaaS Template's features, including auth, database, email, and deployment options