docs: rebuild the v2 documentation around a task-based page tree (#2397)

This commit is contained in:
Felix Weinberger 2026-06-30 21:18:42 +01:00 • committed by GitHub
commit b153505428
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11884 additions and 4971 deletions

View file

@ -24,7 +24,7 @@ export default defineConfig({
title: 'MCP TypeScript SDK',
description: 'The TypeScript SDK implementation of the Model Context Protocol specification.',
base: '/v2/',
srcExclude: ['v1/**', 'behavior-surface-pins.md'],
srcExclude: ['v1/**', '_meta/**', 'behavior-surface-pins.md'],
sitemap: { hostname: 'https://ts.sdk.modelcontextprotocol.io/v2/' },
markdown: {
config(md) {
@ -44,26 +44,82 @@ export default defineConfig({
},
themeConfig: {
nav: [
{ text: 'Guide', link: '/server-quickstart', activeMatch: '^/(server|client|faq)' },
{ text: 'Get started', link: '/get-started/first-server', activeMatch: '^/get-started/' },
{ text: 'Servers', link: '/servers/tools', activeMatch: '^/(servers|serving)/' },
{ text: 'Clients', link: '/clients/connect', activeMatch: '^/clients/' },
{ text: 'Migration', link: '/migration/', activeMatch: '^/migration/' },
{ text: 'API Reference', link: '/api/', activeMatch: '^/api/' },
{ text: 'V1 Docs', link: 'https://ts.sdk.modelcontextprotocol.io/' }
],
sidebar: [
{
text: 'Getting started',
text: 'Get started',
items: [
{ text: 'Server Quickstart', link: '/server-quickstart' },
{ text: 'Client Quickstart', link: '/client-quickstart' }
{ text: 'Build a server', link: '/get-started/first-server' },
{ text: 'Plug into a real host', link: '/get-started/real-host' },
{ text: 'Build a client', link: '/get-started/first-client' },
{ text: 'Packages', link: '/get-started/packages' },
{ text: 'Examples', link: '/get-started/examples' }
]
},
{
text: 'Guides',
text: 'Servers',
items: [
{ text: 'Server', link: '/server' },
{ text: 'Client', link: '/client' }
{ text: 'Tools', link: '/servers/tools' },
{ text: 'Resources', link: '/servers/resources' },
{ text: 'Prompts', link: '/servers/prompts' },
{ text: 'Completion', link: '/servers/completion' },
{ text: 'Logging, progress, cancellation', link: '/servers/logging-progress-cancellation' },
{ text: 'Elicitation', link: '/servers/elicitation' },
{ text: 'Sampling (sunset)', link: '/servers/sampling' },
{ text: 'Input required', link: '/servers/input-required' },
{ text: 'Notifications', link: '/servers/notifications' },
{ text: 'Errors', link: '/servers/errors' }
]
},
{
text: 'Serving',
items: [
{ text: 'stdio', link: '/serving/stdio' },
{ text: 'HTTP', link: '/serving/http' },
{ text: 'Express', link: '/serving/express' },
{ text: 'Hono', link: '/serving/hono' },
{ text: 'Fastify', link: '/serving/fastify' },
{ text: 'Web-standard runtimes', link: '/serving/web-standard' },
{ text: 'Sessions, state, scaling', link: '/serving/sessions-state-scaling' },
{ text: 'Authorization', link: '/serving/authorization' },
{ text: 'Legacy clients', link: '/serving/legacy-clients' }
]
},
{
text: 'Clients',
items: [
{ text: 'Connect', link: '/clients/connect' },
{ text: 'Calling', link: '/clients/calling' },
{ text: 'Handle server requests', link: '/clients/server-requests' },
{ text: 'Roots (sunset)', link: '/clients/roots' },
{ text: 'Subscriptions', link: '/clients/subscriptions' },
{ text: 'OAuth', link: '/clients/oauth' },
{ text: 'Machine auth', link: '/clients/machine-auth' },
{ text: 'Middleware', link: '/clients/middleware' },
{ text: 'Caching', link: '/clients/caching' }
]
},
{ text: 'Protocol versions', link: '/protocol-versions' },
{
text: 'Advanced',
collapsed: true,
items: [
{ text: 'Low-level server', link: '/advanced/low-level-server' },
{ text: 'Custom methods', link: '/advanced/custom-methods' },
{ text: 'Schema libraries', link: '/advanced/schema-libraries' },
{ text: 'Custom transports', link: '/advanced/custom-transports' },
{ text: 'Wire schemas', link: '/advanced/wire-schemas' },
{ text: 'Gateway', link: '/advanced/gateway' }
]
},
{ text: 'Testing', link: '/testing' },
{ text: 'Troubleshooting', link: '/troubleshooting' },
{
text: 'Migration',
items: [
@ -72,10 +128,6 @@ export default defineConfig({
{ text: '2026-07-28 protocol support', link: '/migration/support-2026-07-28' }
]
},
{
text: 'FAQ',
items: [{ text: 'FAQ', link: '/faq' }]
},
{
text: 'API Reference',
collapsed: true,

View file

@ -6,6 +6,24 @@
* light, white on slate dark. We map that onto VitePress brand variables.
*/
/* ------------------------------------------------------------------ layout */
/*
* The default theme caps the doc column at 688px (and the page at 1440px),
* which forces horizontal scrolling on most of our ~100-column code blocks.
* Let the layout breathe and the column grow so typical snippets fit;
* genuinely long lines still scroll inside their own block.
*/
:root {
--vp-layout-max-width: 1680px;
}
/* !important: the default rule is a scoped component style ([data-v-…]), which
otherwise out-specifies any override written here. */
.VPDoc.has-aside .content-container {
max-width: 960px !important;
}
/* ---------------------------------------------------------------- branding */
:root {