@@ -34,6 +34,11 @@ export type ServerOptions = ProtocolOptions & {
3434 * Capabilities to advertise as being supported by this server.
3535 */
3636 capabilities ?: ServerCapabilities ;
37+
38+ /**
39+ * Optional instructions describing how to use the server and its features.
40+ */
41+ instructions ?: string ;
3742} ;
3843
3944/**
@@ -73,6 +78,7 @@ export class Server<
7378 private _clientCapabilities ?: ClientCapabilities ;
7479 private _clientVersion ?: Implementation ;
7580 private _capabilities : ServerCapabilities ;
81+ private _instructions ?: string ;
7682
7783 /**
7884 * Callback for when initialization has fully completed (i.e., the client has sent an `initialized` notification).
@@ -88,6 +94,7 @@ export class Server<
8894 ) {
8995 super ( options ) ;
9096 this . _capabilities = options ?. capabilities ?? { } ;
97+ this . _instructions = options ?. instructions ;
9198
9299 this . setRequestHandler ( InitializeRequestSchema , ( request ) =>
93100 this . _oninitialize ( request ) ,
@@ -250,6 +257,7 @@ export class Server<
250257 : LATEST_PROTOCOL_VERSION ,
251258 capabilities : this . getCapabilities ( ) ,
252259 serverInfo : this . _serverInfo ,
260+ ...( this . _instructions && { instructions : this . _instructions } ) ,
253261 } ;
254262 }
255263
0 commit comments