Package burp.mcp.tool

Class McpToolRegistry

java.lang.Object
burp.mcp.tool.McpToolRegistry

public class McpToolRegistry extends Object
Registry of all MCP tools. Routes tool calls to implementations.
  • Constructor Details

    • McpToolRegistry

      public McpToolRegistry(burp.api.montoya.MontoyaApi api)
  • Method Details

    • register

      public void register(Tool tool)
      Register a single tool.
    • registerAllTools

      public void registerAllTools()
      Register all tools from all categories.
    • toolCount

      public int toolCount()
      Return the number of registered tools.
    • getToolNames

      public Set<String> getToolNames()
      Return the names of all registered tools.
    • getTool

      public Tool getTool(String name)
      Get a specific tool by name. Returns null if not found.
    • resolveAlias

      public static String resolveAlias(String name)
      Resolve common user-facing aliases to canonical tool names. Public so the server permission gate can canonicalize before checking.
    • canonicalName

      public static String canonicalName(String name)
      Canonicalize a tool name for permission checks, metrics, and dispatch. Null-safe: returns null when input is null.
    • listTools

      public List<Map<String,Object>> listTools()
      List all registered tools as JSON-compatible Maps.
    • callTool

      public Object callTool(String name, Map<String,Object> args) throws McpError
      Call a tool by name with the given arguments. Returns the tool result as an Object (JSON-serializable).
      Throws:
      McpError