Server

constructor(serverInfo: Implementation, options: ServerOptions, instructionsProvider: () -> String? = null, block: Server.() -> Unit = {})(source)

Parameters

serverInfo

Information about this server implementation (name, version).

options

Configuration options for the server.

instructionsProvider

Optional provider for instructions from the server to the client about how to use this server. The provider is called each time a new session is started to support dynamic instructions.

block

A block to configure the mcp server.


constructor(serverInfo: Implementation, options: ServerOptions, instructions: String, block: Server.() -> Unit = {})(source)

Alternative constructor that provides the instructions directly as a string.

Parameters

serverInfo

Information about this server implementation (name, version).

options

Configuration options for the server.

instructions

Instructions from the server to the client about how to use this server.

block

A block to configure the mcp server.