You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const result =awaitMcpServer.server.createMessage(
398
+
{
399
+
messages : [{
400
+
role: "user",
401
+
content: {
402
+
text: samplingText,
403
+
type: "text"
404
+
}
405
+
}],
406
+
maxTokens: 1000
407
+
}
408
+
);
409
+
returnresult;
410
+
}
411
+
412
+
// Sampling request just after connecting to MCP Client
413
+
server.connect(transport);
414
+
samplingExample(server);
415
+
```
416
+
385
417
## Running Your Server
386
418
387
419
MCP servers in TypeScript need to be connected to a transport to communicate with clients. How you start the server depends on the choice of transport:
0 commit comments