Class BuiltinMcpResources

java.lang.Object
eu.mrapik.minecraftservermcp.builtin.resources.BuiltinMcpResources

public final class BuiltinMcpResources extends Object
Registers built-in MCP resources and URI templates for filesystem read/list and player snapshots. Policy is enforced by ResourceInvocationGate using the same access.*.tools.* keys as tools (BuiltinToolIds).

Clients and MCP Inspector: Resource templates expose stable URIs (see BuiltinResourceUris). Generic MCP UIs list resources and may open a URI editor; they typically do not show pickers for query parameters such as name= or path=. Interactive completion would require an MCP completion handler wired to those references, which this plugin does not register. Listing online players still works by reading the minecraft-server-mcp://players/list resource or by calling player/get?name=... with a typed name.

  • Method Details

    • registerAll

      public static void registerAll(io.modelcontextprotocol.server.McpAsyncServer server, JavaPlugin plugin, AtomicReference<PluginSettings> settingsRef, ServerFilePaths paths, BuiltinToolContext ctx)
      Adds all built-in resources to the MCP server (blocking until registration completes).
      Parameters:
      server - async MCP server
      plugin - MCP plugin
      settingsRef - live settings
      paths - server root paths
      ctx - shared context for main-thread scheduling