---
title: "Create Mcp Integration"
method: POST
path: "/workspaces/{workspace_id}/mcp-integrations"
tags: ["mcp-integrations"]
---

# Create Mcp Integration

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

## Request

- Base URL: `https://platform.tracecat.com/api`
- URL: `https://platform.tracecat.com/api/workspaces/{workspace_id}/mcp-integrations`
- Auth: one of:
  - API key in cookie `fastapiusersauth`
  - HTTP bearer

Create a new MCP integration.

## Path parameters

- `workspace_id` string, uuid, required

## Request body

- union
  - MCPHttpIntegrationCreate: Request model for creating an HTTP MCP integration.
    - `name` string, required: MCP integration name
    - `description` string, nullable: Optional description
    - `timeout` integer, nullable: Timeout in seconds
    - `catalog_slug` string, nullable: Platform MCP catalog slug this workspace config is created from
    - `server_type` 'http'
    - `server_uri` string, required: MCP server endpoint URL (required for http type)
    - `auth_type` 'OAUTH2' | 'CUSTOM' | 'NONE': Authentication type for MCP integrations.
    - `oauth_integration_id` string, uuid, nullable: OAuth integration ID (required for oauth2 auth_type)
    - `tunnel_id` string, uuid, nullable: Workspace tunnel that every request to this server goes through
    - `custom_credentials` string, password, nullable: HTTP headers as a JSON object. Required for custom auth type; optional additional headers for OAuth2 auth type.
    - `oauth_client_credentials` string, password, nullable: OAuth client credentials as a JSON object (client_id / client_secret) for catalog OAuth2 rows that declare an 'oauth_client' credential. Kept separate from custom_credentials so one connect can carry both a user-created OAuth client and extra HTTP headers.
  - MCPStdioIntegrationCreate: Request model for creating a stdio MCP integration.
    - `name` string, required: MCP integration name
    - `description` string, nullable: Optional description
    - `timeout` integer, nullable: Timeout in seconds
    - `catalog_slug` string, nullable: Platform MCP catalog slug this workspace config is created from
    - `server_type` 'stdio'
    - `stdio_command` string, required: Stdio command to run for stdio-type servers (e.g., 'npx')
    - `stdio_args` string[], nullable: Arguments for the stdio command (e.g., ['@modelcontextprotocol/server-github'])
    - `stdio_env` object, nullable: Environment variables for stdio-type servers (can reference secrets)

## Response `201`

Successful Response

- MCPIntegrationRead: Response model for MCP integration.
  - `id` string, uuid4, required
  - `workspace_id` string, uuid, required
  - `name` string, required
  - `description` string, nullable, required
  - `slug` string, required
  - `server_type` 'http' | 'stdio', required
  - `server_uri` string, nullable, required
  - `auth_type` 'OAUTH2' | 'CUSTOM' | 'NONE', required: Authentication type for MCP integrations.
  - `oauth_integration_id` string, uuid4, nullable, required
  - `tunnel_id` string, uuid4, nullable
  - `state` 'not_configured' | 'configured' | 'connected' | 'reauth_required' | 'error', required
  - `stdio_command` string, nullable, required
  - `stdio_args` string[], nullable, required
  - `has_stdio_env` boolean
  - `timeout` integer, nullable, required
  - `tools` MCPToolSummary[], nullable
    - `name` string, required
    - `description` string, nullable
    - `enabled` boolean
    - `requires_approval` boolean
    - `status` 'available' | 'missing'
    - `input_schema` object, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

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