{
  "openapi": "3.1.0",
  "info": {
    "title": "Halyard MCP Server",
    "version": "1.0.0",
    "description": "HTTP surface of the Halyard MCP server. The primary surface is the MCP Streamable HTTP endpoint at `/`; the remaining routes are health and discovery. Tool-level schemas are negotiated over MCP (`tools/list`), not described here."
  },
  "servers": [
    {
      "url": "https://mcp.usehalyard.ai"
    }
  ],
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "description": "OAuth 2.1 bearer token. Authorization server is advertised at /.well-known/oauth-protected-resource.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://api.usehalyard.ai/oauth/authorize",
            "tokenUrl": "https://api.usehalyard.ai/oauth/token",
            "scopes": {
              "read": "Read knowledge, team, and delivery data",
              "write": "Create and update knowledge, contacts, and conversations"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/": {
      "post": {
        "summary": "MCP Streamable HTTP endpoint",
        "description": "JSON-RPC 2.0 messages for the Model Context Protocol (initialize, tools/list, tools/call, …).",
        "security": [
          {
            "oauth2": [
              "read",
              "write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response (JSON or SSE stream)"
          },
          "401": {
            "description": "Missing or invalid bearer token"
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "Service is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/install": {
      "get": {
        "summary": "Human-facing install / getting-started page",
        "responses": {
          "200": {
            "description": "HTML install guide"
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource": {
      "get": {
        "summary": "OAuth 2.0 Protected Resource Metadata (RFC 9728)",
        "responses": {
          "200": {
            "description": "Protected-resource metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}