Emacs MCP Server

# Emacs MCP Server Model Context Protocol (MCP) server for Emacs. Enables generating and running elisp code in a running Emacs process. ## Tools The

Local serverstdio

What is the Emacs MCP server?

Emacs MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. # Emacs MCP Server Model Context Protocol (MCP) server for Emacs. Enables generating and running elisp code in a running Emacs process. ## Tools The server exposes two tools: - generate_emacs_lisp_code: generates elisp for a given task -.

What the assistant can call

Once Emacs is connected, these are the calls the assistant has available:

  • generate_emacs_lisp_code — generates elisp for a given task
  • execute_emacs_lisp_code — passes elisp to a running Emacs (via emacsclient) to eval and execute it

Configuration and credentials

You will need 2 environment variables: OPENAI_API_KEY, EMACSCLIENT. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Setting it up

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

Choosing this one

This sits in the planning and project tracking group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Emacs's toolset — generate_emacs_lisp_code, execute_emacs_lisp_code — is a fair guide to whether it matches your workflow. It is maintained by vivekhaldar; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Emacs's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the emacs mcp server does with a few real requests.

Available tools

ToolWhat it does
generate_emacs_lisp_codegenerates elisp for a given task
execute_emacs_lisp_codepasses elisp to a running Emacs (via emacsclient) to eval and execute it.

Configuration

VariableDescriptionRequired
OPENAI_API_KEYCredential the server authenticates with.Yes
EMACSCLIENTConfiguration value read at startup.Optional

Example prompts to try

  • Use Emacs to generate emacs lisp code.
  • Use Emacs to execute emacs lisp code.

Frequently asked questions

You need Python with `uv`, the `mcp` and `smartfunc` packages, a running Emacs, and `emacsclient` installed and accessible.