Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/client/java/cuspymd/mcp/mod/MCPServerModClient.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cuspymd.mcp.mod;

import net.fabricmc.api.ClientModInitializer;
import cuspymd.mcp.mod.bridge.IPCServer;
import cuspymd.mcp.mod.bridge.HTTPMCPServer;
import cuspymd.mcp.mod.config.MCPConfig;
import cuspymd.mcp.mod.utils.ScreenshotUtils;
Expand All @@ -11,7 +10,6 @@

public class MCPServerModClient implements ClientModInitializer {
public static final Logger LOGGER = LoggerFactory.getLogger("mcp-server-mod");
private IPCServer ipcServer;
private HTTPMCPServer httpServer;

@Override
Expand All @@ -37,10 +35,7 @@ public void onInitializeClient() {
httpServer.start();
LOGGER.info("HTTP MCP Server started on port {}", httpServer.getPort());
} else {
// Default to stdio transport
ipcServer = new IPCServer(config, new cuspymd.mcp.mod.command.CommandExecutor(config));
ipcServer.start();
LOGGER.info("IPC Server started on port {}", ipcServer.getPort());
LOGGER.warn("Unsupported transport: {}. Only 'http' is supported.", transport);
}
}
} catch (Exception e) {
Expand All @@ -49,10 +44,6 @@ public void onInitializeClient() {
}

public void onClientShutdown() {
if (ipcServer != null) {
ipcServer.stop();
LOGGER.info("IPC Server stopped");
}
if (httpServer != null) {
httpServer.stop();
LOGGER.info("HTTP MCP Server stopped");
Expand Down
11 changes: 1 addition & 10 deletions src/main/java/cuspymd/mcp/mod/MCPServerModServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
import net.fabricmc.api.DedicatedServerModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import cuspymd.mcp.mod.bridge.HTTPMCPServer;
import cuspymd.mcp.mod.bridge.IPCServer;
import cuspymd.mcp.mod.config.MCPConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MCPServerModServer implements DedicatedServerModInitializer {
public static final Logger LOGGER = LoggerFactory.getLogger("mcp-server-mod");
private HTTPMCPServer httpServer;
private IPCServer ipcServer;

@Override
public void onInitializeServer() {
Expand All @@ -34,10 +32,7 @@ public void onInitializeServer() {
httpServer.start();
LOGGER.info("HTTP MCP Server started on port {}", httpServer.getPort());
} else {
// Default to stdio transport
ipcServer = new IPCServer(config, new cuspymd.mcp.mod.server.tools.ServerCommandExecutor(config, server));
ipcServer.start();
LOGGER.info("IPC Server started on port {}", ipcServer.getPort());
LOGGER.warn("Unsupported transport: {}. Only 'http' is supported.", transport);
}
}
} catch (Exception e) {
Expand All @@ -46,10 +41,6 @@ public void onInitializeServer() {
});

ServerLifecycleEvents.SERVER_STOPPING.register(server -> {
if (ipcServer != null) {
ipcServer.stop();
LOGGER.info("IPC Server stopped");
}
if (httpServer != null) {
httpServer.stop();
LOGGER.info("HTTP MCP Server stopped");
Expand Down
97 changes: 0 additions & 97 deletions src/main/java/cuspymd/mcp/mod/bridge/IPCClient.java

This file was deleted.

132 changes: 0 additions & 132 deletions src/main/java/cuspymd/mcp/mod/bridge/IPCServer.java

This file was deleted.