Function: mcp-remove-root

mcp-remove-root is a natively compiled function defined in mcp.el.

Signature

(mcp-remove-root NAME ROOT)

Documentation

Remove ROOT from MCP server NAME.

NAME is the server name (string). ROOT is the root to remove (string path or plist).

After removing the root, sends a notification to the server that roots have changed.

Source Code

;; Defined in /nix/store/5m747x13pb1ddrvbq9raj91c4q1h1kl0-emacs-packages-deps/share/emacs/site-lisp/elpa/mcp-20260615.940/mcp.el
(defun mcp-remove-root (name root)
  "Remove ROOT from MCP server NAME.

NAME is the server name (string).
ROOT is the root to remove (string path or plist).

After removing the root, sends a notification to the server that roots
have changed."
  (when-let* ((connection (gethash name mcp-server-connections)))
    (condition-case err
        (progn
          (setf (mcp--roots connection)
                (cl-remove root (mcp--roots connection) :test #'equal))
          (mcp-notify connection :notifications/roots/list_changed))
      (error
       (message "Warning: Could not remove root from %s: %s. Server may need to be restarted." name err)))))