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
22
22
### Creating a Client
23
23
24
24
``` 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 " ;
27
27
28
28
const transport = new StdioClientTransport ({
29
29
command: " path/to/server" ,
@@ -32,6 +32,8 @@ const transport = new StdioClientTransport({
32
32
const client = new Client ({
33
33
name: " example-client" ,
34
34
version: " 1.0.0" ,
35
+ }, {
36
+ capabilities: {}
35
37
});
36
38
37
39
await client .connect (transport );
@@ -57,12 +59,16 @@ const resourceContent = await client.request(
57
59
### Creating a Server
58
60
59
61
``` 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 " ;
62
64
63
65
const server = new Server ({
64
66
name: " example-server" ,
65
67
version: " 1.0.0" ,
68
+ }, {
69
+ capabilities: {
70
+ resources: {}
71
+ }
66
72
});
67
73
68
74
server .setRequestHandler (ListResourcesRequestSchema , async () => {
You can’t perform that action at this time.
0 commit comments