> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connection Scoped MCP Access

> Scopes MCP traffic to a specific data source. This endpoint implements the [MCP Streamable HTTP transport](https://modelcontextprotocol.io/docs/concepts/transports). Send any JSON-RPC 2.0 MCP request (such as `initialize`, `tools/list`, `tools/call`) in the request body. The server routes it within the context of the specified connection.

Omit `id` to send a notification. (No response expected. The server returns `202 No Content`).

Use the `?tools=` and `?ops=` query parameters to narrow the list of returned tools.

* **`?tools=`** — comma-separated list of tool types (`universal`, `sql`, `source`). Omit to return all types.
* **`?ops=`** — comma-separated list of operation names (for example, `execute_sql`, `get_tables`). Omit to return tools for all operations.

Both parameters are narrowing-only: they can remove tools from the response but cannot enable tools that the server has already disabled for the connection. If a parameter is repeated in the request, only the first value is used. An empty string or an unrecognized value returns HTTP 400 with JSON-RPC code `-32602` (`ToolFilterParseError`).


## OpenAPI

````yaml en/API/MCP-API-Embedded.yaml POST /mcp/connections/{connectionId}
openapi: 3.0.1
info:
  title: Example MCP Server API
  version: 1.0.0
  description: >
    This API provides a Model Context Protocol (MCP) server that exposes tools
    to connect your data with a model-aware client.
servers:
  - url: https://mcp.cloud.cdata.com
    description: Production MCP base URL
security:
  - BearerAuth: []
paths:
  /mcp/connections/{connectionId}:
    post:
      tags:
        - MCP
      summary: Connection Scoped MCP Access
      parameters:
        - name: connectionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The unique identifier of the connection to scope this request to.
        - name: tools
          in: query
          required: false
          style: form
          explode: false
          description: >
            Comma-separated list of tool types to include in `tools/list`
            responses. Omitting returns all types. If repeated, only the first
            occurrence is used. An empty string or unrecognized value returns
            `HTTP 400`. Narrowing-only: cannot enable tools the server has
            already disabled.
          schema:
            type: array
            items:
              type: string
              enum:
                - universal
                - sql
                - source
        - name: ops
          in: query
          required: false
          style: form
          explode: false
          description: >
            Comma-separated list of operation base names to include in
            `tools/list` responses. Omitting returns tools for all operations.
            If repeated, only the first occurrence is used. An empty string or
            unrecognized value returns `HTTP 400`. Narrowing-only: cannot enable
            tools the server has already disabled.
          schema:
            type: array
            items:
              type: string
              enum:
                - get_catalogs
                - get_schemas
                - get_tables
                - get_columns
                - get_procedures
                - get_procedure_parameters
                - get_instructions
                - execute_sql
                - execute_select
                - execute_insert
                - execute_update
                - execute_procedure
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              initialize:
                summary: Initialize the MCP session
                value:
                  jsonrpc: '2.0'
                  method: initialize
                  params:
                    protocolVersion: '2024-11-05'
                    capabilities: {}
                    clientInfo:
                      name: my-client
                      version: 1.0.0
                  id: 1
              tools_list:
                summary: List available tools
                value:
                  jsonrpc: '2.0'
                  method: tools/list
                  params: {}
                  id: 2
              tools_call:
                summary: Invoke a tool
                value:
                  jsonrpc: '2.0'
                  method: tools/call
                  params:
                    name: GetTables
                    arguments: {}
                  id: 3
      responses:
        '200':
          description: >
            JSON-RPC response or SSE stream, depending on the request.


            - **`application/json`** — returned for a single request that
            includes an `id`.
              The body is a `JsonRpcResponse` object.
            - **`text/event-stream`** — returned when the server needs to stream
            multiple
              messages back (for example, long-running tool calls, server-initiated notifications).
              Each SSE `data:` line is a JSON-encoded `JsonRpcResponse` object. The stream
              closes when the server has sent all messages for the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponse'
              example:
                jsonrpc: '2.0'
                result:
                  tools:
                    - name: GetTables
                      description: Returns a list of available tables.
                      inputSchema:
                        type: object
                        properties: {}
                id: 2
            text/event-stream:
              schema:
                type: string
                description: >
                  Newline-delimited SSE events. Each `data:` field contains a

                  JSON-encoded `JsonRpcResponse`. Example:


                  ```

                  data: {"jsonrpc":"2.0","result":{...},"id":3}


                  data:
                  {"jsonrpc":"2.0","method":"notifications/message","params":{...}}


                  ```
        '202':
          description: Notification accepted (request had no `id`); no response body.
        '400':
          description: >
            Bad request. Returned for any of:

            - `connectionId` path parameter is not a valid UUID.

            - Request body is malformed JSON or is not a valid JSON-RPC 2.0
            envelope.

            - A `tools` or `ops` query parameter is empty or contains an
            unrecognized value (`ToolFilterParseError`, JSON-RPC code `-32602`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolFilterParseError'
        '401':
          description: Missing or invalid bearer token.
        '403':
          description: >
            Forbidden. The authenticated token's allowed `connection_ids` list
            does not

            include the requested `connectionId`.
        '404':
          description: Connection ID not found.
components:
  schemas:
    JsonRpcRequest:
      type: object
      required:
        - jsonrpc
        - method
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
          description: JSON-RPC protocol version. Must be `"2.0"`.
        method:
          type: string
          description: >-
            MCP method name (for example, `initialize`, `tools/list`,
            `tools/call`).
        params:
          type: object
          additionalProperties: true
          description: >-
            Method-specific parameters. May be omitted for parameterless
            methods.
        id:
          description: |
            Request identifier echoed in the response. Use a string or integer.
            Omit entirely to send a notification (no response will be returned).
          oneOf:
            - type: string
            - type: integer
    JsonRpcResponse:
      type: object
      required:
        - jsonrpc
        - id
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
          description: JSON-RPC protocol version.
        result:
          type: object
          additionalProperties: true
          description: Present on success; mutually exclusive with `error`.
        error:
          $ref: '#/components/schemas/JsonRpcError'
        id:
          description: >-
            Matches the `id` from the request. Null if the server could not
            determine the request id.
          nullable: true
          oneOf:
            - type: string
            - type: integer
    ToolFilterParseError:
      type: object
      description: >-
        Returned when a `tools` or `ops` query parameter is empty or contains an
        unrecognized value.
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: JSON-RPC error code indicating invalid parameters.
              example: -32602
            message:
              type: string
              description: Human-readable description of the parse failure.
              example: 'Invalid value for parameter ''tools'': ''unknown'''
        id:
          nullable: true
          oneOf:
            - type: string
            - type: integer
    JsonRpcError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          description: >-
            JSON-RPC error code (for example, `-32600` invalid request, `-32601`
            method not found, `32602` tool filter parse error).
        message:
          type: string
          description: Human-readable error description.
        data:
          description: Optional additional error context.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT token authentication. Include the token in the Authorization header
        as 'Bearer <token>'.

````