ragmacs-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ragmacs-mcpshow me the source code for thefind-filefunction"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
#+title: ragmacs-mcp #+author: Lander M. Kerbey #+options: toc:t num:nil
An MCP server that gives LLMs live introspective access to a running Emacs instance. It exposes tools for reading documentation, browsing Info manuals, inspecting source code, and querying completions — all against your actual running Emacs environment.
The inspiration for this MCP is due to [[https://github.com/positron-solutions][Positron Solutions]], who created [[https://github.com/positron-solutions/ragmacs/tree/master][ragmacs]]. This is as much of a straight port to MCP as my limited ability allows at present.
Rationale
Given how easy it is to set up =ragmacs= via standard Emacs configuration, why bother with porting it to MCP? In the course of my day job, I have identified a number of workflows for which LLMs with tool-calling capabilities are very well suited, but the scope of the projects are such that the token consumption that comes with the necessary tool use would ramp up AI spend too much. Following on from articles by [[https://www.anthropic.com/engineering/code-execution-with-mcp][Anthropic]] and [[https://blog.cloudflare.com/code-mode/][Cloudflare]], I've been tinkering with MCP-based code-execution workflows. This is meant to facilitate that.
Prerequisites
** Emacs
You need a running Emacs with a server started. Add this to your Emacs config:
#+begin_src emacs-lisp (require 'server) (unless (server-running-p) (server-start)) #+end_src
Or start it interactively with M-x server-start.
** orderless
The completion tools (function_completions, command_completions,
variable_completions) require the [[https://github.com/oantolin/orderless][orderless]] package. Install it via your
package manager of choice, for example with use-package:
#+begin_src emacs-lisp (use-package orderless) #+end_src
** emacsclient
emacsclient must be on your PATH. Verify this works before proceeding:
#+begin_src bash emacsclient --eval "(emacs-version)" #+end_src
** C source (optional)
function_source and variable_source can retrieve source code for C
built-ins if the Emacs C source is available on disk. If you are using a
packaged Emacs binary, you may need to install an additional package such as
emacs-src to make this work. If C source is unavailable, the tools return a
helpful message explaining the situation rather than failing silently.
Installation
#+begin_src bash npm install npm run build #+end_src
Configuration
Add the following to your MCP client configuration. The exact file location depends on your client — for mcpproxy it is typically =~/.mcpproxy/mcp_config.json=:
#+begin_src json "mcpServers": [ { "name": "ragmacs", "command": "node", "args": ["ragmacs-mcp/dist/index.js"], "protocol": "stdio", "enabled": true } ] #+end_src
If you have multiple Emacs servers running and need to target a specific one,
set the EMACS_SOCKET_NAME environment variable:
#+begin_src json "mcpServers": [ { "name": "ragmacs", "command": "node", "args": ["ragmacs-mcp/dist/index.js"], "protocol": "stdio", "enabled": true, "env": { "EMACS_SOCKET_NAME": "/run/user/1000/emacs/server" } } ] #+end_src
Tools
| Tool | Description |
|------------------------+-----------------------------------------------|
| elisp_eval | Evaluate an arbitrary Elisp expression |
| symbol_exists | Check if a symbol exists in obarray |
| load_paths | Return Emacs load paths |
| list_features | Return loaded features |
| list_manuals | List available Info manuals |
| list_manual_nodes | List nodes within a manual |
| manual_node_contents | Read the contents of a manual node |
| check_feature | Check if a feature is loaded or available |
| library_source | Read the full source of an Elisp library |
| symbol_manual_section | Find the manual section for a symbol |
| function_source | Read the source code of a function |
| variable_source | Read the source code of a variable definition |
| variable_value | Read the current global value of a variable |
| function_documentation | Read the docstring of a function |
| variable_documentation | Read the docstring of a variable |
| function_completions | List functions matching a prefix |
| command_completions | List commands matching a prefix |
| variable_completions | List variables matching a prefix |
Development
#+begin_src bash npm test # run tests (requires a running Emacs) npm run build # compile TypeScript npm start # run the server #+end_src
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseCqualityDmaintenanceA Model Context Protocol server that enables generating and executing Elisp code in a running Emacs process, allowing AI assistants to control and interact with Emacs.Last updated236
- Alicense-qualityAmaintenanceElisp (Emacs Lisp) development support tools, running in EmacsLast updated46GPL 3.0
- Alicense-qualityAmaintenanceEnables AI assistants to interact with Clojure REPLs for evaluating code, performing structural edits with bracket balancing, and looking up symbol documentation. Transforms AI coding assistants into interactive programming partners with access to runtime evaluation and real data structures.Last updated60MIT
- AlicenseAqualityDmaintenanceEnables LLMs to inspect and test other MCP servers by listing and calling their tools, reading resources, and getting prompts. Supports stdio, SSE, and HTTP transports for both local and remote MCP server inspection.Last updated71MIT
Related MCP Connectors
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…
@latest documentation and code examples to 9000+ libraries for LLMs and AI code editors in a singl…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/landermkerbey/ragmacs-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server