Skip to content

Commit 963446d

Browse files
committed
Consolidate editor tools and add opt-in eval_elisp
1 parent fa222cc commit 963446d

9 files changed

Lines changed: 609 additions & 753 deletions

README.org

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ The generated prompt will include the function/region scope, visible file list,
200200

201201
AI Code includes an Emacs MCP server with these core built-in tools:
202202
- =project_info=: summarize the current project, active buffer, and file count
203+
- =editor_state=: inspect the currently selected buffer, point, mode, region, and buffer flags
204+
- =visible_buffers=: list the buffers visible in the selected frame windows
203205
- =buffer_query=: read buffer contents, optionally by line range
204206
- =get_diagnostics=: return Flycheck or Flymake diagnostics for one file or open project buffers
205207
- =get_project_files=: list regular files in the current project
@@ -223,25 +225,20 @@ When enabled, AI Code also registers:
223225
- =get_feature_load_state=: inspect whether an Emacs feature is loaded and where it comes from
224226
- =get_recent_messages=: return the latest lines from =*Messages*=
225227
- =get_last_error_backtrace=: return the most recently recorded Emacs command error snapshot
228+
- =eval_elisp=: evaluate a single Emacs Lisp form in a chosen buffer context when explicitly enabled
226229

227230
This split keeps the MCP core small while still exposing debugging-oriented tools by default.
228231

229-
Optional editor-session tools are available when you explicitly enable them:
232+
By default, =eval_elisp= is not registered. To opt in explicitly:
230233

231234
#+begin_src emacs-lisp
232-
(setq ai-code-mcp-editor-tools-enabled t)
235+
(setq ai-code-mcp-debug-tools-enable-eval-elisp t)
233236
#+end_src
234237

235-
When enabled, AI Code also registers:
236-
- =editor_state=: inspect the currently selected buffer, point, mode, region, and buffer flags
237-
- =visible_buffers=: list the buffers visible in the selected frame windows
238-
- =messages_tail=: return the latest lines from =*Messages*=
239-
- =eval_elisp=: evaluate a single Emacs Lisp form in a chosen buffer context
240-
241238
By default, =eval_elisp= only allows =query= mode. To allow editor-local side effects too, opt in explicitly:
242239

243240
#+begin_src emacs-lisp
244-
(setq ai-code-mcp-editor-tools-allow-effect-eval t)
241+
(setq ai-code-mcp-debug-tools-allow-effect-eval t)
245242
#+end_src
246243

247244
screenshot inside Codex cli:

ai-code-autoloads.el

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,9 +1021,6 @@ prompt for the project directory.
10211021
(register-definition-prefixes "ai-code-mcp-debug-tools" '("ai-code-mcp-"))
10221022

10231023

1024-
;;; Generated autoloads from ai-code-mcp-editor-tools.el
1025-
1026-
(register-definition-prefixes "ai-code-mcp-editor-tools" '("ai-code-mcp-"))
10271024

10281025
;;; End of scraped data
10291026

0 commit comments

Comments
 (0)