-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathai-code-mcp-common.el
More file actions
30 lines (21 loc) · 846 Bytes
/
ai-code-mcp-common.el
File metadata and controls
30 lines (21 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
;;; ai-code-mcp-common.el --- Shared MCP helper functions -*- lexical-binding: t; -*-
;; SPDX-License-Identifier: Apache-2.0
;;; Commentary:
;; Shared helper functions used by optional MCP tool modules.
;;; Code:
(require 'subr-x)
(defvar ai-code-mcp-server-tool-setup-functions nil
"Functions that register optional MCP tool groups.")
(defun ai-code-mcp--json-bool (value)
"Return VALUE as a JSON boolean token."
(if value t :json-false))
(defun ai-code-mcp--message-lines ()
"Return the current `*Messages*' contents as a list of lines."
(if-let ((buffer (get-buffer "*Messages*")))
(with-current-buffer buffer
(split-string (buffer-substring-no-properties (point-min) (point-max))
"\n"
t))
'()))
(provide 'ai-code-mcp-common)
;;; ai-code-mcp-common.el ends here