emacs-mcp
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 show me the git status of the current project"
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
An MCP (Model Context Protocol) server that bridges Claude Code with Emacs via emacsclient.
Features
Phase 1: Core (Buffer & Eval)
Tool | Description |
| Execute arbitrary Elisp code |
| Read contents of a buffer |
| Write/replace content in a buffer |
| Apply targeted edits (find and replace) |
| List all open buffers |
| Switch to a buffer |
| Create a new buffer |
| Close/kill a buffer |
Phase 2: File & Project Operations
Tool | Description |
| Open a file (with optional line/column) |
| Save buffer to file |
| Save buffer to new path |
| Get file metadata |
| List known projects |
| Get current project info |
| Switch to a project |
| List files in project |
| Search files by pattern |
| List workspaces/tabs |
| Get current workspace |
| Switch workspace |
| Create new workspace |
| Delete workspace |
| Save workspace state |
Phase 3: Org-mode Integration
Tool | Description |
| Read org document (raw or parsed structure) |
| Write content to org buffer |
| Add a new heading |
| Update heading title/content |
| Delete a heading and subtree |
| Move heading (up/down/promote/demote) |
| Set TODO state for a heading |
| List all TODO items |
| Set tags for a heading |
| Set a property for a heading |
| Export to html/pdf/markdown/latex/ascii/odt |
| Query agenda (day/week/month) |
| Create entry via capture template |
| Search org files (text/heading/tag/property) |
Phase 4: Git/Magit Integration
Tool | Description |
| Get git status (staged, unstaged, untracked) |
| Get diff (staged/unstaged/committed) |
| Get commit log |
| Stage files for commit |
| Unstage files |
| Create a commit |
| List branches |
| Get current branch |
| Checkout a branch |
| List stashes |
| Create a stash |
| Pop a stash |
| Show git blame for a file |
Phase 5: Ediff & Comparison
Tool | Description |
| Compare two files (unified/context/side-by-side) |
| Compare two buffers |
| Compare two text strings |
| Three-way file comparison (for merges) |
| Get summary of differences |
Resources
URI | Description |
| List of all open buffers |
| Contents of a buffer |
| List of known projects |
| Current project info |
| Files in a project |
| List of workspaces |
| Current workspace |
| Today's agenda items |
| All TODO items |
| Org-agenda files |
| Available capture templates |
| Current git status |
| Current branch info |
Compatibility
Vanilla Emacs: Uses
project.elandtab-bar-modeDoom Emacs: Uses
projectileand+workspace(auto-detected)
Related MCP server: claude-bridge
Prerequisites
Emacs 28+ with daemon support
Node.js 18+
Running Emacs daemon:
emacs --daemon
Installation
npm install
npm run buildConfiguration
Add to your Claude Code .mcp.json:
{
"mcpServers": {
"emacs": {
"command": "node",
"args": ["/path/to/emacs-mcp/dist/index.js"],
"env": {
"EMACS_SOCKET": "/run/user/1000/emacs/server",
"EMACSCLIENT_PATH": "/usr/bin/emacsclient"
}
}
}
}Environment Variables
Variable | Description | Default |
| Path to Emacs daemon socket | Auto-detect |
| Path to emacsclient binary |
|
| Default timeout for operations (ms) |
|
| Org files directory |
|
Usage Examples
Claude: Read the contents of the *scratch* buffer
> Uses emacs_buffer_read tool
Claude: List all open buffers
> Uses emacs_buffer_list tool
Claude: Evaluate (+ 1 2 3) in Emacs
> Uses emacs_eval tool
Claude: What projects do I have open?
> Uses emacs_project_list tool
Claude: Switch to workspace "main"
> Uses emacs_workspace_switch tool
Claude: Open /path/to/file.ts at line 42
> Uses emacs_file_open tool
Claude: Show me my TODO items
> Uses emacs_org_todo_list tool
Claude: Add a TODO heading "Review PRD" to notes.org
> Uses emacs_org_heading_add tool
Claude: What's on my agenda this week?
> Uses emacs_org_agenda tool
Claude: Export my notes.org to PDF
> Uses emacs_org_export tool
Claude: What's my git status?
> Uses emacs_git_status tool
Claude: Show me the recent commits
> Uses emacs_git_log tool
Claude: Stage all changes and commit
> Uses emacs_git_stage and emacs_git_commit tools
Claude: What branch am I on?
> Uses emacs_git_branch_current tool
Claude: Compare file.ts with file.ts.bak
> Uses emacs_ediff_files tool
Claude: Show me the differences between these two buffers
> Uses emacs_ediff_buffers tool
Claude: Do a three-way merge comparison
> Uses emacs_ediff_3way toolDevelopment
# Watch mode
npm run dev
# Run tests
npm test
# Lint
npm run lintRoadmap
See PRD.md for full roadmap:
Phase 1: Core Infrastructure (MVP)
Phase 2: File & Project Operations
Phase 3: Org-mode Integration
Phase 4: Git/Magit Integration
Phase 5: Ediff & Advanced Features
License
MIT
Available Tools
55 toolsemacs_buffer_createC
Create a new buffer
Inputs: name (required), mode, content.
emacs_buffer_editC
Apply targeted edits to a buffer (find and replace)
Inputs: buffer (required), new_text (required), old_text (required), save.
emacs_buffer_killC
Close/kill a buffer
Inputs: buffer (required), force.
emacs_buffer_listA
List all open buffers with metadata
Inputs: include_hidden.
emacs_buffer_readC
Read the contents of an Emacs buffer
Inputs: buffer (required).
emacs_buffer_switchA
Switch to a specific buffer (make it current)
Inputs: buffer (required).
emacs_buffer_writeC
Write/replace content in an Emacs buffer
Inputs: buffer (required), content (required), save.
emacs_diff_summaryB
Get a summary of differences between two files or buffers
Inputs: source (required), target (required), type.
emacs_ediff_3wayA
Three-way comparison of files (useful for merge conflicts)
Inputs: file_a (required), file_b (required), file_ancestor (required), format.
emacs_ediff_buffersC
Compare two buffers and return the diff
Inputs: buffer_a (required), buffer_b (required), format, context_lines.
emacs_ediff_filesB
Compare two files and return the diff
Inputs: file_a (required), file_b (required), format, context_lines.
emacs_ediff_regionsB
Compare two text regions and return the diff
Inputs: text_a (required), text_b (required), format, label_a, +2 more.
emacs_evalB
Execute Emacs Lisp code and return the result
Inputs: code (required), timeout.
emacs_file_infoA
Get information about a file (exists, readable, writable, size, etc.)
Inputs: path (required).
emacs_file_openC
Open a file in Emacs
Inputs: path (required), line, column.
emacs_file_saveB
Save the current or specified buffer to file
Inputs: buffer.
emacs_file_save_asB
Save buffer to a new file path
Inputs: path (required), buffer (required).
emacs_git_blameC
Show git blame for a file
Inputs: file (required), end_line, start_line.
emacs_git_branch_checkoutC
Checkout a branch
Inputs: branch (required), create.
emacs_git_branch_currentB
Get current branch name
Inputs: no named parameters.
emacs_git_branch_listC
List git branches
Inputs: all.
emacs_git_commitC
Create a git commit with a message
Inputs: message (required), amend.
emacs_git_diffA
Get diff for staged, unstaged, or committed changes
Inputs: type (required), file, commit.
emacs_git_logC
Get commit log
Inputs: file, count, branch, format.
emacs_git_stageB
Stage file(s) for commit
Inputs: files.
emacs_git_stash_listA
List git stashes
Inputs: no named parameters.
emacs_git_stash_popB
Pop the latest stash
Inputs: index.
emacs_git_stash_pushB
Create a new stash
Inputs: message, include_untracked.
emacs_git_statusA
Get git status (staged, unstaged, untracked files)
Inputs: repo_path.
emacs_git_unstageB
Unstage file(s)
Inputs: files.
emacs_org_agendaC
Query org-agenda items
Inputs: span, filter.
emacs_org_captureC
Create a new org entry using capture templates
Inputs: template (required), title, content.
emacs_org_exportC
Export org document to various formats
Inputs: buffer (required), format (required), async, output_path.
emacs_org_heading_addB
Add a new heading to an org document
Inputs: level (required), title (required), buffer (required), tags, +3 more.
emacs_org_heading_deleteB
Delete a heading and its subtree
Inputs: buffer (required), heading (required).
emacs_org_heading_moveC
Move a heading up, down, or change its level
Inputs: buffer (required), heading (required), direction (required).
emacs_org_heading_updateC
Update an existing heading (title, content, or properties)
Inputs: buffer (required), heading (required), new_title, new_content, +1 more.
emacs_org_property_setC
Set a property for a heading
Inputs: value (required), buffer (required), heading (required), property (required).
emacs_org_readB
Read org document content with optional parsed structure
Inputs: buffer (required), format.
emacs_org_searchC
Search org files for text or headings
Inputs: query (required), type, files.
emacs_org_tag_setB
Set tags for a heading
Inputs: tags (required), buffer (required), heading (required).
emacs_org_todo_listB
List all TODO items in a buffer or across org files
Inputs: state, buffer.
emacs_org_todo_setB
Set TODO state for a heading
Inputs: state (required), buffer (required), heading (required).
emacs_org_writeC
Write/replace content in an org buffer
Inputs: buffer (required), content (required), save.
emacs_project_currentA
Get the current project root and name
Inputs: no named parameters.
emacs_project_filesB
List files in the current or specified project
Inputs: path, limit.
emacs_project_listA
List known projects (supports both project.el and projectile)
Inputs: no named parameters.
emacs_project_searchA
Search for files in the project by name pattern
Inputs: pattern (required), path.
emacs_project_switchC
Switch to a different project
Inputs: path (required).
emacs_workspace_createC
Create a new workspace/tab
Inputs: name (required).
emacs_workspace_currentA
Get the current workspace/tab name
Inputs: no named parameters.
emacs_workspace_deleteB
Delete a workspace/tab
Inputs: name (required).
emacs_workspace_listA
List all workspaces/tabs
Inputs: no named parameters.
emacs_workspace_saveC
Save workspace state
Inputs: no named parameters.
emacs_workspace_switchB
Switch to a workspace/tab by name or index
Inputs: name, index.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 55 tools
Tools are mostly clearly separated by domain (buffer, file, project, workspace, org, git, ediff) and action, so an agent can generally tell them apart. However, a few near-overlaps exist, such as emacs_ediff_files/emacs_diff_summary both comparing files, and emacs_buffer_write vs emacs_buffer_edit with only subtle differences.
All 55 tools follow the exact same emacs_<domain>_<verb> snake_case pattern with no mixed conventions. Verb choices are semantically consistent within each domain (list, create, delete, switch, etc.), making the naming highly predictable.
With 55 tools, this dramatically exceeds the 25+ threshold for 'too many'. Even though Emacs is a broad application, this number creates heavy selection overhead and will likely overwhelm agents trying to choose among such a large surface area.
The set provides thorough lifecycle coverage for buffers, files, projects, workspaces, org documents, git operations, and diff comparisons. Each domain has create/read/update/delete or equivalent operations with no obvious dead ends for the implied scope of controlling Emacs.
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Zotero MCP server for Claude and ChatGPT: search, citations, safe writes, PDF passages and pages.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server that integrates with VS Code to enable file operations, git diffs, and line highlighting via MCP clients like Claude.43MIT
- AlicenseAqualityDmaintenanceAn MCP server that lets host-side Claude Cowork dispatch work into Claude Code running inside your devcontainer over stdio.1691 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to control a running Emacs instance via MCP, supporting file opening, Magit integration, and server status checks.4MIT
- FlicenseAqualityBmaintenanceAn MCP server that enables Claude to manage Emacs org-mode task lists, journal entries, and projects with token-efficient tools and visual approval via Emacs ediff.193-