Package burp.mcp.util

Class McpJson

java.lang.Object
burp.mcp.util.McpJson

public class McpJson extends Object
JSON-RPC 2.0 encoding/decoding utilities.
  • Constructor Details

    • McpJson

      public McpJson()
  • Method Details

    • parseRequest

      public static McpJson.JsonRpcRequest parseRequest(String json)
    • toJson

      public static String toJson(Object obj)
    • buildResponse

      public static String buildResponse(Object result, Object id)
    • buildError

      public static String buildError(int code, String message, Object data, Object id)
    • createObjectNode

      public static com.fasterxml.jackson.databind.node.ObjectNode createObjectNode()
    • createArrayNode

      public static com.fasterxml.jackson.databind.node.ArrayNode createArrayNode()
    • property

      public static com.fasterxml.jackson.databind.node.ObjectNode property(String type, String description)
      Create a JSON Schema property node with type and description. Example: property("string", "The target URL") produces: {"type": "string", "description": "The target URL"}
    • property

      public static com.fasterxml.jackson.databind.node.ObjectNode property(String type, String description, Object defaultValue)
      Create a JSON Schema property node with type, description, and default value. Example: property("boolean", "Follow redirects", true) produces: {"type": "boolean", "description": "Follow redirects", "default": true}
    • generateExampleJson

      public static String generateExampleJson(com.fasterxml.jackson.databind.node.ObjectNode schema)
      Generate an example/default JSON object from a JSON Schema properties node. Returns a pretty-printed JSON string with sensible defaults for each property.
    • mapper

      public static com.fasterxml.jackson.databind.ObjectMapper mapper()