Class DefaultMcpAsyncRequestContext
java.lang.Object
org.springaicommunity.mcp.context.DefaultMcpAsyncRequestContext
- All Implemented Interfaces:
McpAsyncRequestContext,McpRequestContextTypes<io.modelcontextprotocol.server.McpAsyncServerExchange>
Async (Reactor) implementation of McpAsyncRequestContext that returns Mono of value
types.
- Author:
- Christian Tzolov
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.springaicommunity.mcp.context.McpRequestContextTypes
McpRequestContextTypes.ElicitationSpec, McpRequestContextTypes.LoggingSpec, McpRequestContextTypes.ModelPreferenceSpec, McpRequestContextTypes.ProgressSpec, McpRequestContextTypes.SamplingSpec -
Method Summary
Modifier and TypeMethodDescriptionbuilder()io.modelcontextprotocol.spec.McpSchema.ClientCapabilitiesio.modelcontextprotocol.spec.McpSchema.Implementationreactor.core.publisher.Mono<Void><T> reactor.core.publisher.Mono<StructuredElicitResult<T>>elicit(com.fasterxml.jackson.core.type.TypeReference<T> type) reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.ElicitResult>elicit(io.modelcontextprotocol.spec.McpSchema.ElicitRequest elicitRequest) <T> reactor.core.publisher.Mono<StructuredElicitResult<T>><T> reactor.core.publisher.Mono<StructuredElicitResult<T>>elicit(Consumer<McpRequestContextTypes.ElicitationSpec> spec, com.fasterxml.jackson.core.type.TypeReference<T> type) <T> reactor.core.publisher.Mono<StructuredElicitResult<T>>elicit(Consumer<McpRequestContextTypes.ElicitationSpec> spec, Class<T> type) reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.ElicitResult>reactor.core.publisher.Mono<Boolean>reactor.core.publisher.Mono<Void>io.modelcontextprotocol.server.McpAsyncServerExchangeexchange()reactor.core.publisher.Mono<Void>reactor.core.publisher.Mono<Void>log(Consumer<McpRequestContextTypes.LoggingSpec> logSpec) reactor.core.publisher.Mono<Object>ping()reactor.core.publisher.Mono<Void>progress(int percentage) reactor.core.publisher.Mono<Void>progress(io.modelcontextprotocol.spec.McpSchema.ProgressNotification progressNotification) reactor.core.publisher.Mono<Void>progress(Consumer<McpRequestContextTypes.ProgressSpec> progressSpec) io.modelcontextprotocol.spec.McpSchema.Requestrequest()reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.ListRootsResult>roots()reactor.core.publisher.Mono<Boolean>reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CreateMessageResult>sample(io.modelcontextprotocol.spec.McpSchema.CreateMessageRequest createMessageRequest) reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CreateMessageResult>reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CreateMessageResult>sample(Consumer<McpRequestContextTypes.SamplingSpec> samplingSpec) reactor.core.publisher.Mono<Boolean>io.modelcontextprotocol.common.McpTransportContextreactor.core.publisher.Mono<Void>
-
Method Details
-
rootsEnabled
- Specified by:
rootsEnabledin interfaceMcpAsyncRequestContext
-
roots
public reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.ListRootsResult> roots()- Specified by:
rootsin interfaceMcpAsyncRequestContext
-
elicitEnabled
- Specified by:
elicitEnabledin interfaceMcpAsyncRequestContext
-
elicit
public <T> reactor.core.publisher.Mono<StructuredElicitResult<T>> elicit(Consumer<McpRequestContextTypes.ElicitationSpec> spec, com.fasterxml.jackson.core.type.TypeReference<T> type) - Specified by:
elicitin interfaceMcpAsyncRequestContext
-
elicit
public <T> reactor.core.publisher.Mono<StructuredElicitResult<T>> elicit(Consumer<McpRequestContextTypes.ElicitationSpec> spec, Class<T> type) - Specified by:
elicitin interfaceMcpAsyncRequestContext
-
elicit
public <T> reactor.core.publisher.Mono<StructuredElicitResult<T>> elicit(com.fasterxml.jackson.core.type.TypeReference<T> type) - Specified by:
elicitin interfaceMcpAsyncRequestContext
-
elicit
- Specified by:
elicitin interfaceMcpAsyncRequestContext
-
elicit
public reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.ElicitResult> elicit(io.modelcontextprotocol.spec.McpSchema.ElicitRequest elicitRequest) - Specified by:
elicitin interfaceMcpAsyncRequestContext
-
elicitationInternal
-
sampleEnabled
- Specified by:
sampleEnabledin interfaceMcpAsyncRequestContext
-
sample
public reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CreateMessageResult> sample(String... messages) - Specified by:
samplein interfaceMcpAsyncRequestContext
-
sample
public reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CreateMessageResult> sample(Consumer<McpRequestContextTypes.SamplingSpec> samplingSpec) - Specified by:
samplein interfaceMcpAsyncRequestContext
-
sample
public reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CreateMessageResult> sample(io.modelcontextprotocol.spec.McpSchema.CreateMessageRequest createMessageRequest) - Specified by:
samplein interfaceMcpAsyncRequestContext
-
progress
- Specified by:
progressin interfaceMcpAsyncRequestContext
-
progress
public reactor.core.publisher.Mono<Void> progress(Consumer<McpRequestContextTypes.ProgressSpec> progressSpec) - Specified by:
progressin interfaceMcpAsyncRequestContext
-
progress
public reactor.core.publisher.Mono<Void> progress(io.modelcontextprotocol.spec.McpSchema.ProgressNotification progressNotification) - Specified by:
progressin interfaceMcpAsyncRequestContext
-
ping
- Specified by:
pingin interfaceMcpAsyncRequestContext
-
log
- Specified by:
login interfaceMcpAsyncRequestContext
-
debug
- Specified by:
debugin interfaceMcpAsyncRequestContext
-
info
- Specified by:
infoin interfaceMcpAsyncRequestContext
-
warn
- Specified by:
warnin interfaceMcpAsyncRequestContext
-
error
- Specified by:
errorin interfaceMcpAsyncRequestContext
-
request
public io.modelcontextprotocol.spec.McpSchema.Request request()- Specified by:
requestin interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpAsyncServerExchange>
-
exchange
public io.modelcontextprotocol.server.McpAsyncServerExchange exchange()- Specified by:
exchangein interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpAsyncServerExchange>
-
sessionId
- Specified by:
sessionIdin interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpAsyncServerExchange>
-
clientInfo
public io.modelcontextprotocol.spec.McpSchema.Implementation clientInfo()- Specified by:
clientInfoin interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpAsyncServerExchange>
-
clientCapabilities
public io.modelcontextprotocol.spec.McpSchema.ClientCapabilities clientCapabilities()- Specified by:
clientCapabilitiesin interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpAsyncServerExchange>
-
requestMeta
- Specified by:
requestMetain interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpAsyncServerExchange>
-
transportContext
public io.modelcontextprotocol.common.McpTransportContext transportContext()- Specified by:
transportContextin interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpAsyncServerExchange>
-
builder
-