Annotation Interface McpServerApplication


@Target(TYPE) @Retention(RUNTIME) public @interface McpServerApplication
This annotation is used to mark a class as an MCP (Model Context Protocol) server application.

The base package for component scanning can be specified via the basePackage attribute. If not specified, the package of the annotated class will be used.

Example usage:


 @McpServerApplication(basePackage = "com.example.mcp")
 public class MyMcpServerApplication {
     // Application logic...
 }
 
Author:
codeboyzhou
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The base package for component scanning.
    The base package class for component scanning.
  • Element Details

    • basePackage

      String basePackage
      The base package for component scanning. Defaults to the package of the annotated class.
      Returns:
      the base package for component scanning
      Default:
      ""
    • basePackageClass

      Class<?> basePackageClass
      The base package class for component scanning. Defaults to Object.class.

      Note: This attribute is intended to be used when the base package cannot be determined statically. In most cases, basePackage() should be used instead.

      Returns:
      the base package class for component scanning
      Default:
      java.lang.Object.class