emacs-mcp
Click on "Install 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-mcpshow 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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mandoo180/emacs-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server