This MCP server provides a structured API for AI agents to interact with Emacs and assist with Elisp coding tasks. It serves as a bridge between AI systems and Emacs, enabling smarter, context-aware Elisp development assistance.
You can install the elisp-dev-mcp
package directly from MELPA:
M-x package-install RET elisp-dev-mcp RET
Before using the MCP server, you need to:
mcp-server-lib
(which includes running M-x mcp-server-lib-install
)elisp-dev-mcp
with your MCP client:claude mcp add -s user -t stdio elisp-dev -- ~/.emacs.d/emacs-mcp-stdio.sh --init-function=elisp-dev-mcp-enable --stop-function=elisp-dev-mcp-disable
M-x mcp-server-lib-start
When you're done, stop the server with:
M-x mcp-server-lib-stop
The MCP server provides several handlers for interacting with Elisp code:
Retrieves complete documentation for Emacs Lisp functions.
elisp-describe-function
function
: The name of the function to describe (string)description
: The function's documentation (string)error
: Error message if something went wrongGets the source code definition of Emacs Lisp functions.
elisp-get-function-definition
function
: The name of the function to retrieve (string)source
: The function's source code including header commentsfile-path
: Path to the file where the function is definedstart-line
: First line number of the definition (1-based)end-line
: Last line number of the definition (1-based)is-c-function
: Boolean indicator (always true)function-name
: The name of the functionmessage
: Indication that the function is implemented in CProvides information about Emacs Lisp variables without exposing their values.
elisp-describe-variable
variable
: The name of the variable to describe (string)error
: Error message if something went wrongLooks up Elisp symbols in Info documentation.
elisp-info-lookup-symbol
symbol
: The Elisp symbol to look up (string)Reads Elisp source files from Emacs system directories or ELPA packages.
elisp-read-source-file
file-path
: Absolute path to .el
file (string)error
: Error message if the file cannot be accessedThis handler only reads from Emacs system lisp directories and ~/.emacs.d/elpa/
for security reasons.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "elisp-dev" '{"command":"~/.emacs.d/emacs-mcp-stdio.sh","args":["--init-function=elisp-dev-mcp-enable","--stop-function=elisp-dev-mcp-disable"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"elisp-dev": {
"command": "~/.emacs.d/emacs-mcp-stdio.sh",
"args": [
"--init-function=elisp-dev-mcp-enable",
"--stop-function=elisp-dev-mcp-disable"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"elisp-dev": {
"command": "~/.emacs.d/emacs-mcp-stdio.sh",
"args": [
"--init-function=elisp-dev-mcp-enable",
"--stop-function=elisp-dev-mcp-disable"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect