Skip to content

Commit a2c23f2

Browse files
committed
fix: restore MCP landing page flow
Remove MCP redirects that caused loops and blocked the landing page, and add MCP to the landingComponents map so /mcp/latest renders McpLanding.
1 parent 4f512f0 commit a2c23f2

2 files changed

Lines changed: 1 addition & 16 deletions

File tree

src/libraries/libraries.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Base library data - lightweight, stays in main bundle
22
// Extended library data (with React nodes, testimonials, etc.) is in individual library files
33

4-
import { redirect } from '@tanstack/react-router'
54
import type { LibrarySlim, LibraryId } from './types'
65

76
export const query: LibrarySlim = {
@@ -413,21 +412,6 @@ export const mcp: LibrarySlim = {
413412
docsRoot: 'docs/mcp',
414413
defaultDocs: 'overview',
415414
visible: false,
416-
handleRedirects: (href: string) => {
417-
const pathMap: Record<string, string> = {
418-
overview: 'mcp/mcp-overview',
419-
connecting: 'mcp/mcp-connecting',
420-
tools: 'mcp/mcp-tools',
421-
}
422-
const mcpDocsMatch = href.match(/\/mcp\/(latest|v1)\/docs\/(.*)/)
423-
if (mcpDocsMatch) {
424-
const newPath = pathMap[mcpDocsMatch[2]] || 'mcp/mcp-overview'
425-
throw redirect({ href: `/cli/latest/docs/${newPath}` })
426-
}
427-
if (/\/mcp(\/latest)?$/.test(href)) {
428-
throw redirect({ href: '/cli/latest/docs/mcp/mcp-overview' })
429-
}
430-
},
431415
}
432416

433417
export const cli: LibrarySlim = {

src/routes/$libraryId/$version.index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const landingComponents: Partial<
3030
ai: React.lazy(() => import('~/components/landing/AiLanding')),
3131
devtools: React.lazy(() => import('~/components/landing/DevtoolsLanding')),
3232
cli: React.lazy(() => import('~/components/landing/CliLanding')),
33+
mcp: React.lazy(() => import('~/components/landing/McpLanding')),
3334
}
3435

3536
export const Route = createFileRoute('/$libraryId/$version/')({

0 commit comments

Comments
 (0)