stack/apps/e2e/tests/backend/endpoints/api/v1/internal
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
..
payments [Feat] Add payment methods page to dashboard (#1103) 2026-01-20 14:33:31 -08:00
projects Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
api-keys.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
component-versions.test.ts dev tool indicator (#1272) 2026-04-13 17:43:03 -07:00
config-local-emulator.test.ts make config typesafe (#1254) 2026-04-06 18:31:55 +00:00
config.test.ts "Require publishable client key" toggle (#1158) 2026-02-19 10:23:16 -08:00
email-drafts.test.ts Emails redesign (#1076) 2026-02-16 14:57:17 -08:00
email-queue-step.test.ts Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00
email-templates-create.test.ts Emails redesign (#1076) 2026-02-16 14:57:17 -08:00
email-templates.test.ts Emails redesign (#1076) 2026-02-16 14:57:17 -08:00
email.test.ts Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00
failed-emails-digest.test.ts Update email rendering code to use latest version of freestyle and to have a fallback with vercel sandbox (#1091) 2026-01-14 10:53:16 -08:00
feedback.test.ts Skip analytics init on apps without persistent token store (#1336) 2026-04-14 09:43:37 -07:00
local-emulator-project.test.ts make config typesafe (#1254) 2026-04-06 18:31:55 +00:00
managed-email-onboarding.test.ts Redesign Email Server settings + managed domain flow (#1373) 2026-04-24 13:35:03 -07:00
mcp.test.ts Move internal MCP server to backend, use Mintlify MCP for docs tools (#1389) 2026-04-29 09:45:52 -07:00
projects.test.ts Fix tests 2026-03-30 11:25:28 -07:00
sign-up-rules-stats.test.ts Hover tooltip for signup rules 2026-03-23 12:34:23 -07:00
sign-up-rules-test.test.ts Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
transactions-refund.test.ts Payments bulldozer txn rework (#1315) 2026-04-17 22:11:21 +00:00
transactions.test.ts fix product route access (#1134) 2026-01-27 18:30:14 +00:00
wysiwyg-edit.test.ts Custom dashboards and unified ai no playground (#1243) 2026-03-13 20:24:40 +00:00