Package org.mcpjava.server
package org.mcpjava.server
Core annotations and APIs for building Model Context Protocol (MCP) servers.
@McpServer- Marks a class as an MCP server component@MetaField- Adds custom metadata fields to MCP definitionsCancellation- Request cancellation handlingContentEncoder- Custom content encoding@Icons- Assigns icons to tools, resources and promptsMcpException- Base MCP exceptionMcpRequest- Request metadata
-
ClassDescriptionInterface for determining if an MCP client requested cancellation of an in-progress request.Exception indicating that an MCP request cannot be completed because it was cancelled by the client.Result of a cancellation check.Encodes an object into MCP content.The types of features that an MCP server implemented with this API can provide.Represents an icon that can be associated with tools, resources, or prompts.Builder for creating icons.The theme for an iconProvides icons for a prompt, resource, or tool.Indicates an
IconProviderwhich can provide icons for the annotated Tool, Resource, Resource Template or Prompt.Provides information about a client or server MCP implementationBase exception for MCP-related errors.Provides information about the current request, including the request ID and the metadata fields.Binds features (tools, prompts, resources) to a named MCP server configuration.Container annotation forMcpServerSuper-interface for API types which include data in a_metafield.MetaCarrier.Builder<THIS extends MetaCarrier.Builder<THIS>>Super-interface for builders which can include data in a_metafield.Adds custom metadata fields to the_metaobject in MCP definitions.Container annotation for multipleMetaFieldannotations.The type of metadata value.Indicates the sender or receiver of a message for prompting and sampling, or the audience for a resource