{
  "openapi": "3.1.0",
  "info": {
    "title": "AgentCloud MCP API",
    "version": "0.1.0",
    "description": "Stateless Streamable HTTP MCP access to AgentCloud managed iOS builds and hosted Simulator tools."
  },
  "externalDocs": {
    "description": "AgentCloud developer resources",
    "url": "https://agentcloud.so/developers"
  },
  "servers": [
    {
      "url": "https://api.agentcloud.so"
    }
  ],
  "paths": {
    "/mcp": {
      "post": {
        "operationId": "callAgentCloudMcp",
        "summary": "Send a stateless MCP JSON-RPC request",
        "security": [
          {
            "AgentCloudOAuth": [
              "mcp:connect"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "OAuth access token required or invalid"
          },
          "405": {
            "description": "Use POST for stateless Streamable HTTP"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AgentCloudOAuth": {
        "type": "oauth2",
        "description": "OAuth 2.1 authorization code with PKCE for workspace-scoped MCP access.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://api.agentcloud.so/api/auth/oauth2/authorize",
            "tokenUrl": "https://api.agentcloud.so/api/auth/oauth2/token",
            "refreshUrl": "https://api.agentcloud.so/api/auth/oauth2/token",
            "scopes": {
              "mcp:connect": "Connect an MCP client to the authorized AgentCloud workspace.",
              "offline_access": "Issue a refresh token for a previously authorized MCP client."
            }
          }
        }
      }
    }
  }
}