---
title: "Add a remote MCP server for the signed-in user and connect to it."
method: POST
path: "/v1/mcp-servers"
tags: ["mcp-servers"]
---

# Add a remote MCP server for the signed-in user and connect to it.

`POST /v1/mcp-servers`

## Request

- Base URL: `https://api.kody.codes`
- URL: `https://api.kody.codes/v1/mcp-servers`
- Auth: HTTP bearer

Add a remote MCP server for the signed-in user and connect to it. Servers that require OAuth return an authUrl: a signed-in Kody consent page the user opens and confirms before Kody sends them to the provider; other servers connect immediately. Pass bearerToken for servers that authenticate with a static Authorization header instead of (or in addition to) OAuth. Connected server tools become kody.mcp["server-name"].tool_name(...) capabilities. When OAuth fails with origin or redirect URI errors, the remote authorization server must allow Kody's oauthClientOrigin, oauthCallbackUrl, and oauthClientMetadataUrl (CIMD client_id) when present.

Org permission: `integration:create`.

## Request body

- object
  - `name` string, required: Short kebab-case name for the server (lowercase letters, numbers, dashes). Used as kody.mcp["name"] in execute code.
  - `url` string, required: The remote MCP server endpoint URL. Must be https (http is only allowed for localhost during development).
  - `bearerToken` string: Optional static credential for Authorization. Bare tokens are sent as Bearer <token>; values that already include an auth scheme (Bearer, token, etc.) are sent as-is. Stored only in the per-user MCP client hub, never returned later.

## Response `200`

Success.

- object
  - `id` string, required
  - `name` string, required
  - `url` string, required
  - `state` string, required
  - `toolCount` integer, required
  - `authUrl` string, nullable, required
  - `error` string, nullable, required
  - `oauthClientOrigin` string, required
  - `oauthCallbackUrl` string, required
  - `oauthClientMetadataUrl` string, nullable, required
  - `nextStep` string, required

## Other responses

- `400`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `401`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `403`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `404`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `409`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `413`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `429`: Too many requests (edge IP/token limit) or an entitlement / plan-cap limit. Wait at least `Retry-After` seconds before retrying.
- `500`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `503`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `default`: Error envelope `{ "error": { "code", "message", "details"? } }`.

---

[API](https://skmtc.dev/kody/apis/kody-api.md) · [All operations](https://skmtc.dev/kody/apis/kody-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kody/apis/kody-api/revisions/a020ecedb82b?raw)
