POST /api/mcp/toggle Bearer

Toggle MCP Server

Enable or disable an MCP server in PocketPaw without removing its configuration. Disabled servers retain their settings but their tools are not available to the agent.

Overview

Enables or disables an MCP server. Disabling a server stops its process and removes its tools from the agent. Enabling starts the server and makes its tools available.

Request Body

Body Parameters

name required
string

The name of the MCP server to toggle.

Response

status string
"ok" on success
enabled boolean
The new enabled state of the server
Terminal window
curl -X POST "http://localhost:8000/api/mcp/toggle" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name": "filesystem"}'
const response = await fetch("http://localhost:8000/api/mcp/toggle", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({ name: "filesystem" })
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
"http://localhost:8000/api/mcp/toggle",
headers={"Authorization": "Bearer <token>"},
json={"name": "filesystem"}
)
print(response.json())
{
"status": "ok",
"enabled": true
}
Request
curl -X POST "http://localhost:8000/api/mcp/toggle" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>"
const response = await fetch("http://localhost:8000/api/mcp/toggle", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
},
});

const data = await response.json();
console.log(data);
import requests

response = requests.post(
    "http://localhost:8000/api/mcp/toggle",
    headers={'Content-Type':'application/json','Authorization':'Bearer <token>'},
)

print(response.json())
package main

import (
    "fmt"
    "net/http"
    "io"
)

func main() {
    req, _ := http.NewRequest("POST", "http://localhost:8000/api/mcp/toggle", nil)
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer <token>")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
Response
Send a request to see the response