Emacs Lisp Development MCP server

Provides Emacs Lisp development assistance through function documentation retrieval, source code definition extraction, variable information lookup, Info documentation access, and secure source file reading from system directories and ELPA packages.
Back to servers
Setup instructions
Provider
Laurynas Biveinis
Release date
Jun 30, 2025
Stats
11 stars

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.

Installation

You can install the elisp-dev-mcp package directly from MELPA:

M-x package-install RET elisp-dev-mcp RET

Usage

Setting Up the Server

Before using the MCP server, you need to:

  1. Install mcp-server-lib (which includes running M-x mcp-server-lib-install)
  2. Register 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
  1. Start the server in Emacs:
M-x mcp-server-lib-start

When you're done, stop the server with:

M-x mcp-server-lib-stop

Available MCP Handlers

The MCP server provides several handlers for interacting with Elisp code:

Elisp Function Documentation

Retrieves complete documentation for Emacs Lisp functions.

  • Handler name: elisp-describe-function
  • Parameters:
    • function: The name of the function to describe (string)
  • Returns:
    • description: The function's documentation (string)
    • or error: Error message if something went wrong

Elisp Function Definition

Gets the source code definition of Emacs Lisp functions.

  • Handler name: elisp-get-function-definition
  • Parameters:
    • function: The name of the function to retrieve (string)
  • Returns for Elisp functions:
    • source: The function's source code including header comments
    • file-path: Path to the file where the function is defined
    • start-line: First line number of the definition (1-based)
    • end-line: Last line number of the definition (1-based)
  • Returns for C-implemented functions:
    • is-c-function: Boolean indicator (always true)
    • function-name: The name of the function
    • message: Indication that the function is implemented in C

Elisp Variable Description

Provides information about Emacs Lisp variables without exposing their values.

  • Handler name: elisp-describe-variable
  • Parameters:
    • variable: The name of the variable to describe (string)
  • Returns:
    • Comprehensive metadata about the variable including name, type, documentation, source file, custom properties, etc.
    • or error: Error message if something went wrong

Elisp Info Documentation Lookup

Looks up Elisp symbols in Info documentation.

  • Handler name: elisp-info-lookup-symbol
  • Parameters:
    • symbol: The Elisp symbol to look up (string)
  • Returns:
    • Complete Info node content with examples and cross-references
    • Status indicators and references for direct access

Elisp Source File Reader

Reads Elisp source files from Emacs system directories or ELPA packages.

  • Handler name: elisp-read-source-file
  • Parameters:
    • file-path: Absolute path to .el file (string)
  • Returns:
    • The complete file contents as a string
    • or error: Error message if the file cannot be accessed

This handler only reads from Emacs system lisp directories and ~/.emacs.d/elpa/ for security reasons.

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later