---
title: "Replace a host's server attachments"
method: POST
path: "/projects/{projectId}/hosts/{hostId}/servers"
tags: ["Hosts"]
---

# Replace a host's server attachments

`POST /projects/{projectId}/hosts/{hostId}/servers`

Sets the host's required and optional server ids without round-tripping its whole config, and responds with the updated host detail. Preserves every other identity field (computer, harness, built-in tools) and trims per-server connection overrides to the kept set. Requires project admin.

## Path parameters

- `projectId` string, required
- `hostId` string, required

## Request body

- HostServersRequest — Replaces the host's server attachments wholesale. Every id must name a live server in the same project.
  - `serverIds` string[], required
  - `optionalServerIds` string[] — Attached but not required to connect.

## Response `200`

The updated host.

- HostDetail — A host plus its resolved host config (model, capabilities, host context, MCP profile).
  - `id` string, required
  - `name` string, required
  - `config` object, required — Host config v2 DTO. Opaque object; shape mirrors the inspector's host editor.

## 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.
- `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.net/mcpjam/apis/mcpjam-api.md) · [All operations](https://skmtc.net/mcpjam/apis/mcpjam-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mcpjam/mcpjam-api/versions/b767df188d0c/schema)
