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

# Create connection

`POST /connect/{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
  - `mcpUrl` string, uri, required — URL of the MCP server
  - `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)

## Response `201`

Connection created

- Connection
  - `connectionId` string, required — Connection ID (auto-generated or developer-defined)
  - `name` string, required — Human-readable name
  - `mcpUrl` string, required — MCP server URL
  - `metadata` object, nullable, required
  - `iconUrl` string, nullable
  - `createdAt` string — ISO 8601 timestamp
  - `status` union
    - object
      - `state` 'connected', required
    - object
      - `state` 'auth_required', required
      - `authorizationUrl` string, uri — URL to redirect user for OAuth authorization
    - 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.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/9d53933ba12e?raw)
