Allow MCP API route through proxy

This commit is contained in:
2026-06-04 21:44:24 -04:00
parent bad24aeda4
commit 413eb3e3c0
+3 -2
View File
@@ -14,7 +14,7 @@ export function proxy(request: NextRequest) {
const publicRoutes = ["/", "/auth/signin", "/auth/register"]; const publicRoutes = ["/", "/auth/signin", "/auth/register"];
// Define API routes that should be handled separately // Define API routes that should be handled separately
const apiRoutes = ["/api/auth", "/api/trpc"]; const apiRoutes = ["/api/auth", "/api/trpc", "/api/mcp"];
// Allow API routes to pass through // Allow API routes to pass through
if (apiRoutes.some((route) => pathname.startsWith(route))) { if (apiRoutes.some((route) => pathname.startsWith(route))) {
@@ -48,11 +48,12 @@ export const config = {
/* /*
* Match all request paths except for the ones starting with: * Match all request paths except for the ones starting with:
* - api/auth (Auth.js API routes) * - api/auth (Auth.js API routes)
* - api/mcp (MCP API route)
* - _next/static (static files) * - _next/static (static files)
* - _next/image (image optimization files) * - _next/image (image optimization files)
* - favicon.ico (favicon file) * - favicon.ico (favicon file)
* - public folder files * - public folder files
*/ */
"/((?!api/auth|_next/static|_next/image|favicon.ico|.*\\.png$|.*\\.jpg$|.*\\.jpeg$|.*\\.gif$|.*\\.svg$).*)", "/((?!api/auth|api/mcp|_next/static|_next/image|favicon.ico|.*\\.png$|.*\\.jpg$|.*\\.jpeg$|.*\\.gif$|.*\\.svg$).*)",
], ],
}; };