stack/apps/e2e/tests/backend/endpoints/api/v1
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
..
__snapshots__ Dashboard: DataGrid refactor + layout (stacked on overview-revamp) (#1338) 2026-04-27 13:50:24 -07:00
auth fix: refresh-token P2025 race with concurrent sign-out (#1372) 2026-04-24 18:44:39 +00:00
contact-channels Sign up rules (#1138) 2026-02-03 11:08:24 -08:00
emails More lenient email processing pause 2026-04-12 15:37:33 -07:00
integrations [codex] Fix Neon malformed Basic auth validation (#1381) 2026-04-24 11:59:18 -07:00
internal Move internal MCP server to backend, use Mintlify MCP for docs tools (#1389) 2026-04-29 09:45:52 -07:00
payments Payments bulldozer txn rework (#1315) 2026-04-17 22:11:21 +00:00
ai-query.test.ts Dashboard: DataGrid refactor + layout (stacked on overview-revamp) (#1338) 2026-04-27 13:50:24 -07:00
analytics-config.test.ts Queries view (#1145) 2026-02-16 11:39:21 -08:00
analytics-events-batch.test.ts fix clickhouse surrogate pair bug (#1270) 2026-03-23 10:09:04 -07:00
analytics-events.test.ts clickhouse user sync (#1159) 2026-02-12 16:52:20 -08:00
analytics-query.test.ts Classify ClickHouse NO_COMMON_TYPE (386) as unsafe (#1380) 2026-04-24 12:07:16 -07:00
api-keys.test.ts Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00
auth-flows.test.ts Fix tests 2025-07-16 11:42:25 -07:00
check-feature-support.test.ts More backend endpoint implementations (#126) 2024-07-13 22:04:53 -07:00
connected-accounts.test.ts More connected accounts (#1165) 2026-02-18 15:19:35 -08:00
data-vault.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
email-themes.test.ts [Refactor][Feat][Fix] Rework Email Section With New Sent Page, Better Drafts Page, and Settings Page (#1221) 2026-03-11 12:01:36 -07:00
external-db-sync-advanced.test.ts Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
external-db-sync-basics.test.ts Sync engine should ignore missing tenancies 2026-04-09 23:31:21 -07:00
external-db-sync-high-volume.test.ts Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
external-db-sync-race.test.ts Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
external-db-sync-utils.ts clickhouse new syncs and verify-data (#1304) 2026-04-08 14:43:22 -07:00
index.test.ts "Require publishable client key" toggle (#1158) 2026-02-19 10:23:16 -08:00
internal-metrics.test.ts Dashboard: DataGrid refactor + layout (stacked on overview-revamp) (#1338) 2026-04-27 13:50:24 -07:00
notification-preferences.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
oauth-providers.test.ts Fix OAuth provider disablement 2026-02-24 12:43:41 -08:00
project-permission-definitions.test.ts Config DB migration step 2 (#629) 2025-04-29 14:52:45 -07:00
project-permissions.test.ts Add onboarding status to Project model and implement related database… (#1246) 2026-03-13 12:00:40 -07:00
projects.test.ts Add onboarding status to Project model and implement related database… (#1246) 2026-03-13 12:00:40 -07:00
render-email.test.ts [Refactor] [Fix] Email Rendering Pipeline Refactor, Error Handling, and Bug Fixes (#1140) 2026-02-02 17:35:51 -08:00
restricted-users.test.ts Sign up rules (#1138) 2026-02-03 11:08:24 -08:00
risk-scores.test.ts private files n sm build shit (#1276) 2026-03-23 12:31:36 -07:00
send-email.test.ts Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00
session-replays.test.ts [Dashboard][Backend][SDK] - Adds sharable session replay ids. (#1294) 2026-04-28 17:57:07 -05:00
stripe-webhooks.test.ts fix product route access (#1134) 2026-01-27 18:30:14 +00:00
team-invitations.test.ts Payments bulldozer txn rework (#1315) 2026-04-17 22:11:21 +00:00
team-member-profiles.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
team-memberships.test.ts Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
team-permission-definitions.test.ts Fix error where deleting a team creator default permission would make the dashboard crash 2025-08-11 17:42:54 -07:00
team-permissions.test.ts Add onboarding status to Project model and implement related database… (#1246) 2026-03-13 12:00:40 -07:00
teams.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
token-refresh-events.test.ts Reduce number of token refresh events 2026-01-28 14:56:11 -08:00
unsubscribe-link.test.ts Emails redesign (#1076) 2026-02-16 14:57:17 -08:00
users-primary-email.test.ts Onboarding app & restricted users (#1069) 2026-01-11 17:22:14 -08:00
users.test.ts Add server-side flags for anonymous users 2026-04-03 10:43:34 -07:00