@@ -33,6 +33,11 @@ export type ServerOptions = ProtocolOptions & {
33
33
* Capabilities to advertise as being supported by this server.
34
34
*/
35
35
capabilities : ServerCapabilities ;
36
+
37
+ /**
38
+ * Optional instructions describing how to use the server and its features.
39
+ */
40
+ instructions ?: string ;
36
41
} ;
37
42
38
43
/**
@@ -72,6 +77,7 @@ export class Server<
72
77
private _clientCapabilities ?: ClientCapabilities ;
73
78
private _clientVersion ?: Implementation ;
74
79
private _capabilities : ServerCapabilities ;
80
+ private _instructions ?: string ;
75
81
76
82
/**
77
83
* Callback for when initialization has fully completed (i.e., the client has sent an `initialized` notification).
@@ -87,6 +93,7 @@ export class Server<
87
93
) {
88
94
super ( options ) ;
89
95
this . _capabilities = options . capabilities ;
96
+ this . _instructions = options . instructions ;
90
97
91
98
this . setRequestHandler ( InitializeRequestSchema , ( request ) =>
92
99
this . _oninitialize ( request ) ,
@@ -234,6 +241,7 @@ export class Server<
234
241
: LATEST_PROTOCOL_VERSION ,
235
242
capabilities : this . getCapabilities ( ) ,
236
243
serverInfo : this . _serverInfo ,
244
+ ...( this . _instructions && { instructions : this . _instructions } ) ,
237
245
} ;
238
246
}
239
247
0 commit comments