---
title: "Create connection"
method: POST
path: "/{namespace}"
tags: ["connect"]
---

# Create connection

`POST /{namespace}`

Create a new MCP connection with an auto-generated ID. Requires API key and namespace ownership.

## Path parameters

- `namespace` string, required

## Request body

- CreateConnectionRequest
  - `transport` 'http' | 'uplink' — Connection transport. Use `uplink` for a local server paired over Smithery CLI.
  - `mcpUrl` string, uri — URL of a custom MCP server. For Smithery registry servers, prefer `server`.
  - `server` string — Smithery registry server qualified name. Use this instead of mcpUrl for registry servers.
  - `source` object
    - `kind` 'module', required
    - `entrypoint` string, required
    - `sourceFiles` object[], required
      - `path` string, required
      - `contents` string, required
  - `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 `201`

Connection created

- 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

- `400` — Validation error
- `404` — Namespace not found or access denied

---

[API](https://skmtc.net/smithery-ai/apis/smithery-platform-api.md) · [All operations](https://skmtc.net/smithery-ai/apis/smithery-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smithery-ai/smithery-platform-api/versions/60b8c3d2fecf/schema)
