Skip to content

Commit c74a723

Browse files
authored
fix: react to new mcp tools notification (#4863)
* fix: react to new mcp tools notification * chore: remove unused argument * chore: add docstr
1 parent 1e504f1 commit c74a723

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

clients/lsp-copilot.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ automatically, browse to %s." user-code verification-uri))
190190
:name "emacs"
191191
:version "0.1.0"))
192192

193+
(defun lsp-copilot--mcp-tools-notification (_ params)
194+
"Reacts to the copilot/mcpTools notification"
195+
(-let* (((&copilot-ls:McpToolsNotification :servers) params)
196+
(tools-str (s-join ", " servers)))
197+
(when (s-present? tools-str)
198+
(lsp--info "Copilot: Available MCP Tools: %s" tools-str))))
199+
193200
(defun lsp-copilot--server-initialized-fn (workspace)
194201
;; Patch capabilities -- server may respond with an empty dict. In plist,
195202
;; this would become nil
@@ -228,6 +235,7 @@ automatically, browse to %s." user-code verification-uri))
228235
("featureFlagsNotification" #'ignore)
229236
("statusNotification" #'ignore)
230237
("didChangeStatus" #'ignore)
238+
("copilot/mcpTools" #'lsp-copilot--mcp-tools-notification)
231239
("window/logMessage" #'lsp--window-log-message)
232240
("conversation/preconditionsNotification" #'ignore))))
233241

lsp-protocol.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,8 @@ See `-let' for a description of the destructuring mechanism."
473473
(lsp-interface
474474
(copilot-ls:SignInInitiateResponse (:status :userCode :verificationUri :expiresIn :interval :user) nil)
475475
(copilot-ls:SignInConfirmResponse (:status :user))
476-
(copilot-ls:CheckStatusResponse (:status :user)))
476+
(copilot-ls:CheckStatusResponse (:status :user))
477+
(copilot-ls:McpToolsNotification (:servers)))
477478

478479

479480
;; begin autogenerated code

0 commit comments

Comments
 (0)