Package io.micronaut.mcp.server.registry
Class ResourceTemplateRegistry
java.lang.Object
io.micronaut.mcp.server.registry.ResourceTemplateRegistry
@Requires(beans=McpServerConfiguration.class)
@Singleton
@Internal
public final class ResourceTemplateRegistry
extends Object
The registry of
ResourceTemplate
-annotated methods.
Produces MCP Resource Template specifications with handlers that invoke the annotated methods.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final io.micronaut.context.BeanContext
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
addMethod
(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?, ?> method) Adds a new method to the registry by associating it with a given bean definition.Returns a stream of the methods currently stored in the registry.List<io.modelcontextprotocol.server.McpServerFeatures.AsyncResourceTemplateSpecification>
List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncResourceTemplateSpecification>
List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncResourceTemplateSpecification>
List<io.modelcontextprotocol.server.McpServerFeatures.SyncResourceTemplateSpecification>
boolean
protected io.modelcontextprotocol.spec.McpError
prepareBoundVariables
(io.micronaut.inject.ExecutableMethod<?, ?> executable, List<?> parameters) protected @Nullable io.modelcontextprotocol.common.McpTransportContext
-
Field Details
-
MEMBER_DESCRIPTION
- See Also:
-
KEY_TYPE
- See Also:
-
DESCRIPTION_PROPERTY
- See Also:
-
MIME_TYPE_PROPERTY
- See Also:
-
NAME_PROPERTY
- See Also:
-
TITLE_PROPERTY
- See Also:
-
URI_PROPERTY
- See Also:
-
URI_TEMPLATE_PROPERTY
- See Also:
-
MEMBER_NAME
- See Also:
-
MEMBER_TITLE
- See Also:
-
methods
-
beanContext
protected final io.micronaut.context.BeanContext beanContext
-
-
Method Details
-
getSyncSpecs
public List<io.modelcontextprotocol.server.McpServerFeatures.SyncResourceTemplateSpecification> getSyncSpecs() -
getAsyncSpecs
public List<io.modelcontextprotocol.server.McpServerFeatures.AsyncResourceTemplateSpecification> getAsyncSpecs() -
getStatelessSyncSpecs
public List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncResourceTemplateSpecification> getStatelessSyncSpecs() -
getStatelessAsyncSpecs
public List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncResourceTemplateSpecification> getStatelessAsyncSpecs() -
isNotEmpty
public boolean isNotEmpty() -
addMethod
public final void addMethod(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?, ?> method) Adds a new method to the registry by associating it with a given bean definition.- Parameters:
beanDefinition
- the bean definition that declares or provides the methodmethod
- the executable method to be added to the registry
-
drainMethods
protected final Stream<io.micronaut.mcp.server.registry.AbstractMcpMethodRegistry.Method<Object>> drainMethods()Returns a stream of the methods currently stored in the registry. After the stream is consumed or closed, the underlying list of methods will be cleared.- Returns:
- a stream of methods from the registry
-
mcpError
-
prepareBoundVariables
-
resolveMcpTransportContext
@Nullable protected @Nullable io.modelcontextprotocol.common.McpTransportContext resolveMcpTransportContext(Object ctx)
-