---
title: "Set MCP configuration"
method: POST
path: "/workspaces/{workspace_id}/mcp-config"
tags: ["mcp"]
---

# Set MCP configuration

`POST /workspaces/{workspace_id}/mcp-config`

Adds or updates MCP server entries for the workspace. Existing servers not included in the payload are preserved unchanged.

For each server entry in the payload, if `headers` is omitted or `null` and a server with the same `id` (or `mcp_url`) already exists, the stored header values are preserved. To explicitly clear all headers for a server, pass `headers: {}`. Returns the first saved server entry with its stable ID.

## Path parameters

- `workspace_id` string, required

## Headers

- `Authorization` string, required

## Request body

- AgentMCPConfigIn
  - `servers` MCPServerIn[], required — List of MCP server configurations
    - `id` string — Stable config ID. Omit for new entries (auto-generated).
    - `mcp_url` string, uri, required — The HTTPS URL of the MCP server (SSE endpoint)
    - `headers` object, nullable — Custom headers to send with MCP requests (e.g. Authorization, API keys)

## Response `200`

MCP configuration set successfully

- MCPServerOut
  - `id` string, required — Stable config ID for linking actions to this server entry
  - `mcp_url` string, uri, required — The HTTPS URL of the MCP server (SSE endpoint)
  - `has_headers` boolean, required — Whether custom headers are stored in Vault
  - `headers_keys` string[] — Names of stored header keys (values redacted)

## Other responses

- `400` — Invalid request

---

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