Package org.springframework.ai.mcp.aot
Class McpHints
java.lang.Object
org.springframework.ai.mcp.aot.McpHints
- All Implemented Interfaces:
org.springframework.aot.hint.RuntimeHintsRegistrar
Runtime hints registrar for Model Context Protocol (MCP) schema classes.
This class provides GraalVM native image hints for MCP schema classes to ensure proper reflection access in native images. It:
- Registers all nested classes of
McpSchema
for reflection - Enables all member categories (fields, methods, etc.) for registered types
- Ensures proper serialization/deserialization in native images
- Since:
- 1.0.0
- Author:
- Josh Long
- See Also:
-
RuntimeHintsRegistrar
McpSchema
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
registerHints
(org.springframework.aot.hint.RuntimeHints hints, ClassLoader classLoader) Registers runtime hints for MCP schema classes.
-
Constructor Details
-
McpHints
public McpHints()
-
-
Method Details
-
registerHints
public void registerHints(org.springframework.aot.hint.RuntimeHints hints, @Nullable ClassLoader classLoader) Registers runtime hints for MCP schema classes.This method:
- Discovers all nested classes within
McpSchema
- Registers each discovered class for reflection access
- Enables all member categories for complete reflection support
- Specified by:
registerHints
in interfaceorg.springframework.aot.hint.RuntimeHintsRegistrar
- Parameters:
hints
- the hints instance to register hints withclassLoader
- the classloader to use (may be null)
- Discovers all nested classes within
-