Add transport to quickstart too
This commit is contained in:
parent
866c8fd6c6
commit
6896e57afa
1 changed files with 5 additions and 0 deletions
|
|
@ -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?
|
||||
|
|
|
|||
Loading…
Reference in a new issue