A small MCP server that lets Claude Code and Cursor talk to your running Emacs via emacsclient
.
- Emacs with the server enabled (e.g., add
(server-start)
to your init, or runemacs --daemon
). - Python 3.12.
Install and run with uvx (requires uv):
uvx git+https://github.com/thornjad/emacs-mcp-server.git --smoke
Run the server (for MCP clients that launch it for you, see config below; you can also run it manually to test). It will fail fast if Emacs isn't reachable:
uvx git+https://github.com/thornjad/emacs-mcp-server.git
For development or if you need to modify the code:
brew install uv
uv venv -p 3.12
uv sync
uv run emacs-mcp-server --smoke
Use the claude mcp add
command to register this server with the CLI.
- uvx (recommended):
claude mcp add --scope user --transport stdio \
emacs uvx git+https://github.com/thornjad/emacs-mcp-server.git
- Development (uv):
claude mcp add --scope user --transport stdio \
emacs uv run emacs-mcp-server
Confirm and manage:
claude mcp list
claude mcp get emacs
Cursor also supports MCP servers.
- Open Cursor Settings and find the MCP Servers section.
- Add a new custom server:
- Name:
emacs
- Command and Args: same options as described above for Claude Code
- Environment (optional): same as above
- Stdio: enabled
- Name:
After saving, ask Cursor to read the visible text in your current Emacs window or to evaluate a small form to confirm everything works.