Package-level declarations

Types

Link copied to clipboard
fun interface CancellationCallback
Link copied to clipboard
interface Cancellations

Handles Cancellation requests

Link copied to clipboard
sealed interface ClientRequestContext

How a client is identified for sending a request to.

Link copied to clipboard
sealed interface ClientRequestTarget

How a client is identified for sending a request to.

Link copied to clipboard
Link copied to clipboard
interface Initializer

Handles protocol traffic for client server handshaking and session initialization.

Link copied to clipboard
Link copied to clipboard
interface Logger

Logs messages for a session back to the client.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class McpProtocol<Transport>(sessions: Sessions<Transport>, initializer: Initializer, tools: Tools = tools(), resources: Resources = resources(), prompts: Prompts = prompts(), completions: Completions = completions(), logger: Logger = logger(), roots: Roots = roots(), cancellations: Cancellations = cancellations(), tasks: Tasks = tasks(), mcpFilter: McpFilter = McpFilter.NoOp, onError: (Throwable) -> Unit = { it.printStackTrace(System.err) }, random: Random = SecureRandom())

Models the MCP protocol in terms of message handling and session management.

Link copied to clipboard
data class McpRequest(val session: Session, val message: McpJsonRpcRequest, val http: Request)
Link copied to clipboard
sealed interface McpResponse
Link copied to clipboard
sealed interface McpSessionState

Represents a session for a connection.

Link copied to clipboard

Provides notification telling the client of changes to underlying capabilities lists.

Link copied to clipboard

Provides notification telling the client of changes to a particular resource

Link copied to clipboard

Handles protocol traffic for prompts features.

Link copied to clipboard

Handles protocol traffic for resources features and subscriptions.

Link copied to clipboard
interface Roots : Iterable<Root>

Handles protocol traffic for client provided roots.

Link copied to clipboard
data class Session(val id: SessionId)
Link copied to clipboard
class SessionBasedClient(sendToClient: (McpJsonRpcRequest) -> Unit, session: Session, logger: Logger, tasks: Tasks, roots: Roots, random: Random, clientTracking: () -> ClientTracking) : Client
Link copied to clipboard
interface Sessions<Transport>

Responsible for managing the lifecycle of client sessions, including the assignment of transport to session, and the sending of messages to the client.

Link copied to clipboard
interface Tasks

Handles protocol traffic for server task management. All operations are scoped by session.

Link copied to clipboard
fun interface TaskUpdateCallback
Link copied to clipboard

Handles protocol traffic for server provided tools.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun RoutingMcpHandler(initializer: Initializer, clientTracking: MutableMap<Session, ClientTracking>, completions: Completions, prompts: Prompts, resources: Resources, tools: Tools, logger: Logger, tasks: Tasks, cancellations: Cancellations, roots: Roots, random: Random, sessions: Sessions<*>): McpHandler
Link copied to clipboard
Link copied to clipboard