stack/docs/src/app
Mantra e831972c4c
Move internal MCP server to backend, use Mintlify MCP for docs tools (#1389)
## Summary
- Move the `/api/internal/[transport]` MCP route from the docs app to
the backend, so the public `ask_stack_auth` MCP tool is served from the
same origin as the AI query API it proxies to.
- Replace the bespoke docs-tools HTTP client in
`apps/backend/src/lib/ai/tools/docs.ts` with an `@ai-sdk/mcp` client
that talks to Mintlify's generated MCP server. The backend AI agent now
consumes Mintlify's lower-level search/fetch tools directly instead of
going through the docs app.
- Swap `STACK_DOCS_INTERNAL_BASE_URL` for `STACK_MINTLIFY_MCP_URL`
(defaults to the Mintlify-hosted MCP URL).
- Move the `@vercel/mcp-adapter` dependency from `docs` to
`apps/backend`.

## Test plan
- [ ] `pnpm typecheck`
- [ ] `pnpm lint`
- [ ] e2e: new
`apps/e2e/tests/backend/endpoints/api/v1/internal/mcp.test.ts` covers
`tools/list` and validation on `tools/call`
- [ ] Manual: hit `POST /api/internal/mcp` on the backend and confirm
`ask_stack_auth` is listed and callable
- [ ] Manual: confirm backend AI agent docs tools resolve via the
Mintlify MCP URL

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

* **New Features**
* Backend docs tooling now uses a Mintlify MCP server for documentation
tools and discovery.

* **Chores**
* Development environment variables updated to point to the Mintlify MCP
endpoint.
* Backend dependency added to support MCP integration; docs package
dependency removed.

* **Tests**
* Added end-to-end tests for the internal MCP endpoint and tool
validation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-29 09:45:52 -07:00
..
api Move internal MCP server to backend, use Mintlify MCP for docs tools (#1389) 2026-04-29 09:45:52 -07:00
api-embed [Docs][Site] + [Dashboard][UI] - Adds docs to Stack Companion (#869) 2025-10-30 20:01:30 -05:00
docs [Docs][Content] Github install, UI changes, platform selection (#1098) 2026-01-20 11:49:08 -06:00
docs-embed [Docs][Site] + [Dashboard][UI] - Adds docs to Stack Companion (#869) 2025-10-30 20:01:30 -05:00
handler/[...stack] [Docs][site] - Add signin functionality (#876) 2025-09-10 01:32:10 -05:00
js/[...path] Fix docs 404 for once and for all 2025-08-01 15:13:59 -07:00
llms.mdx/[[...slug]] Fix types 2025-08-01 15:22:04 -07:00
llms.txt Llms.txt (#724) 2025-06-27 13:28:55 -05:00
mcp-browser mcp / tools update + internal tool (#1283) 2026-04-12 23:32:22 +00:00
next/[...path] Fix docs 404 for once and for all 2025-08-01 15:13:59 -07:00
openapi/[...path] New docs (#698) 2025-06-20 13:30:01 -07:00
python/[...path] Fix docs 404 for once and for all 2025-08-01 15:13:59 -07:00
react/[...path] Fix docs 404 for once and for all 2025-08-01 15:13:59 -07:00
rest-api/[...path] Fix docs 404 for once and for all 2025-08-01 15:13:59 -07:00
robots.txt docs robots.txt 2025-08-11 14:20:18 -07:00
sitemap.xml implement sitemap.xml (#815) 2025-08-01 15:15:32 -07:00
favicon.ico Update favicons 2025-07-17 09:56:08 -07:00
global.css [docs][dashboard][stack-shared] Update docs to new apps (#996) 2025-11-12 15:45:30 -06:00
layout.config.tsx New docs (#698) 2025-06-20 13:30:01 -07:00
layout.tsx Upgrade PostHog 2026-01-30 23:38:06 -08:00
loading.tsx Remove Loading in docs 2025-09-28 14:40:59 -05:00
not-found.tsx Fix docs 404 for once and for all 2025-08-01 15:13:59 -07:00