From 9c6f640ea54dc265b1149903b8dba60d65efe8ed Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Tue, 19 Aug 2025 01:41:14 +0200 Subject: [PATCH] clean: Rename McpServer to McpServerLogConsumer --- java/dev/enola/ai/mcp/McpLoader.java | 2 +- .../mcp/{McpServer.java => McpServerLogConsumer.java} | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) rename java/dev/enola/ai/mcp/{McpServer.java => McpServerLogConsumer.java} (81%) diff --git a/java/dev/enola/ai/mcp/McpLoader.java b/java/dev/enola/ai/mcp/McpLoader.java index bb9433b75..f31609a8e 100644 --- a/java/dev/enola/ai/mcp/McpLoader.java +++ b/java/dev/enola/ai/mcp/McpLoader.java @@ -124,7 +124,7 @@ private static McpSyncClient createSyncClient(McpClientTransport transport, Stri // TODO Make this configurable - but how & from where? // .initializationTimeout(Duration.ofSeconds(7)) // .requestTimeout(Duration.ofSeconds(7)) - .loggingConsumer(new McpServer(origin)) + .loggingConsumer(new McpServerLogConsumer(origin)) .build(); client.initialize(); client.ping(); diff --git a/java/dev/enola/ai/mcp/McpServer.java b/java/dev/enola/ai/mcp/McpServerLogConsumer.java similarity index 81% rename from java/dev/enola/ai/mcp/McpServer.java rename to java/dev/enola/ai/mcp/McpServerLogConsumer.java index f453a2e0e..42f5869ab 100644 --- a/java/dev/enola/ai/mcp/McpServer.java +++ b/java/dev/enola/ai/mcp/McpServerLogConsumer.java @@ -26,13 +26,17 @@ import java.util.function.Consumer; -class McpServer implements Consumer { +class McpServerLogConsumer implements Consumer { - private static final Logger LOG = LoggerFactory.getLogger(McpServer.class); + // TODO: If https://github.com/modelcontextprotocol/java-sdk/pull/503 + // is accepted and merged, the eventually replace this by that? + // But that doesn't have the origin... hm. Add it? + + private static final Logger LOG = LoggerFactory.getLogger(McpServerLogConsumer.class); private final String origin; - public McpServer(String origin) { + public McpServerLogConsumer(String origin) { this.origin = origin; }