Interface McpToolInvocation
- All Known Implementing Classes:
McpToolInvocationImpl
tools/call: the raw MCP request, the authenticated access profile,
and the effective policy for this tool id.
The HTTP layer attaches the client's token to the transport context before the MCP stack invokes handler.
The implementation resolves that token to a TokenAccessProfile and loads
access.<profileName>.tools.<toolId> as a ToolAccessConfig. If the profile has no section
for this tool id, a permissive default applies (tool enabled, no list filters).
-
Method Summary
Modifier and TypeMethodDescription@NotNull io.modelcontextprotocol.server.McpAsyncServerExchangeexchange()MCP session exchange (transport, session state).@NotNull JavaPluginThe MinecraftServerMCP plugin instance (scheduler, data folder, logger).@NotNull PluginSettingsSnapshot of global plugin settings (bind address, port,PluginSettings.maxReadBytes(), etc.).@NotNull TokenAccessProfileprofile()Access profile tied to the token used on this connection (fromconfig.ymlaccess.*).io.modelcontextprotocol.spec.McpSchema.CallToolRequestrequest()The tool call request, including theargumentsmap parsed from JSON.@NotNull ServerFilePathsPaths relative to the Minecraft server root directory, with traversal checks.@NotNull ToolAccessConfigEffective policy forMcpToolDefinition.id()under this profile.
-
Method Details
-
exchange
@NotNull @NotNull io.modelcontextprotocol.server.McpAsyncServerExchange exchange()MCP session exchange (transport, session state).- Returns:
- the async server exchange for this request
-
request
@NotNull io.modelcontextprotocol.spec.McpSchema.CallToolRequest request()The tool call request, including theargumentsmap parsed from JSON.- Returns:
- the MCP
CallToolRequest
-
profile
Access profile tied to the token used on this connection (fromconfig.ymlaccess.*).- Returns:
- profile name and token metadata
-
toolConfig
Effective policy forMcpToolDefinition.id()under this profile.Standard keys map to typed fields (file/folder/command lists). Any other keys from the YAML section are preserved in
ToolAccessConfig.extra()for custom tools.- Returns:
- merged policy; never null
-
mcpPlugin
The MinecraftServerMCP plugin instance (scheduler, data folder, logger).- Returns:
- this MCP plugin
-
serverPaths
Paths relative to the Minecraft server root directory, with traversal checks.Use when implementing file-based tools so paths stay within the server tree.
- Returns:
- resolved server root and helpers
-
pluginSettings
Snapshot of global plugin settings (bind address, port,PluginSettings.maxReadBytes(), etc.).Reflects configuration at invocation time; call
MinecraftServerMcp.reloadConfiguration()on the service to reloadconfig.ymlbefore relying on updated values in new invocations.- Returns:
- current
PluginSettings
-