emacs
MCP server from vivekhaldar/emacs-mcp-server
claude mcp add --transport stdio vivekhaldar-emacs-mcp-server uv run --with mcp[cli] mcp run emacs_mcp_server.py \ --env EMACSCLIENT="/path/to/emacsclient" \ --env OPENAI_API_KEY="sk-xxxx"
How to use
This MCP server enables generating Emacs Lisp code tailored to a task and then executing that code in a running Emacs instance. It exposes two tools: generate_emacs_lisp_code, which produces elisp snippets for a given objective, and execute_emacs_lisp_code, which sends those snippets to Emacs via emacsclient for evaluation. Use the generate tool to obtain code that accomplishes a user-specified task, then pass that code to the execute tool so it runs inside a live Emacs session. The workflow is designed to integrate seamlessly with Claude Desktop, letting you prototype and run Emacs automations from chat.
How to install
Prerequisites:
- Python 3.8+ and a working Python virtual environment
- The uv (uvicorn-like) tooling required by the project
- Access to the Emacsclient binary for remote evaluation
Install and run steps:
- Install dependencies and set up the environment
uv sync
source .venv/bin/activate
- Run the MCP server in development mode
mcp dev emacs_mcp_server.py
- Install the MCP server so Claude Desktop can discover it
mcp install emacs_mcp_server.py
Note: After installation, edit claude_desktop_config.json to provide API keys and the path to emacsclient as shown in the example configuration.
Additional notes
Environment variables you may need:
- OPENAI_API_KEY: Your OpenAI API key for model access
- EMACSCLIENT: Absolute path to your emacsclient executable (required for remote evaluation)
Configuration tips:
- Ensure Emacs is running with emacsclient enabled (server mode) if you plan to eval code in an existing session.
- The mcp_config here uses uv to run the server; you can adapt the command path if you deploy differently.
- When testing, start with small elisp snippets to confirm communication between the MCP server and Emacs. If emacsclient cannot connect, verify networking, permissions, and the EMACSCLIENT path.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP