@@ -26,7 +26,7 @@ public class ClientOptions(
2626 * An MCP client on top of a pluggable transport.
2727 *
2828 * The client automatically performs the initialization handshake with the server when [connect] is called.
29- * After initialization, [getServerCapabilities ] and [getServerVersion ] provide details about the connected server.
29+ * After initialization, [severCapabilities ] and [serverVersion ] provide details about the connected server.
3030 *
3131 * You can extend this class with custom request/notification/result types if needed.
3232 *
@@ -38,8 +38,22 @@ public open class Client(
3838 options : ClientOptions = ClientOptions (),
3939) : Protocol(options) {
4040
41- private var serverCapabilities: ServerCapabilities ? = null
42- private var serverVersion: Implementation ? = null
41+ /* *
42+ * Retrieves the server's reported capabilities after the initialization process completes.
43+ *
44+ * @return The server's capabilities, or `null` if initialization is not yet complete.
45+ */
46+ public var serverCapabilities: ServerCapabilities ? = null
47+ private set
48+
49+ /* *
50+ * Retrieves the server's reported version information after initialization.
51+ *
52+ * @return Information about the server's implementation, or `null` if initialization is not yet complete.
53+ */
54+ public var serverVersion: Implementation ? = null
55+ private set
56+
4357 private val capabilities: ClientCapabilities = options.capabilities
4458
4559 protected fun assertCapability (capability : String , method : String ) {
@@ -90,23 +104,6 @@ public open class Client(
90104 }
91105 }
92106
93- /* *
94- * Retrieves the server's reported capabilities after the initialization process completes.
95- *
96- * @return The server's capabilities, or `null` if initialization is not yet complete.
97- */
98- public fun getServerCapabilities (): ServerCapabilities ? {
99- return serverCapabilities
100- }
101-
102- /* *
103- * Retrieves the server's reported version information after initialization.
104- *
105- * @return Information about the server's implementation, or `null` if initialization is not yet complete.
106- */
107- public fun getServerVersion (): Implementation ? {
108- return serverVersion
109- }
110107
111108 override fun assertCapabilityForMethod (method : Method ) {
112109 when (method) {
0 commit comments