chore: deprecation cycle (#615)

Remove all deprecation with error level

## Motivation and Context
next minor release

## How Has This Been Tested?
-

## Breaking Changes
Removing it is a binary-incompatible change

## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update

## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [x] I have added appropriate error handling
- [x] I have added or updated documentation as needed
This commit is contained in:
Pavel Gorgulov 2026-03-26 11:41:58 +01:00 • committed by GitHub
commit 558399039c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -118,8 +118,6 @@ public open class Server(
block: Server.() -> Unit = {},
) : this(serverInfo, options, { instructions }, block)
private var _onInitialized: (() -> Unit) = {}
private var _onConnect: (() -> Unit) = {}
private var _onClose: () -> Unit = {}
@ -197,20 +195,6 @@ public open class Server(
_onClose()
}
/**
* Starts a new server session with the given transport and initializes
* internal request handlers based on the server's capabilities.
*
* @param transport The transport layer to connect the session with.
* @return The initialized and connected server session.
*/
@Deprecated(
"Use createSession(transport) instead.",
ReplaceWith("createSession(transport)"),
DeprecationLevel.ERROR,
)
public suspend fun connect(transport: Transport): ServerSession = createSession(transport)
/**
* Starts a new server session with the given transport and initializes
* internal request handlers based on the server's capabilities.
@ -294,22 +278,6 @@ public open class Server(
}
}
/**
* Registers a callback to be invoked when the server has completed initialization.
*/
@Deprecated(
"Initialization moved to ServerSession, use ServerSession.onInitialized instead.",
ReplaceWith("ServerSession.onInitialized"),
DeprecationLevel.ERROR,
)
public fun onInitialized(block: () -> Unit) {
val old = _onInitialized
_onInitialized = {
old()
block()
}
}
/**
* Registers a callback to be invoked when the server connection is closing.
*/