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

# Discover Mcp Tools

> Discover available tools from an MCP server.

Three callable shapes - see ``DiscoverMcpToolsRequest`` docs for full details:

- **Saved-id:** ``{savedConnectionId}`` -> BE reads the stored row and
  composes headers server-side; the browser never sees the token.
  ``savedConnectionName`` is accepted as a deprecated alias for one
  release cycle.
- **Inline with masked secret:** ``{serverUrl, headers: {...: "********"}}`` ->
  BE matches the serverUrl against saved settings and substitutes the
  stored secret for every masked header value.
- **Inline plaintext:** ``{serverUrl, headers}`` - used on first-save
  "Test" click before the row exists.

URL is validated (SSRF guard) on every path. Per-tenant rate limit:
30 req/min -> 429 with ``Retry-After``. A 300s in-process cache (M10)
keyed by ``(serverUrl, headers-hash)`` short-circuits repeat calls;
``X-MCP-Cache: hit|miss`` is emitted on every response. Cache hits
still consume rate-limit budget - the cache is not a bypass.



## OpenAPI

````yaml /openapi/openapi.json post /agents/mcp/tools
openapi: 3.1.0
info:
  title: Streamkap REST API
  description: >-
    The Streamkap REST API allows you to programmatically manage your CDC
    pipelines, sources, destinations, transforms, and more.


    Authenticate using a bearer token obtained from the [Access
    Token](/api-reference/auth/access-token) endpoint with your API client
    credentials.
  contact:
    name: Streamkap Support
    url: https://streamkap.com/
    email: support@streamkap.com
  license:
    name: Proprietary
  version: 2.0.0
servers:
  - url: https://api.streamkap.com
    description: Production
security: []
tags:
  - name: Agents
    description: Create, deploy, and manage Flink-based AI agents.
  - name: Agents Observability
    description: >-
      Read-only views over the MCP audit log: agent rollup, sessions, spans,
      histograms, external-agent verify.
  - name: Alerts
    description: Manage alert subscribers, preferences, and notification credentials.
  - name: Authentication
    description: Obtain and refresh access tokens, manage client credentials and roles.
  - name: Billing
    description: Retrieve usage metrics, summaries, and export billing data.
  - name: Consumer Groups
    description: List, inspect, and reset Kafka consumer group offsets.
  - name: Dashboard
    description: Retrieve organisation-level statistics and overview data.
  - name: Destinations
    description: Create, configure, and manage data destinations and their lifecycle.
  - name: Kafka Access
    description: Manage Kafka users and their access permissions.
  - name: Logs
    description: Query and summarise system logs.
  - name: Pipelines
    description: Create, configure, and manage CDC pipelines and their lifecycle.
  - name: Project Keys
    description: Manage project keys that bundle API credentials and optional Kafka access.
  - name: Schema Registry
    description: Browse schema subjects, versions, and retrieve schema definitions.
  - name: Services
    description: View and switch service metadata.
  - name: Sources
    description: >-
      Create, configure, and manage data sources, snapshots, and their
      lifecycle.
  - name: Tags
    description: Create, update, and manage resource tags for organisation.
  - name: Topics
    description: Browse topic details, statistics, configurations, metrics, and messages.
  - name: Transforms
    description: >-
      Create, deploy, and manage data transforms, unit tests, and implementation
      details.
paths:
  /agents/mcp/tools:
    post:
      tags:
        - Agents
      summary: Discover Mcp Tools
      description: >-
        Discover available tools from an MCP server.


        Three callable shapes - see ``DiscoverMcpToolsRequest`` docs for full
        details:


        - **Saved-id:** ``{savedConnectionId}`` -> BE reads the stored row and
          composes headers server-side; the browser never sees the token.
          ``savedConnectionName`` is accepted as a deprecated alias for one
          release cycle.
        - **Inline with masked secret:** ``{serverUrl, headers: {...:
        "********"}}`` ->
          BE matches the serverUrl against saved settings and substitutes the
          stored secret for every masked header value.
        - **Inline plaintext:** ``{serverUrl, headers}`` - used on first-save
          "Test" click before the row exists.

        URL is validated (SSRF guard) on every path. Per-tenant rate limit:

        30 req/min -> 429 with ``Retry-After``. A 300s in-process cache (M10)

        keyed by ``(serverUrl, headers-hash)`` short-circuits repeat calls;

        ``X-MCP-Cache: hit|miss`` is emitted on every response. Cache hits

        still consume rate-limit budget - the cache is not a bypass.
      operationId: discoverMcpTools
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscoverMcpToolsRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Discovermcptools
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - FronteggHTTPAuthentication: []
components:
  schemas:
    DiscoverMcpToolsRequest:
      properties:
        serverUrl:
          type: string
          maxLength: 2048
          title: Serverurl
          default: ''
        headers:
          additionalProperties:
            type: string
          type: object
          maxProperties: 32
          title: Headers
        savedConnectionId:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Savedconnectionid
          description: >-
            If set, BE resolves serverUrl + headers from the tenant's saved
            connection by id
        savedConnectionName:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Savedconnectionname
          description: >-
            Deprecated - prefer ``savedConnectionId``. Accepted for backward
            compatibility for one release cycle.
      additionalProperties: false
      type: object
      title: DiscoverMcpToolsRequest
      description: |-
        Request body for POST /agents/mcp/tools.

        Two callable shapes:

        1. **Inline** - the caller sends ``{serverUrl, headers}`` directly. Used
           for the "Test" button on a new connection form before the row has
           been saved. If any header value is ``MASK_SENTINEL``, the BE
           substitutes the stored secret for that row (matched by
           ``serverUrl``) server-side so the decrypted value never reaches
           the browser.
        2. **By saved-id** - the caller sends ``savedConnectionId`` and the BE
           reads the stored row from ``agent_connections`` and composes headers
           via ``mcp_header_resolver``. Used when the tenant triggers a
           re-discover against an existing saved connection - the browser
           doesn't need to hold the token at all. For MCP connections (which
           are keyed by ``name`` in storage), the value sent as
           ``savedConnectionId`` is the connection's stable ``name``.

        ``savedConnectionName`` is accepted as a deprecated alias for one
        release cycle so an in-flight FE that hasn't shipped the rename yet
        keeps working. New callers should send ``savedConnectionId``.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    FronteggHTTPAuthentication:
      type: http
      scheme: bearer

````