---
title: "Create a new MCP server"
method: POST
path: "/api/mcp-servers"
tags: ["MCP Servers"]
---

# Create a new MCP server

`POST /api/mcp-servers`

## Request body

- object
  - `name` string, required
  - `transport` 'stdio' | 'http' | 'sse', required
  - `description` string
  - `scope` string
  - `ownerAgentId` string
  - `command` string
  - `args` string
  - `url` string
  - `headers` string
  - `envConfigKeys` string
  - `headerConfigKeys` string

## Response `201`

MCP server created

- object
  - `server` McpServer, required
    - `id` string, required
    - `name` string, required
    - `description` string, nullable, required
    - `scope` 'global' | 'swarm' | 'agent', required
    - `ownerAgentId` string, nullable, required
    - `transport` 'stdio' | 'http' | 'sse', required
    - `command` string, nullable, required
    - `args` string, nullable, required
    - `url` string, nullable, required
    - `headers` string, nullable, required
    - `envConfigKeys` string, nullable, required
    - `headerConfigKeys` string, nullable, required
    - `extraAuthorizeParams` string, nullable, required
    - `authMethod` 'static' | 'oauth' | 'auto'
    - `isEnabled` boolean, required
    - `version` number, required
    - `createdAt` string, required
    - `lastUpdatedAt` string, required

## Other responses

- `400` — Validation error

---

[API](https://skmtc.net/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.net/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/versions/ef761849166b/schema)
