Files
supabase/apps/docs
Greg Richardson b539cc0529 feat(docs): return page suggestions in markdown 404 pages (#45439)
Markdown guides (`/docs/guides/**/*.md`) that 404 currently return a
text/plain `Not found` response. Since agents often hallucinate URL
paths, this PR proactively provides page suggestions so that agents can
find the page they are looking forward without further guessing. It uses
the docs Content API to fetch related pages, similar to the [HTML 404
page](https://supabase.com/docs/404):

```
# 404 - Page Not Found

The page `/docs/guides/mcp.md` does not exist.

## You might be looking for...

- [Model context protocol (MCP)](https://supabase.com/docs/guides/getting-started/mcp.md)
- [Building an MCP Server with mcp-lite](https://supabase.com/docs/guides/functions/examples/mcp-server-mcp-lite.md)
- [Model Context Protocol (MCP) Authentication](https://supabase.com/docs/guides/auth/oauth-server/mcp-authentication.md)
- [Deploy MCP servers](https://supabase.com/docs/guides/getting-started/byo-mcp.md)
- [Enabling MCP Server Access](https://supabase.com/docs/guides/self-hosting/enable-mcp.md)

See also: [Changelog](https://supabase.com/changelog.md)
```

## How to test
1. Use curl to fetch a non-existent page with an `.md` extension:

   ```shell
curl -i
https://docs-git-docs-markdown-404-suggestions-supabase.vercel.app/docs/guides/mcp.md
   ```

Confirm that relevant pages are suggested (ballpark - our search algo
needs some improvement). Also confirm that the response has content type
`text/markdown`.

2. Use curl to fetch a non-existent page using the `Accept:
text/markdown` header


   ```shell
   curl -i -H 'Accept: text/markdown' \

https://docs-git-docs-markdown-404-suggestions-supabase.vercel.app/docs/guides/mcp
   ```

    And confirm the same result as 1.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* 404 pages for missing guides now return a formatted Markdown response
with proper content-type and no-cache headers, and include up to five
related documentation suggestions to help users find relevant content.

* **Chores**
* Build environment now preserves an additional hosting URL variable to
improve build/task consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-05 08:40:44 +02:00
..
2026-05-04 23:24:08 +07:00

Reference Docs

Supabase Reference Docs

Maintainers

If you are a maintainer of any tools in the Supabase ecosystem, you can use this site to provide documentation for the tools & libraries that you maintain.

Versioning

All tools have versioned docs, which are kept in separate folders. For example, the CLI has the following folders and files:

  • cli: the "next" release.
  • cli_spec: contains the DocSpec for the "next" release (see below).
  • cli_versioned_docs: a version of the documentation for every release (including the most current version).
  • cli_versioned_sidebars: a version of the sidebar for every release (including the most current version).

When you release a new version of a tool, you should also release a new version of the docs. You can do this via the command line. For example, if you just released the CLI version 1.0.1:

npm run cli:version 1.0.1

DocSpec

We use documentation specifications which can be used to generate human-readable docs.

  • OpenAPI: for documenting API endpoints.
  • SDKSpec (custom to Supabase): for SDKs and client libraries.
  • ConfigSpec (custom to Supabase): for configuration options.
  • CLISpec (custom to Supabase): for CLI commands and usage.

The benefit of using custom specifications is that we can generate many other types from a strict schema (eg, HTML and manpages). It also means that we can switch to any documentation system we want. On this site we use Next.js, but on Supabase's official website, we use a custom React site and expose only a subset of the available API for each tool.

Contributing

To contribute to docs, see the developers' guide and contributing guide.