{
  "openapi": "3.1.0",
  "info": {
    "title": "Clubhouse.so Agent Discovery API",
    "version": "1.0.0",
    "description": "Public machine-readable discovery surface for Clubhouse.so, including agent-ready well-known endpoints, a lightweight MCP server, and health metadata."
  },
  "servers": [
    {
      "url": "https://clubhouse.so"
    }
  ],
  "externalDocs": {
    "description": "Human-readable API documentation",
    "url": "https://clubhouse.so/docs/api/"
  },
  "components": {
    "securitySchemes": {
      "supabaseBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Supabase access token issued by the Clubhouse.so Supabase Auth project."
      }
    }
  },
  "paths": {
    "/.well-known/api-catalog": {
      "get": {
        "summary": "Return the RFC 9727 API catalog",
        "responses": {
          "200": {
            "description": "API catalog in linkset JSON format",
            "content": {
              "application/linkset+json": {}
            }
          }
        }
      }
    },
    "/.well-known/openid-configuration": {
      "get": {
        "summary": "Return OpenID Connect discovery metadata",
        "responses": {
          "200": {
            "description": "OIDC discovery document",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/.well-known/oauth-authorization-server": {
      "get": {
        "summary": "Return OAuth authorization server metadata",
        "responses": {
          "200": {
            "description": "OAuth metadata document",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource": {
      "get": {
        "summary": "Return protected resource metadata for the MCP endpoint",
        "responses": {
          "200": {
            "description": "Protected resource metadata",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/.well-known/agent-skills/index.json": {
      "get": {
        "summary": "Return the Clubhouse.so agent skills discovery index",
        "responses": {
          "200": {
            "description": "Agent skills discovery index",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/.well-known/mcp/server-card.json": {
      "get": {
        "summary": "Return the Clubhouse.so MCP server card",
        "responses": {
          "200": {
            "description": "MCP server card metadata",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "summary": "Health check endpoint",
        "responses": {
          "200": {
            "description": "Health status",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/api/mcp": {
      "get": {
        "summary": "Describe the lightweight MCP transport endpoint",
        "responses": {
          "200": {
            "description": "Transport summary",
            "content": {
              "application/json": {}
            }
          }
        }
      },
      "post": {
        "summary": "Streamable HTTP MCP endpoint",
        "description": "Accepts JSON-RPC requests for initialize, tools/list, and tools/call.",
        "security": [
          {
            "supabaseBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC success response",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "description": "Missing or invalid bearer token"
          }
        }
      }
    }
  }
}
