From 6896e57afa1e276fd759081dc30b58675d87c47b Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Thu, 23 Jan 2025 10:13:57 +0000 Subject: [PATCH] Add transport to quickstart too --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 1a226a68..8ada35a4 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Let's create a simple MCP server that exposes a calculator tool and some data: ```typescript import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; // Create an MCP server @@ -70,6 +71,10 @@ server.resource( }] }) ); + +// Start receiving messages on stdin and sending messages on stdout +const transport = new StdioServerTransport(); +await server.connect(transport); ``` ## What is MCP?