---
title: "Create a client (from a template or a full config)"
method: POST
path: "/projects/{projectId}/clients"
tags: ["Clients"]
---

# Create a client (from a template or a full config)

`POST /projects/{projectId}/clients`

Creates a client in the project and responds `201` with the new client's detail. Seed the config one of two ways: pass `template` (a built-in template id, optional `theme`) to seed server-side from the live backend client-template catalog, falling back to the bundled SDK catalog snapshot if the live catalog is unavailable, OR pass `config` (a full client config v2). Exactly one of `template` or `config` is required.

Guest callers are denied (client creation is a write).

## Path parameters

- `projectId` string, required

## Request body

- union — Create a client from a built-in template OR a full config. Exactly one of `template` or `config` is required.
  - object
    - `name` string, required — Display name for the new client.
    - `template` 'mcpjam' | 'claude' | 'claude-code' | 'chatgpt' | 'mistral' | 'cursor' | 'codex' | 'copilot' | 'vscode' | 'agentcore' | 'n8n' | 'perplexity', required — Built-in template id to seed the host config from.
    - `theme` 'light' | 'dark' — Theme stamped into the seeded config (template only).
    - `config` object — Full client config v2, used verbatim (alternative to `template`). Must pin `modelId`.
      - `modelId` string, required — Model id the client pins. Required and non-empty: an environment inherits its client's model when it sets no override, so a client created without one cannot back a headless environment and its launches are refused with `ENV_MODEL_REQUIRED`. A `PATCH` may not clear it either, though clients created before this rule stay editable.
  - object
    - `name` string, required — Display name for the new client.
    - `template` 'mcpjam' | 'claude' | 'claude-code' | 'chatgpt' | 'mistral' | 'cursor' | 'codex' | 'copilot' | 'vscode' | 'agentcore' | 'n8n' | 'perplexity' — Built-in template id to seed the host config from.
    - `theme` 'light' | 'dark' — Theme stamped into the seeded config (template only).
    - `config` object, required — Full client config v2, used verbatim (alternative to `template`). Must pin `modelId`.
      - `modelId` string, required — Model id the client pins. Required and non-empty: an environment inherits its client's model when it sets no override, so a client created without one cannot back a headless environment and its launches are refused with `ENV_MODEL_REQUIRED`. A `PATCH` may not clear it either, though clients created before this rule stay editable.

## Response `201`

The client was created.

- ClientDetail — A client plus its resolved config (model, capabilities, host context, MCP profile) and the read-backs an editor needs.
  - `id` string, required
  - `name` string, required
  - `configId` string — The concurrency token — see `Client.configId`.
  - `config` object, required — Client config v2 DTO. Opaque object; shape mirrors the inspector's client editor.
  - `ownerScope` object, nullable, required
  - `hasComputer` boolean
  - `createdAt` number — Unix epoch milliseconds.
  - `updatedAt` number — Unix epoch milliseconds.
  - `impact` ClientImpact — What a config edit to this client would follow. These are the DURABLE consumers that re-resolve the client's current config; past runs, per-turn traces and pinned eval-suite snapshots hold a config id and are unaffected. Direct playground and client-chat use follows the edit too and has no row to count.
    - `liveEnvironmentCount` integer, required — Non-archived project environments selecting this client.
    - `scenarioAttachmentCount` integer, required — Scenario attachments re-materialized inside the edit transaction.
    - `activeLegacyJourneyCount` integer, required — Active journeys with no environments that pin this client.

## Other responses

- `400` — Malformed body or parameters.
- `401` — Missing, invalid, revoked, or orphaned key (`UNAUTHORIZED`) — or the **target MCP server** needs an OAuth grant (`OAUTH_REQUIRED`), which is a property of the server, not your key.
- `403` — Key is valid but not allowed to do this.
- `404` — Unknown project, server, or resource.
- `409` — The resource is not in a state that accepts this write — a stale `expectedRevision`, a duplicate name, or an environment that cannot currently be launched. The request was well-formed; re-read the resource and retry.
- `429` — Per-key rate limit exceeded (60 requests/minute sustained, bursts up to 10). Honor `Retry-After` and back off with jitter.
- `500` — Something failed on MCPJam's side.
- `502` — Could not connect to the target MCP server.

---

[API](https://skmtc.dev/mcpjam/apis/mcpjam-api.md) · [All operations](https://skmtc.dev/mcpjam/apis/mcpjam-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mcpjam/mcpjam-api/revisions/c628a0e95b06/schema)
