Function: mcp-async-ping

mcp-async-ping is a natively compiled function defined in mcp.el.

Signature

(mcp-async-ping CONNECTION)

Documentation

Send an asynchronous ping request to the MCP server via CONNECTION.

The function uses jsonrpc-async-request to send a ping request. On success, it displays a message with the response. On error, it displays an error message with the code from the server.

Source Code

;; Defined in /nix/store/5m747x13pb1ddrvbq9raj91c4q1h1kl0-emacs-packages-deps/share/emacs/site-lisp/elpa/mcp-20260615.940/mcp.el
(defun mcp-async-ping (connection)
  "Send an asynchronous ping request to the MCP server via CONNECTION.

The function uses `jsonrpc-async-request' to send a ping request.
On success, it displays a message with the response.
On error, it displays an error message with the code from the server."
  (jsonrpc-async-request connection
                         :ping
                         nil
                         :timeout (mcp--timeout connection)
                         :success-fn
                         (lambda (res)
                           (message "[mcp] ping success: %s" res))
                         :error-fn (jsonrpc-lambda (&key code message _data)
                                     (message "Sadly, %s mpc server reports %s: %s"
                                              (jsonrpc-name connection) code message))))