{
  "openapi": "3.1.0",
  "info": {
    "title": "Stratify Agent API",
    "version": "1.0.0",
    "description": "Stratify gives first-time US entrepreneurs a personalized, step-by-step business setup roadmap. Agents connect through the Stratify MCP server at /mcp using OAuth 2.0 with least-privilege scopes.",
    "contact": {
      "name": "Stratify Support",
      "email": "support@stratifyserv.com",
      "url": "https://stratifyserv.com/contact"
    }
  },
  "servers": [
    {
      "url": "https://stratifyserv.com"
    }
  ],
  "security": [
    {
      "stratifyOAuth": [
        "roadmap:read"
      ]
    }
  ],
  "paths": {
    "/mcp": {
      "post": {
        "operationId": "callMcp",
        "summary": "Stratify MCP endpoint (Streamable HTTP, JSON-RPC 2.0)",
        "description": "Model Context Protocol endpoint. Tools: get_business_profile, get_roadmap, get_next_task (scope roadmap:read) and set_step_completion (scope roadmap:write).",
        "security": [
          {
            "stratifyOAuth": [
              "roadmap:read",
              "roadmap:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC result"
          },
          "401": {
            "description": "Missing or invalid OAuth access token"
          },
          "403": {
            "description": "Access token lacks the required scope"
          }
        }
      }
    },
    "/.well-known/oauth-authorization-server": {
      "get": {
        "operationId": "getAuthorizationServerMetadata",
        "summary": "OAuth 2.0 authorization server metadata (RFC 8414)",
        "security": [],
        "responses": {
          "200": {
            "description": "Authorization server metadata"
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource": {
      "get": {
        "operationId": "getProtectedResourceMetadata",
        "summary": "OAuth 2.0 protected resource metadata (RFC 9728), including scopes_supported",
        "security": [],
        "responses": {
          "200": {
            "description": "Protected resource metadata"
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getAgentInstructions",
        "summary": "Agent instructions, when-to-use guidance and site index",
        "security": [],
        "responses": {
          "200": {
            "description": "Markdown instructions"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "stratifyOAuth": {
        "type": "oauth2",
        "description": "OAuth 2.0 authorization code flow with PKCE. Dynamic client registration is supported; request only the scopes the task needs.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://ogugkvzsxtqqdbbulevl.supabase.co/auth/v1/oauth/authorize",
            "tokenUrl": "https://ogugkvzsxtqqdbbulevl.supabase.co/auth/v1/oauth/token",
            "refreshUrl": "https://ogugkvzsxtqqdbbulevl.supabase.co/auth/v1/oauth/token",
            "scopes": {
              "roadmap:read": "Read the signed-in founder's business profile, personalized roadmap and next task.",
              "roadmap:write": "Mark a roadmap step complete or reopen it for the signed-in founder."
            }
          }
        }
      }
    }
  }
}