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

# Install an MCP CLI

> Install an MCP server as a CLI on the live workspace.

The body is one `clis:` entry, `cli: mcp` with its config, as a
config file states it. Its pointers resolve and its tools are listed
under the workspace's network. A name already installed answers 409.



## OpenAPI

````yaml /openapi.yaml put /v1/workspaces/{workspace_id}/clis/{name}
openapi: 3.1.0
info:
  title: Mirage API
  version: '0.1'
servers:
  - url: http://127.0.0.1:8765
    description: A local daemon on its default port
security:
  - bearerAuth: []
paths:
  /v1/workspaces/{workspace_id}/clis/{name}:
    put:
      tags:
        - Workspaces
      summary: Install an MCP CLI
      description: |-
        Install an MCP server as a CLI on the live workspace.

        The body is one `clis:` entry, `cli: mcp` with its config, as a
        config file states it. Its pointers resolve and its tools are listed
        under the workspace's network. A name already installed answers 409.
      operationId: set_cli_v1_workspaces__workspace_id__clis__name__put
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - name: name
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CLIBlock'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
                title: Response Set Cli V1 Workspaces  Workspace Id  Clis  Name  Put
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '429':
          $ref: '#/components/responses/429'
components:
  parameters:
    workspaceId:
      name: workspace_id
      in: path
      required: true
      description: The workspace's id.
      schema:
        type: string
  schemas:
    CLIBlock:
      properties:
        cli:
          anyOf:
            - type: string
            - type: 'null'
          title: Cli
        script:
          anyOf:
            - type: string
            - type: 'null'
          title: Script
        runtime:
          anyOf:
            - type: string
            - type: 'null'
          title: Runtime
        config:
          additionalProperties: true
          type: object
          title: Config
      additionalProperties: false
      type: object
      title: CLIBlock
      description: |-
        One ``clis:`` entry: install a named CLI with its own config.

        The section key is the installed head word. Exactly one handler
        source: ``cli`` names a registered spec tree; ``script`` references
        a program file whose content is embedded at load (the docker
        build-context model). ``runtime`` optionally pins the world runtime
        entry that runs the script; unset picks the first entry speaking
        the script's language. ``config`` validates through the spec's
        ``config_model`` at install time (fail loud). A CLI never takes a
        mode and never shares a mount's credentials: a binary has no mode,
        the credential does.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Error:
      type: object
      properties:
        detail:
          description: What went wrong, as text or a structured record.
        errno:
          type: string
          description: The errno of a failed file call, such as ENOENT.
        refusal:
          type: object
          description: The policy refusal, when a policy refused the call.
      required:
        - detail
    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
  responses:
    '401':
      description: The token is missing or wrong
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
        text/plain:
          schema:
            type: string
            description: The Python daemon answers Unauthorized as plain text.
    '404':
      description: The workspace, session, job or file does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '429':
      description: Past a rate limit, or a new session past max_sessions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
            minimum: 0
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        The server's token (MIRAGE_AUTH_TOKEN) or a JWT. A daemon in the default
        local mode with no token accepts requests without one.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.