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

# Toggle Server Status

> Toggle a server between active and paused status.

Toggles the server status between `active` and `paused`. Useful for quickly enabling or disabling a server without changing any other configuration.

* If the server is `active`, it becomes `paused`
* If the server is `paused`, it becomes `active`

## Path Parameters

<ParamField path="id" type="string" required>
  The UUID of the server to toggle (e.g. `836995ae-1cff-41ec-823e-a4f07ccca3a0`). Numeric IDs are also accepted for backwards compatibility.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
       --url https://yoursite.com/wp-json/getmcp/v1/servers/836995ae-1cff-41ec-823e-a4f07ccca3a0/toggle \
       --header 'Authorization: Bearer gmcp_your_api_key'
  ```

  ```python Python theme={null}
  import requests
  response = requests.patch(
      "https://yoursite.com/wp-json/getmcp/v1/servers/836995ae-1cff-41ec-823e-a4f07ccca3a0/toggle",
      headers={"Authorization": "Bearer gmcp_your_api_key"}
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://yoursite.com/wp-json/getmcp/v1/servers/836995ae-1cff-41ec-823e-a4f07ccca3a0/toggle",
    {
      method: "PATCH",
      headers: { "Authorization": "Bearer gmcp_your_api_key" }
    }
  );
  const data = await response.json();
  ```

  ```php PHP theme={null}
  $response = wp_remote_request(
      "https://yoursite.com/wp-json/getmcp/v1/servers/836995ae-1cff-41ec-823e-a4f07ccca3a0/toggle",
      [
          "method"  => "PATCH",
          "headers" => ["Authorization" => "Bearer gmcp_your_api_key"]
      ]
  );
  $data = json_decode(wp_remote_retrieve_body($response), true);
  ```

  ```go Go theme={null}
  package main
  import (
  	"fmt"
  	"io"
  	"net/http"
  )

  func main() {
  	req, _ := http.NewRequest("PATCH", "https://yoursite.com/wp-json/getmcp/v1/servers/836995ae-1cff-41ec-823e-a4f07ccca3a0/toggle", nil)
  	req.Header.Set("Authorization", "Bearer gmcp_your_api_key")

  	client := &http.Client{}
  	resp, _ := client.Do(req)
  	defer resp.Body.Close()
  	data, _ := io.ReadAll(resp.Body)
  	fmt.Println(string(data))
  }
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  public class Main {
      public static void main(String[] args) throws Exception {
          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create("https://yoursite.com/wp-json/getmcp/v1/servers/836995ae-1cff-41ec-823e-a4f07ccca3a0/toggle"))
              .header("Authorization", "Bearer gmcp_your_api_key")
              .method("PATCH", HttpRequest.BodyPublishers.noBody())
              .build();

          HttpClient client = HttpClient.newHttpClient();
          HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
          System.out.println(response.body());
      }
  }
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'
  require 'uri'

  uri = URI('https://yoursite.com/wp-json/getmcp/v1/servers/836995ae-1cff-41ec-823e-a4f07ccca3a0/toggle')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = uri.scheme == 'https'

  request = Net::HTTP::Patch.new(uri)
  request['Authorization'] = 'Bearer gmcp_your_api_key'

  response = http.request(request)
  puts JSON.parse(response.body)
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK (now paused) theme={null}
  {
    "id": 1,
    "uuid": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
    "user_id": 1,
    "name": "My Weather Tools",
    "slug": "my-weather-tools",
    "server_id": "a1b2c3d4e5f6a1b2",
    "status": "paused",
    "transport_type": "streamable-http",
    "auth_type": "none",
    "auth_config": null,
    "outbound_auth_type": "none",
    "outbound_auth_config": null,
    "cors_origins": null,
    "rate_limit_per_min": 60,
    "settings": null,
    "endpoint_url": "https://yoursite.com/mcp/my-weather-tools",
    "tool_count": 3,
    "prompt_count": 1,
    "resource_count": 2,
    "created_at": "2025-03-01T10:00:00Z",
    "updated_at": "2025-03-18T12:00:00Z"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "code": "getmcp_not_found",
    "message": "Server not found.",
    "data": { "status": 404 }
  }
  ```
</ResponseExample>
