---
title: "Create or update connection"
method: PUT
path: "/connect/{namespace}/{connectionId}"
tags: ["connect"]
---

# Create or update connection

`PUT /connect/{namespace}/{connectionId}`

Create or update an MCP connection with the given ID. mcpUrl is required when creating a new connection, but optional when updating. Returns 409 if a different mcpUrl is provided, except while the connection is input_required and the new URL keeps the same host and path.

## Path parameters

- `namespace` string, required
- `connectionId` string, required

## Request body

- UpsertConnectionRequest
  - `transport` 'http' | 'uplink' — Connection transport. Defaults to the existing connection transport when updating.
  - `mcpUrl` string, uri — URL of the MCP server. Required when creating a new connection. Optional when updating — omit to keep the existing URL.
  - `name` string — Human-readable name (optional, defaults to connection ID)
  - `metadata` object — Custom metadata for filtering connections
  - `headers` object — Custom headers to send with MCP requests (stored securely, not returned in responses)
  - `mock` MockConfig
    - `enabled` boolean, required — Turn mock mode on for this connection.
    - `scenario` string — Natural-language starting-state for the simulator (threaded into the LLM system prompt so generated data is consistent with the scenario across calls).

## Response `200`

Connection updated

- Connection
  - `connectionId` string, required — Connection ID (auto-generated or developer-defined)
  - `name` string, required — Human-readable name
  - `transport` 'http' | 'uplink' — Connection transport
  - `mcpUrl` string, nullable, required — MCP server URL. Null for uplink connections.
  - `metadata` object, nullable, required
  - `mock` MockConfig
    - `enabled` boolean, required — Turn mock mode on for this connection.
    - `scenario` string — Natural-language starting-state for the simulator (threaded into the LLM system prompt so generated data is consistent with the scenario across calls).
  - `iconUrl` string, nullable
  - `createdAt` string — ISO 8601 timestamp
  - `status` union
    - object
      - `state` 'connected', required
    - object
      - `state` 'disconnected', required
    - object
      - `state` 'auth_required', required
      - `setupUrl` string, uri — Hosted Smithery URL for completing setup and OAuth
      - `authorizationUrl` string, uri — Deprecated compatibility alias for setupUrl
    - object
      - `state` 'input_required', required
      - `setupUrl` string, uri — Hosted Smithery URL for completing setup in the browser
      - `http` CredentialProfileHttp, required
        - `headers` object
        - `query` object
      - `missing` object, required
        - `headers` string[], required
        - `query` string[], required
    - object
      - `state` 'error', required
      - `message` string, required — Error message
  - `serverInfo` ServerInfo
    - `name` string, required
    - `title` string
    - `icons` object[]
      - `src` string, required
      - `mimeType` string
      - `sizes` string[]
      - `theme` 'light' | 'dark'
    - `version` string, required
    - `websiteUrl` string
    - `description` string

## Other responses

- `201` — Connection created
- `400` — Validation error
- `404` — Namespace not found or access denied
- `409` — URL mismatch

## Changes

- **2026-04-23** `10f65f70e8c0` — 4 breaking, 3 info
  - response property `mcpUrl` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - response property `mcpUrl` list-of-types was widened by adding types `null` to media type `application/json` of response `201`
  - added `subschema #2: ConnectionStatusDisconnected` to the `status` response property `oneOf` list for the response status `200`
  - added `subschema #2: ConnectionStatusDisconnected` to the `status` response property `oneOf` list for the response status `201`
  - …3 more
- **2026-04-21** `e0848f588e5f` — 4 breaking, 5 info
  - added the new required request property `mock/enabled`
  - the `mock` request property type changed from `boolean` to `object`
  - the `mock` response's property type changed from `boolean` to `object` for status `200`
  - the `mock` response's property type changed from `boolean` to `object` for status `201`
  - …5 more
- **2026-04-20** `0ac2ebb989ed` — 3 info
  - added the new optional request property `mock`
  - added the optional property `mock` to the response with the `200` status
  - added the optional property `mock` to the response with the `201` status
- …earlier changes not shown

[Full history](https://skmtc.dev/smithery-ai/apis/smithery-platform-api/changes/connect/:namespace/:connectionId/put.md)

---

[API](https://skmtc.dev/smithery-ai/apis/smithery-platform-api.md) · [All operations](https://skmtc.dev/smithery-ai/apis/smithery-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/smithery-ai/apis/smithery-platform-api/revisions/10f65f70e8c0?raw)
