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
text: `Please summarize the following text concisely:\n\n${text}`,
420
+
},
421
+
},
422
+
],
423
+
maxTokens: 500,
424
+
});
425
+
426
+
return {
427
+
content: [
428
+
{
429
+
type: "text",
430
+
text: response.content.type==="text"?response.content.text:"Unable to generate summary",
431
+
},
432
+
],
433
+
};
434
+
}
435
+
);
436
+
437
+
asyncfunction main() {
438
+
const transport =newStdioServerTransport();
439
+
awaitmcpServer.connect(transport);
440
+
console.log("MCP server is running...");
441
+
}
442
+
443
+
main().catch((error) => {
444
+
console.error("Server error:", error);
445
+
process.exit(1);
446
+
});
447
+
```
448
+
449
+
385
450
## Running Your Server
386
451
387
452
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