---
openapi: 3.1.1
info:
  title: MCP Tools Server 1.0
  description: Provides tools for managing and interacting with BookWorm catalog
    data, including book search and catalog operations
  contact:
    name: Nhan Nguyen
    url: https://github.com/foxminchan
    email: nguyenxuannhan407@gmail.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: "1.0"
externalDocs:
  description: Documentation
  url: https://github.com/foxminchan/BookWorm
servers:
  - url: "{protocol}://{environment}.mcp.bookworm.com"
    description: Non-production environment
    variables:
      protocol:
        enum:
          - https
          - http
        default: https
      environment:
        enum:
          - dev
          - stg
          - qa
        default: dev
  - url: "{protocol}://mcp.bookworm.com"
    description: Production environment
    variables:
      protocol:
        enum:
          - https
        default: https
paths:
  /mcp:
    post:
      tags:
        - MCP
      summary: Get MCP Components
      description: |
        Invoke MCP methods via JSON-RPC over HTTP.
        Responses are streamed using **Server-Sent Events** (`text/event-stream`)
        following the MCP streamable protocol (`mcp-streamable-1.0`).
      operationId: InvokeMCP
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - method
                - params
                - jsonrpc
                - id
              type: object
              properties:
                method:
                  type: string
                  description: Name of the MCP method to invoke
                params:
                  type: object
                  description: Method parameters
                  properties:
                    name:
                      type: string
                      description: Target component or tool name
                    arguments:
                      type: object
                      description: Key-value arguments for the tool
                jsonrpc:
                  enum: ["1.0", "2.0"]
                  type: string
                  default: "2.0"
                id:
                  type: integer
                  description: Unique request identifier
      responses:
        "200":
          description: Successful stream response
          content:
            text/event-stream:
              schema:
                type: object
                properties:
                  event:
                    type: string
                    description: Event type (e.g. "message", "error", "complete")
                  data:
                    type: string
                    description: Event payload (JSON-encoded MCP message)
              examples:
                success:
                  summary: Example MCP stream
                  value: |
                    event: message
                    data: {"jsonrpc":"2.0","id":1,"result":{"status":"ok"}}

                    event: complete
                    data: {}
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        "406":
          description: Not Acceptable
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
      x-ms-agentic-protocol: mcp-streamable-1.0
components: {}
tags:
  - name: MCP
    description: MCP Tools Server API
