Emacs MCP Server
Enables OpenAI models to interact with Emacs through the MCP server, as indicated by the OPENAI_API_KEY requirement in the configuration.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Emacs MCP Server open my todo.org file and show the first 5 items"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 taskexecute_emacs_lisp_code: passes elisp to a running Emacs (viaemacsclient) to eval and execute it.
Related MCP server: MCP Server Demo
Invocation
The project is managed with uv. First, run uv sync to install all dependencies. Then source .venv/bin/activate to activate the resulting venv.
To run the MCP server in the inspector:
mcp dev emacs_mcp_server.pyTo install the MCP server so that Claude Desktop can use it:
mcp install emacs_mcp_server.pyBut you will have to edit the resulting JSON config in claude_desktop_config.json to include API keys and the full path to emacsclient. It should look something like this:
"Emacs-MCP-Server": {
"command": "/Users/haldar/.local/bin/uv",
"args": [
"run",
"--with",
"mcp[cli]",
"--with",
"smartfunc",
"mcp",
"run",
"/Users/haldar/repos/gh/emacs-mcp-server/emacs_mcp_server.py"
],
"env": {
"OPENAI_API_KEY": "sk-xxxx",
"EMACSCLIENT": "/your/path/to/emacsclient"
}
}Available Tools
2 toolsexecute_emacs_lisp_codeC
Execute Emacs Lisp code by sending it to the Emacs process and return the result.
Inputs: code (required).
generate_emacs_lisp_codeC
Generate Emacs Lisp code for the given purpose.
Inputs: purpose (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one executes Emacs Lisp code, while the other generates it. There is no overlap or ambiguity between these functions, making it easy for an agent to select the appropriate tool based on the task.
Both tools follow a consistent verb_noun pattern with 'execute_emacs_lisp_code' and 'generate_emacs_lisp_code'. The naming is uniform, using snake_case and clear verbs that accurately describe each tool's action.
With only two tools, the server feels thin for an Emacs integration, as it lacks operations like editing files, managing buffers, or handling common Emacs commands. This minimal set may limit agents in performing typical Emacs-related tasks.
The tool surface is severely incomplete for an Emacs server, covering only code execution and generation. It misses essential CRUD/lifecycle operations such as opening files, saving changes, or interacting with Emacs modes, which are core to the domain.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
A Model Context Protocol server for Wix AI tools
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables AI assistants to interact with the Godot game engine, allowing them to launch the editor, run projects, capture debug output, and control project execution.14187 npm6,603MIT
- FlicenseNot gradedqualityDmaintenanceA demonstration implementation of the Model Context Protocol server that facilitates communication between AI models and external tools while maintaining context awareness.-
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI assistants to interact with iTerm2 terminals, allowing creation and management of terminal sessions, command execution, and reading terminal output.589 npm14ISC
- FlicenseAqualityNot gradedmaintenanceA Model Context Protocol server that allows LLMs to interact with Python environments, enabling code execution, file operations, package management, and development workflows.9-