java.lang.Object
org.nasdanika.cli.CommandBase
org.nasdanika.cli.CommandGroup
org.nasdanika.ai.mcp.McpServerCommandBase
- All Implemented Interfaces:
Callable<Integer>,McpAsyncServerProvider,Closeable
- Direct Known Subclasses:
McpServerCommand
Base class for MCP server commands.
This class does nothing - you'd need to override one or more of
getResourceSpecifications(), getToolSpecifications(), or getPromptSpecifications() methods
to provide server capabilities.
-
Field Summary
Fields inherited from class org.nasdanika.cli.CommandBase
capabilityLoader, spec -
Constructor Summary
ConstructorsConstructorDescriptionMcpServerCommandBase(io.opentelemetry.api.OpenTelemetry openTelemetry) McpServerCommandBase(CapabilityLoader capabilityLoader, io.opentelemetry.api.OpenTelemetry openTelemetry) -
Method Summary
Modifier and TypeMethodDescriptionio.modelcontextprotocol.server.McpAsyncServercreateServer(io.modelcontextprotocol.spec.McpServerTransportProvider transportProvider) protected Stringprotected StringgetName()MCP Server name, this implementation returns command name.Collection<io.modelcontextprotocol.server.McpServerFeatures.AsyncPromptSpecification>Collection<io.modelcontextprotocol.server.McpServerFeatures.AsyncResourceSpecification>Collection<io.modelcontextprotocol.server.McpServerFeatures.AsyncToolSpecification>protected StringMCP Server name, this implementation returns command name.protected booleanprotected voidmeasureDuration(String name, long duration) Methods inherited from class org.nasdanika.cli.CommandGroup
callMethods inherited from class org.nasdanika.cli.CommandBase
close, getCapabilityLoader
-
Constructor Details
-
McpServerCommandBase
-
McpServerCommandBase
public McpServerCommandBase(CapabilityLoader capabilityLoader, io.opentelemetry.api.OpenTelemetry openTelemetry)
-
-
Method Details
-
getResourceSpecifications
public Collection<io.modelcontextprotocol.server.McpServerFeatures.AsyncResourceSpecification> getResourceSpecifications() -
getToolSpecifications
public Collection<io.modelcontextprotocol.server.McpServerFeatures.AsyncToolSpecification> getToolSpecifications() -
getPromptSpecifications
public Collection<io.modelcontextprotocol.server.McpServerFeatures.AsyncPromptSpecification> getPromptSpecifications() -
isLogging
-
measureDuration
-
createServer
public io.modelcontextprotocol.server.McpAsyncServer createServer(io.modelcontextprotocol.spec.McpServerTransportProvider transportProvider) - Specified by:
createServerin interfaceMcpAsyncServerProvider
-
getInstrumentationScopeName
-
getName
MCP Server name, this implementation returns command name. -
getVersion
MCP Server name, this implementation returns command name.
-