Model Context Protocol (MCP) server for Emacs integration. Provides tools to interact with Emacs from Claude Desktop/Code.
- get_buffer_content: Get the content of the current Emacs buffer
- get_buffer_filename: Get the filename associated with the current Emacs buffer
- get_selection: Get the current selection (region) in Emacs
- open_file: Open a file in the current Emacs window
- describe_flycheck_info_at_point: Get flycheck diagnostics at cursor
- get_error_context: Summarize contents of error-related buffers (Messages, Warnings, compilation logs)
- org-tasks://all: All TODO items from org-mode agenda files with status, priority, scheduled/deadline dates
- Node.js 20+
- Emacs with server mode running (
M-x server-startor in your init file) emacsclientavailable in PATH
npm install
npm run buildAdd to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"emacs": {
"command": "node",
"args": ["/path/to/mcp-emacs/dist/index.js"]
}
}
}Add to your Claude Code MCP settings:
{
"emacs": {
"command": "node",
"args": ["/path/to/mcp-emacs/dist/index.js"]
}
}# Build
npm run build
# Watch mode
npm run watch- TypeScript/Node.js: MCP server implementation
- emacsclient: Communication with Emacs via
--eval - STDIO transport: Standard MCP communication protocol
The server requires Emacs to be running with server mode enabled. Add this to your Emacs init file:
(server-start)Or manually start the server with M-x server-start.