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

View file

@ -0,0 +1,23 @@
// docs: typecheck-only
/**
* Companion example for the stdio entry on `docs/troubleshooting.md`.
*
* This file is separate from `troubleshooting.examples.ts` because
* `serveStdio` binds stdin: importing it into the runnable companion would
* keep that program from terminating. Verified by
* `pnpm --filter @modelcontextprotocol/examples typecheck` and
* `pnpm sync:snippets --check`; never executed.
*
* @module
*/
/* eslint-disable no-console */
//#region serveStdio_stderr
import { McpServer } from '@modelcontextprotocol/server';
import { serveStdio } from '@modelcontextprotocol/server/stdio';
serveStdio(() => {
const server = new McpServer({ name: 'app', version: '1.0.0' });
console.error('app server running on stdio'); // stderr — never console.log
return server;
});
//#endregion serveStdio_stderr