{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hedgr-app/json-schema/hedgr-app-mcp-discovery-schema.json",
  "title": "McpDiscovery",
  "description": "Public MCP discovery document: capabilities, transport, tools, and the MCP Apps UI surface.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hedgr-app-openapi.json#/components/schemas/McpDiscovery",
  "type": "object",
  "required": [
    "name",
    "protocolVersion",
    "transport",
    "capabilities"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "protocolVersion": {
      "type": "string",
      "description": "Default protocol version offered to a non-negotiating client."
    },
    "protocolVersions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Every protocol version this server accepts."
    },
    "transport": {
      "type": "string",
      "enum": [
        "streamable-http"
      ]
    },
    "endpoint": {
      "type": "string",
      "format": "uri"
    },
    "homepage": {
      "type": "string",
      "format": "uri"
    },
    "docs_url": {
      "type": "string",
      "format": "uri"
    },
    "capabilities": {
      "$ref": "#/$defs/McpCapabilities"
    },
    "ui": {
      "$ref": "#/$defs/McpUiSurface"
    },
    "tools": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/McpToolDefinition"
      }
    },
    "tool_count": {
      "type": "integer"
    },
    "read_only": {
      "type": "boolean",
      "description": "true - no MCP tool mutates data, executes a trade, or moves funds."
    },
    "oauth": {
      "type": "object",
      "properties": {
        "authorization_endpoint": {
          "type": "string"
        },
        "token_endpoint": {
          "type": "string"
        },
        "registration_endpoint": {
          "type": "string"
        },
        "scopes_supported": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "code_challenge_methods_supported": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "protected_resource_metadata": {
          "type": "string",
          "format": "uri"
        },
        "authorization_server_metadata": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  },
  "$defs": {
    "McpCapabilities": {
      "type": "object",
      "description": "MCP server capabilities, identical to the authenticated initialize response.",
      "properties": {
        "tools": {
          "type": "object",
          "additionalProperties": true
        },
        "resources": {
          "type": "object",
          "additionalProperties": true
        },
        "extensions": {
          "type": "object",
          "additionalProperties": true,
          "description": "Declares io.modelcontextprotocol/ui (MCP Apps, SEP-1865) with its supported mime types."
        }
      }
    },
    "McpToolDefinition": {
      "type": "object",
      "description": "One callable MCP tool, in the shape tools/list returns.",
      "required": [
        "name",
        "description",
        "inputSchema"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "inputSchema": {
          "type": "object",
          "additionalProperties": true,
          "description": "JSON Schema for the tool arguments."
        },
        "outputSchema": {
          "type": "object",
          "additionalProperties": true,
          "description": "JSON Schema for the tool result envelope (structuredContent)."
        },
        "_meta": {
          "type": "object",
          "additionalProperties": true,
          "description": "Optional; carries ui.resourceUri for tools that render an MCP App."
        }
      }
    },
    "McpUiSurface": {
      "type": "object",
      "description": "The MCP Apps (SEP-1865) surface: which ui:// resources exist and which tools render one.",
      "properties": {
        "extension": {
          "type": "string"
        },
        "spec": {
          "type": "string"
        },
        "mimeType": {
          "type": "string"
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "tools_with_ui": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "tool": {
                "type": "string"
              },
              "resourceUri": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}