diff --git a/.agents/mcp.json b/.agents/mcp.json index a78269a..891203d 100644 --- a/.agents/mcp.json +++ b/.agents/mcp.json @@ -1,10 +1,7 @@ { "mcpServers": { "axhub-gateway": { - "command": "java", - "args": [ - "C:/eGovFrameDev-4.3.1-64bit/workspace-egov/axhub-backend-main/McpBridge.java" - ] + "url": "http://localhost:8281/mcp/sse" } } } diff --git a/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/sync/RegistryMcpToolSpecificationFactory.java b/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/sync/RegistryMcpToolSpecificationFactory.java index d25c939..16377a9 100644 --- a/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/sync/RegistryMcpToolSpecificationFactory.java +++ b/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/sync/RegistryMcpToolSpecificationFactory.java @@ -2,7 +2,7 @@ package io.shinhanlife.axhub.biz.mcp.gateway.sync; import io.shinhanlife.axhub.biz.mcp.gateway.dto.ToolMetadata; import io.shinhanlife.axhub.biz.mcp.gateway.service.ExecuteService; -import io.modelcontextprotocol.server.McpStatelessServerFeatures; +import io.modelcontextprotocol.server.McpServerFeatures; import io.modelcontextprotocol.spec.McpSchema; import org.springframework.stereotype.Component; import com.fasterxml.jackson.core.type.TypeReference; @@ -31,14 +31,14 @@ public class RegistryMcpToolSpecificationFactory { /** * Registry Entry 하나를 MCP SDK의 stateless sync Tool specification으로 변환합니다. */ - public McpStatelessServerFeatures.SyncToolSpecification create(ToolMetadata entry) { + public McpServerFeatures.SyncToolSpecification create(ToolMetadata entry) { McpSchema.Tool tool = McpSchema.Tool.builder() .name(entry.getName()) .description(description(entry)) .inputSchema(inputSchema(entry)) .build(); - return McpStatelessServerFeatures.SyncToolSpecification.builder() + return McpServerFeatures.SyncToolSpecification.builder() .tool(tool) .callHandler((context, request) -> execute(entry, request)) .build(); diff --git a/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/sync/RegistryMcpToolSynchronizer.java b/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/sync/RegistryMcpToolSynchronizer.java index 63e6bf6..a551c58 100644 --- a/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/sync/RegistryMcpToolSynchronizer.java +++ b/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/sync/RegistryMcpToolSynchronizer.java @@ -2,7 +2,7 @@ package io.shinhanlife.axhub.biz.mcp.gateway.sync; import io.shinhanlife.axhub.biz.mcp.gateway.dto.ToolMetadata; import io.shinhanlife.axhub.biz.mcp.gateway.registry.RedisRegistryService; -import io.modelcontextprotocol.server.McpStatelessSyncServer; +import io.modelcontextprotocol.server.McpSyncServer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.ObjectProvider; @@ -24,13 +24,13 @@ import java.util.stream.Collectors; public class RegistryMcpToolSynchronizer { private static final Logger log = LoggerFactory.getLogger(RegistryMcpToolSynchronizer.class); - private final ObjectProvider mcpServerProvider; + private final ObjectProvider mcpServerProvider; private final RedisRegistryService redisRegistryService; private final RegistryMcpToolSpecificationFactory specificationFactory; private final Set managedToolNames = new LinkedHashSet<>(); private final ReentrantLock lock = new ReentrantLock(); - public RegistryMcpToolSynchronizer(ObjectProvider mcpServerProvider, + public RegistryMcpToolSynchronizer(ObjectProvider mcpServerProvider, RedisRegistryService redisRegistryService, RegistryMcpToolSpecificationFactory specificationFactory) { this.mcpServerProvider = mcpServerProvider; @@ -49,7 +49,7 @@ public class RegistryMcpToolSynchronizer { } public void synchronize() { - McpStatelessSyncServer server = mcpServerProvider.getIfAvailable(); + McpSyncServer server = mcpServerProvider.getIfAvailable(); if (server == null) { return; } diff --git a/axhub-gateway/src/main/resources/application.properties b/axhub-gateway/src/main/resources/application.properties index 7dee1b4..d17f91f 100644 --- a/axhub-gateway/src/main/resources/application.properties +++ b/axhub-gateway/src/main/resources/application.properties @@ -30,7 +30,7 @@ spring.lifecycle.timeout-per-shutdown-phase=20s logging.level.org.apache.kafka=ERROR # Spring AI MCP Server Settings -spring.ai.mcp.server.protocol=STATELESS +# spring.ai.mcp.server.protocol=STATELESS mcp.agent-claims-required=false mcp.trusted-claims-required=false mcp.write-approval-required=false