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

# Add Mcps From Library

> Put MCPs the user has already installed into this workspace.

The rendered config never leaves the server, so the client sends ids
rather than configs — it has no way to reconstruct one.

Adding is per-MCP: one that fails to connect does not cancel the
rest, and the response says which ones landed.



## OpenAPI

````yaml /versions/2.0.6dev/en/deploy/openapi.json post /workspace/mcp/from-library
openapi: 3.1.0
info:
  title: AgentScope
  version: 2.0.5
servers: []
security: []
paths:
  /workspace/mcp/from-library:
    post:
      tags:
        - workspace
      summary: Add Mcps From Library
      description: |-
        Put MCPs the user has already installed into this workspace.

        The rendered config never leaves the server, so the client sends ids
        rather than configs — it has no way to reconstruct one.

        Adding is per-MCP: one that fails to connect does not cancel the
        rest, and the response says which ones landed.
      operationId: add_mcps_from_library_workspace_mcp_from_library_post
      parameters:
        - name: agent_id
          in: query
          required: true
          schema:
            type: string
            title: Agent Id
        - name: session_id
          in: query
          required: true
          schema:
            type: string
            title: Session Id
        - name: x-user-id
          in: header
          required: true
          schema:
            type: string
            description: >-
              Caller's user ID. Temporary header-based identity; will be
              replaced by JWT auth.
            title: X-User-Id
          description: >-
            Caller's user ID. Temporary header-based identity; will be replaced
            by JWT auth.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddFromLibraryRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddFromLibraryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AddFromLibraryRequest:
      properties:
        mcp_ids:
          items:
            type: string
          type: array
          title: Mcp Ids
          description: The installed-MCP record ids to add.
      type: object
      required:
        - mcp_ids
      title: AddFromLibraryRequest
      description: The request to put library MCPs into a workspace.
    AddFromLibraryResponse:
      properties:
        added:
          items:
            type: string
          type: array
          title: Added
          description: >-
            The names now in the workspace. Excludes ones already present, which
            are skipped rather than re-added.
        failed:
          additionalProperties:
            type: string
          type: object
          title: Failed
          description: Whatever could not be added, mapped to why.
      type: object
      title: AddFromLibraryResponse
      description: |-
        What landed, and what did not.

        Reported per item rather than as one status: installing is done one
        at a time, so a bad API key on the third pick must not throw away
        the two that worked.
    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

````