Package com.ssgllc.fish.config.mcp
Class McpServerConfig
java.lang.Object
com.ssgllc.fish.config.mcp.McpServerConfig
Core MCP server infrastructure configuration.
Registers the minimal set of tools, prompts, and resources that must be present
at server startup so that MCP capability negotiation succeeds, then applies two
compatibility patches needed for Spring AI 1.1.2 / mcp-core 0.17.0 with
Claude Code 2.1.74+ (see mcpServerCompatibilityPatch(org.springframework.beans.factory.ObjectProvider<io.modelcontextprotocol.server.McpStatelessSyncServer>, com.fasterxml.jackson.databind.ObjectMapper)).
Initial tool
get-version-information— returns the Casetivity application version string
Initial prompt
casetivity-description— one-line platform description for AI context
Initial resources
texttemplate://EnvConfig— compact JSON of the EnvConfig text templatefile://datamodel.json— compact JSON of the full application data model
Additional tools, prompts, and resources are registered by the other
Mcp*Config beans and dynamically refreshed via
McpRegistryRefresher.
Active only when spring.ai.mcp.server.enabled=true.
Enable by adding mcp to SPRING_PROFILES_ACTIVE; the profile
loads application-mcp.yml.
Local inspection
npx @modelcontextprotocol/inspector # Connect to: http://localhost:8080/mcp
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMcpServerConfig(com.ssgllc.fish.config.CasetivityProperties casetivityProperties, com.fasterxml.jackson.databind.ObjectMapper mapper) -
Method Summary
Modifier and TypeMethodDescriptionList<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncPromptSpecification> Registers initial prompts on startup so prompt capabilities are enabled.List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncResourceSpecification> Registers initial resources on startup so resource capabilities are enabled.List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification> Registers initial tools on startup so tool capabilities are enabled.org.springframework.beans.factory.SmartInitializingSingletonmcpServerCompatibilityPatch(org.springframework.beans.factory.ObjectProvider<io.modelcontextprotocol.server.McpStatelessSyncServer> syncServerProvider, com.fasterxml.jackson.databind.ObjectMapper mcpServerObjectMapper) Workaround for two Spring AI 1.1.2 / mcp-core 0.17.0 compatibility issues with Claude Code 2.1.74+ (which sends protocol2025-11-25): jsonMapper:McpServerStatelessAutoConfigurationnever calls.jsonMapper(...)on the server builder, so the server falls back toMcpJsonMapper.getDefault()— a plainnew ObjectMapper()withFAIL_ON_UNKNOWN_PROPERTIES=true.
-
Constructor Details
-
McpServerConfig
public McpServerConfig(com.ssgllc.fish.config.CasetivityProperties casetivityProperties, com.fasterxml.jackson.databind.ObjectMapper mapper)
-
-
Method Details
-
initialTools
@Bean public List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification> initialTools() throws com.fasterxml.jackson.core.JsonProcessingExceptionRegisters initial tools on startup so tool capabilities are enabled.- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
initialPrompts
@Bean public List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncPromptSpecification> initialPrompts()Registers initial prompts on startup so prompt capabilities are enabled. -
initialResources
@Bean public List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncResourceSpecification> initialResources()Registers initial resources on startup so resource capabilities are enabled. -
mcpServerCompatibilityPatch
@Bean public org.springframework.beans.factory.SmartInitializingSingleton mcpServerCompatibilityPatch(org.springframework.beans.factory.ObjectProvider<io.modelcontextprotocol.server.McpStatelessSyncServer> syncServerProvider, @Qualifier("mcpServerObjectMapper") com.fasterxml.jackson.databind.ObjectMapper mcpServerObjectMapper) Workaround for two Spring AI 1.1.2 / mcp-core 0.17.0 compatibility issues with Claude Code 2.1.74+ (which sends protocol2025-11-25):- jsonMapper:
McpServerStatelessAutoConfigurationnever calls.jsonMapper(...)on the server builder, so the server falls back toMcpJsonMapper.getDefault()— a plainnew ObjectMapper()withFAIL_ON_UNKNOWN_PROPERTIES=true. Claude Code sendscapabilities.elicitation.form/url; the SDK'sElicitationrecord has 0 known fields and no@JsonIgnoreProperties, causing a silent-32603error. Fix: replace withmcpServerObjectMapperwhich hasFAIL_ON_UNKNOWN_PROPERTIES=false. - protocolVersions: The transport hardcodes
["2025-03-26", "2025-06-18"]. When Claude Code sends2025-11-25, the server downgrades to2025-06-18and Claude Code rejects the connection. Fix: add"2025-11-25"to the supported list. The two protocol versions are backward-compatible for our feature set.
- jsonMapper:
-