Implement MCP 2026-07-28 (#2286)
Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> Co-authored-by: Konstantin Konstantinov <KKonstantinov@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
e4227d135c
commit
1823aae891
1 changed files with 69131 additions and 9001 deletions
28
test/e2e/fixtures/dual-era-stdio-server.ts
Normal file
28
test/e2e/fixtures/dual-era-stdio-server.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* Runnable dual-era stdio MCP server fixture for the dual-era stdio e2e cells.
|
||||
*
|
||||
* The connection-pinned `serveStdio` entry over an ordinary `McpServer`
|
||||
* factory: the client's opening exchange selects the era for the connection
|
||||
* (a 2025 `initialize` handshake or 2026-07-28 per-request envelope traffic
|
||||
* negotiated via `server/discover`), and one factory instance serves it.
|
||||
* Spawned as a real child process (via tsx) by
|
||||
* test/e2e/scenarios/stdio-dual-era.test.ts; exits when its stdin reaches EOF.
|
||||
*/
|
||||
|
||||
import { McpServer } from '@modelcontextprotocol/server';
|
||||
import { serveStdio } from '@modelcontextprotocol/server/stdio';
|
||||
import { z } from 'zod/v4';
|
||||
|
||||
serveStdio(() => {
|
||||
const server = new McpServer({ name: 'dual-era-stdio-e2e-fixture', version: '1.0.0' }, { capabilities: { tools: {} } });
|
||||
server.registerTool(
|
||||
'echo',
|
||||
{
|
||||
description: 'Echoes the input text back as a text content block.',
|
||||
inputSchema: z.object({ text: z.string() })
|
||||
},
|
||||
({ text }) => ({ content: [{ type: 'text', text }] })
|
||||
);
|
||||
return server;
|
||||
});
|
||||
process.stderr.write('[dual-era-stdio-server] ready\n');
|
||||
Loading…
Reference in a new issue