{
  "openapi": "3.0.3",
  "info": {
    "title": "OwlCAD 3D CAD & Printing API",
    "description": "API & MCP endpoints for parametric 3D CAD modeling, mesh evaluation, print checks, and file export (STL, 3MF, OBJ, GLB, STEP). Conventions: millimetres, Z-up, rotation in DEGREES.",
    "version": "1.0.0",
    "contact": {
      "name": "OwlCAD Engineering",
      "url": "https://owlcad.com/mcp-server",
      "email": "contact@owlcad.com"
    }
  },
  "servers": [
    {
      "url": "https://mcp.owlcad.com",
      "description": "Stateless Streamable HTTP MCP Server"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/": {
      "post": {
        "summary": "Execute MCP Tool or Resource Request",
        "description": "Send a JSON-RPC 2.0 POST payload to execute MCP tools (`evaluate`, `print_check`, `measure`, `check_interference`, `render`, `export`, `export_step`, `job_status`, `export_2d`, `save_project`, `list_projects`, `get_project`, `create_upload`, `import_model`, `import_2d`, `list_parts`, `read_resource`, `update_project`, `edit_nodes`, `edit_project`, `remix_project`, `organize_project`, `list_folders`, `delete_project`, `repair_project`, `split_for_printing`, `share_project`, `open_in_editor`, `ask_help`) or read resources (`owlcad://schema/primitives`, `owlcad://schema/conventions`, `owlcad://schema/fasteners`, `owlcad://schema/edit-ops`, `owlcad://printers`, `owlcad://materials`, `owlcad://project/{projectId}`).",
        "operationId": "executeMcpRequest",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": { "type": "string", "example": "2.0" },
                  "id": { "type": "string", "example": "1" },
                  "method": { "type": "string", "example": "tools/call" },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": { "type": "string", "example": "evaluate" },
                      "arguments": { "type": "object" }
                    }
                  }
                },
                "required": ["jsonrpc", "method"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response containing tool output or resource payload.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jsonrpc": { "type": "string", "example": "2.0" },
                    "id": { "type": "string", "example": "1" },
                    "result": { "type": "object" }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — missing or invalid Personal Access Token."
          },
          "429": {
            "description": "Rate limit exceeded (max 2,000 calls per token per day)."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "PAT",
        "description": "Personal Access Token generated in OwlCAD Account → Access tokens. Pro-only, and re-checked on every request."
      }
    }
  }
}
