{
  "openapi": "3.1.0",
  "info": {
    "title": "Motion Brew API",
    "version": "0.1.9",
    "description": "Read only access to the Motion Brew components: an index, one self contained .tsx file per component, and an MCP server (Streamable HTTP, JSON-RPC 2.0, no key)."
  },
  "servers": [
    {
      "url": "https://motion-brew.com"
    }
  ],
  "externalDocs": {
    "description": "MCP setup guide",
    "url": "https://motion-brew.com/mcp"
  },
  "paths": {
    "/r/index.json": {
      "get": {
        "summary": "List every component",
        "operationId": "listComponents",
        "responses": {
          "200": {
            "description": "Every component's slug, name, npm packages and file size",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "slug",
                      "name",
                      "dependencies",
                      "bytes"
                    ],
                    "properties": {
                      "slug": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "dependencies": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "bytes": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/r/{slug}.tsx": {
      "get": {
        "summary": "Get one component as a single file",
        "description": "The component with its animated icons and cn() inlined, ready to save into a project.",
        "operationId": "getComponentFile",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "example": "sidebar-nav"
          }
        ],
        "responses": {
          "200": {
            "description": "The component source",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No component with that slug"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "MCP server",
        "description": "Model Context Protocol over Streamable HTTP, stateless. Tools: search_components, list_components, get_component, get_install_plan, get_setup. Bodies up to 64 KB, batches up to 10 messages.",
        "operationId": "mcp",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/JsonRpcMessage"
                  },
                  {
                    "type": "array",
                    "maxItems": 10,
                    "items": {
                      "$ref": "#/components/schemas/JsonRpcMessage"
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON or batch too large"
          },
          "413": {
            "description": "Body over 64 KB"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "JsonRpcMessage": {
        "type": "object",
        "required": [
          "jsonrpc",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "integer"
            ]
          },
          "method": {
            "type": "string"
          },
          "params": {
            "type": "object"
          }
        }
      }
    }
  }
}