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

# Create MCP API Key Connection

> Create a named API-key connection on an existing server. Repeat with the same server ID and a different key to add another account.

### Endpoint

**POST** `/v3/tools/credentials/static`

### Description

Create a named API-key connection on an existing server. Repeat with the same server ID and a different key to add another account.

### Authentication

API key (`x-api-key`) in the header.

### Request

```bash theme={null}
curl -X POST 'https://agent-prod.studio.lyzr.ai/v3/tools/credentials/static' \
  -H "x-api-key: $LYZR_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"provider_uuid":"<MCP_SERVER_ID>","credential_name":"Support","user_id":"you@example.com","credentials":{"api_key":"<MCP_API_KEY>"}}'
```

### Response

Returns `credential_id` and `status: "success"`.


## OpenAPI

````yaml post /tools/credentials/static
openapi: 3.0.3
info:
  title: Lyzr MCP Connections API
  version: 1.0.0
servers:
  - url: https://agent-prod.studio.lyzr.ai/v3
security:
  - ApiKeyAuth: []
paths:
  /tools/credentials/static:
    post:
      summary: Create MCP API Key Connection
      description: >-
        Create a named API-key connection on an existing server. Repeat with the
        same server ID and a different key to add another account.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                provider_uuid:
                  type: string
                  description: MCP server ID returned by List MCP Servers.
                credential_name:
                  type: string
                  description: Display name for this connection.
                user_id:
                  type: string
                  description: Your user ID, such as your account email.
                credentials:
                  type: object
                  properties:
                    api_key:
                      type: string
                      description: API key for the MCP server, not your Lyzr API key.
                  required:
                    - api_key
              required:
                - provider_uuid
                - credential_name
                - user_id
                - credentials
            example:
              provider_uuid: <MCP_SERVER_ID>
              credential_name: Support
              user_id: you@example.com
              credentials:
                api_key: <MCP_API_KEY>
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  credential_id:
                    type: string
                    description: ID of the named connection.
                  status:
                    type: string
                    enum:
                      - success
                      - pending
                      - failed
                  external_ref:
                    type: object
                    properties:
                      mcp_server_id:
                        type: string
                        description: MCP server ID.
                      connection_id:
                        type: string
                        description: ID of the named connection.
        '400':
          description: Invalid request
        '401':
          description: Authentication required
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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