Conversation
- Refactored core logic (HTTPMCPServer, IPCServer, CommandExecutor, etc.) into shared `src/main/java/` and implemented client/server specific interfaces to separate dependencies safely. - Added `MCPServerModServer` entry point for dedicated servers. - Made server tools thread-safe by using `server.submit(() -> ...).get()` for operations mutating the world or executing commands. - Implemented `CommandOutput` interceptor in `ServerCommandExecutor` to retrieve command execution feedback. - Migrated the config file from `mcp-client.json` to `mcp.json` automatically. - Updated the `README.md` to clarify Server vs Client mode differences. Co-authored-by: cuspymd <8870299+cuspymd@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6210eb4274
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/server/java/cuspymd/mcp/mod/server/tools/ServerCommandExecutor.java
Outdated
Show resolved
Hide resolved
src/server/java/cuspymd/mcp/mod/server/tools/ServerCommandExecutor.java
Outdated
Show resolved
Hide resolved
src/main/java/cuspymd/mcp/mod/server/tools/ServerBlockScanner.java
Outdated
Show resolved
Hide resolved
- `ServerCommandExecutor` now runs `SafetyValidator` on incoming commands when `validate_safety` is true (the default) to prevent unauthorized/destructive commands via the server console. - `ServerCommandExecutor` now wraps its result in the standard MCP JSON-RPC format via `MCPProtocol.createSuccessResponse()`, ensuring consistency with the client executor and MCP clients. Co-authored-by: cuspymd <8870299+cuspymd@users.noreply.github.com>
…mappings - Moved `MCPServerModServer` and server tools from `src/server` to `src/main` since there is no `server` sourceSet configured, ensuring they are compiled and packaged into the mod JAR. - Resolved symbol mapping issues with `CommandManager` and `ServerPlayerEntity` for Fabric 1.21.11. - Updated `BlockCompressor` to use a dedicated `BlockData` object to avoid `JsonObject` mapping conflicts across sides. Co-authored-by: cuspymd <8870299+cuspymd@users.noreply.github.com>
`ServerBlockScanner` now returns a JSON object with an `"error"` property when validation or execution fails (e.g., no online players, area too large). This ensures that `HTTPMCPServer` correctly interprets the failure and wraps it as a proper MCP error response, instead of misclassifying it as a successful result containing an embedded error payload. Co-authored-by: cuspymd <8870299+cuspymd@users.noreply.github.com>
|
@codex review latest codes |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 754a75e233
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/main/java/cuspymd/mcp/mod/server/tools/ServerCommandExecutor.java
Outdated
Show resolved
Hide resolved
src/main/java/cuspymd/mcp/mod/server/tools/ServerCommandExecutor.java
Outdated
Show resolved
Hide resolved
src/main/java/cuspymd/mcp/mod/server/tools/ServerBlockScanner.java
Outdated
Show resolved
Hide resolved
- Commands executed by the dispatcher now correctly reflect their execution result by assigning `successCount = server.getCommandManager().getDispatcher().execute(...)`. Previously, `successCount` was hardcoded to `1` as long as it didn't throw an exception, resulting in commands with no effect being marked `applied=true`. Co-authored-by: cuspymd <8870299+cuspymd@users.noreply.github.com>
- Added a separate `appliedCount` integer to track how many commands successfully returned a non-zero side effect from `dispatcher.execute()`. Previously, `appliedCount` was incorrectly set to `acceptedCount`, breaking consistency with the `results[]` array where parsing failures or empty selectors are marked `applied=false` but `accepted=true`. Co-authored-by: cuspymd <8870299+cuspymd@users.noreply.github.com>
- Updated `ServerBlockScanner` to use `getId().toString()` rather than `getId().getPath()` so that the block `minecraft:stone` is correctly identified rather than just `stone`. This matches the behavior of the client scanner and avoids merging blocks from different namespaces with the same path. Co-authored-by: cuspymd <8870299+cuspymd@users.noreply.github.com>
Co-authored-by: cuspymd <8870299+cuspymd@users.noreply.github.com>
|
@codex review latest codes |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e19c24aadf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -20,13 +20,13 @@ public class IPCServer { | |||
| private static final Gson GSON = new Gson(); | |||
| private static final int IPC_PORT = 25565; // Default port for IPC | |||
There was a problem hiding this comment.
Avoid binding IPC listener to the game's default port
IPCServer hardcodes IPC_PORT to 25565, and this commit now starts that listener on dedicated servers when non-HTTP transport is selected. On servers using the normal gameplay port, this creates a bind collision and MCP fails to start for that transport mode. Make the IPC port configurable (or otherwise distinct from the gameplay listener) so dedicated deployments can actually use IPC mode.
Useful? React with 👍 / 👎.
src/main/java/cuspymd/mcp/mod/server/tools/ServerBlockScanner.java
Outdated
Show resolved
Hide resolved
If a dedicated server runs headless automation via MCP, `get_blocks_in_area` should still function even if the server is completely idle (0 players online). Instead of returning an error, it now falls back to scanning the server's Overworld dimension (`server.getOverworld()`). Co-authored-by: cuspymd <8870299+cuspymd@users.noreply.github.com>
This PR adds robust dedicated server support for the MCP mod.
execute_commands,get_player_info, etc.) are now abstracted behind interfaces.HTTPMCPServerandIPCServerhave been moved to shared source code.MinecraftServerandServerWorldclasses without touchingMinecraftClient.MinecraftServerthread usingserver.submit(...).execute_commandsaccurately captures console output from executed commands.README.mdreflects the changes, explaining the differences between Single Player (Client MCP) and Dedicated Server environments, notably thattake_screenshotis unsupported natively on dedicated servers. Configuration file is renamed frommcp-client.jsontomcp.jsonwith fallback.PR created automatically by Jules for task 423232572268798275 started by @cuspymd