> ## Documentation Index
> Fetch the complete documentation index at: https://docs.refold.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete MCP Server

This API allows you to delete an existing MCP server from your organization.

<Warning>
  This action is irreversible. Once deleted, the MCP server and all its configurations will be permanently removed.
</Warning>

## Request description

<Note>
  This API supports two authentication methods. You can use either Session Token authentication OR the combination of API key and linked account ID.
</Note>

#### Authentication Option 1: Session Token

<ParamField header="Authorization" type="string" required>
  Bearer token using your session token for authentication

  **Format**: `Bearer YOUR_SESSION_TOKEN`
</ParamField>

#### Authentication Option 2: API Key + Linked Account

<ParamField header="x-api-key" type="string" required>
  Your Refold API key
</ParamField>

<ParamField header="linked_account_id" type="string" required>
  The unique identifier for the linked account
</ParamField>

#### Path Parameters

<ParamField path="mcp_server_id" type="string" required>
  Unique identifier for the MCP server to delete
</ParamField>

## Response description

<Tabs>
  <Tab title="204">
    <ResponseField name="response" type="null">
      No content returned on successful deletion
    </ResponseField>
  </Tab>

  <Tab title="Error">
    <ResponseField name="status_code" type="integer">
      System generated status code
    </ResponseField>

    <ResponseField name="http_error_type" type="string">
      System generated error type
    </ResponseField>

    <ResponseField name="error_code" type="string">
      Specific error code to identify the error
    </ResponseField>

    <ResponseField name="message" type="string">
      Error message
    </ResponseField>

    <ResponseField name="request_id" type="string">
      System generated request id
    </ResponseField>
  </Tab>
</Tabs>

<ResponseExample>
  ```JSON 204 theme={null}
  No content returned
  ```

  ```JSON 401 theme={null}
  {
      "status_code": 401,
      "http_error_type": "UNAUTHORIZED",
      "error_code": "SERVER_ERROR",
      "message": "Invalid Credentials",
      "request_id": "89bd1675-a826-46cb-9210-6cb2ae169f67"
  }
  ```

  ```JSON 404 theme={null}
  {
      "status_code": 404,
      "http_error_type": "NOT_FOUND",
      "error_code": "SERVER_ERROR",
      "message": "MCP Server not found",
      "request_id": "89bd1675-a826-46cb-9210-6cb2ae169f67"
  }
  ```

  ```JSON 403 theme={null}
  {
      "status_code": 403,
      "http_error_type": "FORBIDDEN",
      "error_code": "SERVER_ERROR",
      "message": "Insufficient permissions to delete this MCP server",
      "request_id": "89bd1675-a826-46cb-9210-6cb2ae169f67"
  }
  ```
</ResponseExample>
