File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ npm install @modelcontextprotocol/sdk
2222### Creating a Client
2323
2424``` typescript
25- import { Client } from " @modelcontextprotocol/sdk/client" ;
26- import { StdioClientTransport } from " @modelcontextprotocol/sdk/client/stdio" ;
25+ import { Client } from " @modelcontextprotocol/sdk/client/index.js " ;
26+ import { StdioClientTransport } from " @modelcontextprotocol/sdk/client/stdio.js " ;
2727
2828const transport = new StdioClientTransport ({
2929 command: " path/to/server" ,
@@ -32,6 +32,8 @@ const transport = new StdioClientTransport({
3232const client = new Client ({
3333 name: " example-client" ,
3434 version: " 1.0.0" ,
35+ }, {
36+ capabilities: {}
3537});
3638
3739await client .connect (transport );
@@ -57,12 +59,16 @@ const resourceContent = await client.request(
5759### Creating a Server
5860
5961``` typescript
60- import { Server } from " @modelcontextprotocol/sdk/server" ;
61- import { StdioServerTransport } from " @modelcontextprotocol/sdk/server/stdio" ;
62+ import { Server } from " @modelcontextprotocol/sdk/server/index.js " ;
63+ import { StdioServerTransport } from " @modelcontextprotocol/sdk/server/stdio.js " ;
6264
6365const server = new Server ({
6466 name: " example-server" ,
6567 version: " 1.0.0" ,
68+ }, {
69+ capabilities: {
70+ resources: {}
71+ }
6672});
6773
6874server .setRequestHandler (ListResourcesRequestSchema , async () => {
You can’t perform that action at this time.
0 commit comments