> ## 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.

# Update Server

> Partially update an existing MCP server.

## Path Parameters

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

## Body Parameters

All fields are optional. Only include fields you want to update.

<ParamField body="name" type="string">
  New server name.
</ParamField>

<ParamField body="description" type="string">
  Server description. Merged into `settings.description` â€” other settings fields are preserved.
</ParamField>

<ParamField body="status" type="string">
  Server status. One of: `active`, `paused`, `draft`.
</ParamField>

<ParamField body="auth_type" type="string">
  Inbound authentication required for the MCP endpoint. One of: `none`, `bearer`, `api-key`, `basic`, `oauth`.
</ParamField>

<ParamField body="test_auth_credentials" type="string">
  JSON-encoded string of the credentials used when clicking **Test** in the admin panel.
  Stored encrypted; never exposed to MCP clients. Falls back to `auth_credentials` if not set.

  Format depends on `test_auth_type`:

  **Bearer** â€” `{"token":"your_bearer_token"}`

  **API Key** â€” `{"name":"X-API-Key","value":"your_api_key","location":"header"}` â€” use `"location":"query"` for query param.

  **Basic Auth** â€” `{"username":"your_username","password":"your_password"}`

  <Note>Pass as a JSON-serialised string here. The `GET /servers/{id}/credentials` endpoint returns these as a decoded object.</Note>
</ParamField>

<ParamField body="cors_origins" type="string">
  Comma-separated allowed CORS origins. Leave empty to allow all origins (`*`).
</ParamField>

<ParamField body="rate_limit_per_min" type="integer">
  New rate limit per minute.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
       --url https://yoursite.com/wp-json/getmcp/v1/servers/836995ae-1cff-41ec-823e-a4f07ccca3a0 \
       --header 'Authorization: Bearer gmcp_your_api_key' \
       --header 'content-type: application/json' \
       --data '
  {
    "name": "GitHub Tools v2",
    "description": "Updated tools for GitHub",
    "auth_type": "bearer",
    "test_auth_credentials": "{\"token\":\"your_bearer_token\"}",
    "rate_limit_per_min": 60
  }
  '
  ```

  ```python Python theme={null}
  import requests, json

  response = requests.patch(
      "https://yoursite.com/wp-json/getmcp/v1/servers/836995ae-1cff-41ec-823e-a4f07ccca3a0",
      headers={
          "Authorization": "Bearer gmcp_your_api_key",
          "Content-Type": "application/json"
      },
      json={
          "name": "GitHub Tools v2",
          "description": "Updated tools for GitHub",
          "auth_type": "bearer",
          "test_auth_credentials": json.dumps({"token": "your_bearer_token"}),
          "rate_limit_per_min": 60
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://yoursite.com/wp-json/getmcp/v1/servers/836995ae-1cff-41ec-823e-a4f07ccca3a0",
    {
      method: "PATCH",
      headers: {
        "Authorization": "Bearer gmcp_your_api_key",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        name: "GitHub Tools v2",
        description: "Updated tools for GitHub",
        auth_type: "bearer",
        test_auth_credentials: JSON.stringify({ token: "your_bearer_token" }),
        rate_limit_per_min: 60
      })
    }
  );
  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",
      [
          "method"  => "PATCH",
          "headers" => [
              "Authorization" => "Bearer gmcp_your_api_key",
              "Content-Type"  => "application/json"
          ],
          "body" => json_encode([
              "name"                  => "GitHub Tools v2",
              "description"           => "Updated tools for GitHub",
              "auth_type"             => "bearer",
              "test_auth_credentials" => json_encode(["token" => "your_bearer_token"]),
              "rate_limit_per_min"    => 60
          ])
      ]
  );
  $data = json_decode(wp_remote_retrieve_body($response), true);
  ```

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

  func main() {
  	body := strings.NewReader(`{
    "name": "GitHub Tools v2",
    "description": "Updated tools for GitHub",
    "auth_type": "bearer",
    "test_auth_credentials": "{\"token\":\"your_bearer_token\"}",
    "rate_limit_per_min": 60
  }`)

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

  	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 {
          String json = "{\n  \"name\": \"GitHub Tools v2\",\n  \"description\": \"Updated tools for GitHub\",\n  \"auth_type\": \"bearer\",\n  \"test_auth_credentials\": \"{\\\"token\\\":\\\"your_bearer_token\\\"}\",\n  \"rate_limit_per_min\": 60\n}";

          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create("https://yoursite.com/wp-json/getmcp/v1/servers/836995ae-1cff-41ec-823e-a4f07ccca3a0"))
              .header("Authorization", "Bearer gmcp_your_api_key")
              .header("Content-Type", "application/json")
              .method("PATCH", HttpRequest.BodyPublishers.ofString(json))
              .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')
  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'
  request['Content-Type'] = 'application/json'
  request.body = '{
    "name": "GitHub Tools v2",
    "description": "Updated tools for GitHub",
    "auth_type": "bearer",
    "test_auth_credentials": "{\"token\":\"your_bearer_token\"}",
    "rate_limit_per_min": 60
  }'

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

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": 3,
    "uuid": "9a3b7c8d-2e1f-4a5b-8c9d-0e1f2a3b4c5d",
    "user_id": 1,
    "name": "GitHub Tools v2",
    "slug": "github-tools",
    "server_id": "c3d4e5f6a1b2c3d4",
    "status": "active",
    "transport_type": "streamable-http",
    "auth_type": "bearer",
    "auth_config": null,
    "outbound_auth_type": "none",
    "outbound_auth_config": null,
    "cors_origins": null,
    "rate_limit_per_min": 60,
    "settings": {
      "description": "Updated tools for GitHub"
    },
    "endpoint_url": "https://yoursite.com/mcp/github-tools",
    "tool_count": 5,
    "prompt_count": 0,
    "resource_count": 0,
    "created_at": "2025-03-18T10:00:00Z",
    "updated_at": "2025-03-18T11:30:00Z"
  }
  ```

  ```json 500 Server Error theme={null}
  {
    "code": "getmcp_update_failed",
    "message": "Failed to update server.",
    "data": { "status": 500 }
  }
  ```
</ResponseExample>
