emacsclient-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., "@emacsclient-mcpinsert "Hello, world!" at point"
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.
emacsclient-mcp
Emacs MCP server + Pi extension — 22 Emacs tools for LLM-assisted editing, search, buffer management, and PR review.
What is this?
A Model Context Protocol (MCP) server that gives LLMs direct access to Emacs — no emacsclient binary needed. It communicates via Unix socket using the Emacs server protocol, implementing &-quoting as defined in emacsclient.c and server.el.
Comes with:
Rust MCP binary — 22 tools over JSON-RPC stdio
Pi extension — auto-spawns the binary, registers all tools
PR review agent — 4-phase workflow (Setup → Analysis → Issues → Report)
Related MCP server: MCP Local LLM Server
Quick Start
1. Install
# Option A: Pi package (recommended — gets extension + agent)
pi install npm:@bimawa/emacsclient-mcp
# Option B: Rust binary only (for other MCP clients)
cargo install emacsclient-mcp
# Option C: Homebrew (macOS)
brew install bimawa/tap/emacsclient-mcp2. Start Emacs server
M-x server-start
;; or:
emacs --daemon3. Reload Pi
/reloadPi picks up the extension, spawns the binary, discovers 22 Emacs tools, and registers the emacs-pr-review agent.
Tools
Category | Tools |
Eval |
|
Buffers |
|
Navigation |
|
Search |
|
Editing |
|
Windows |
|
PR Review Agent
Activate with /agent emacs-pr-review in Pi. The agent:
Setup — gets the diff, opens review buffer in
org-mode, splits Emacs windowsAnalysis — reads each changed file, applies review heuristics (R1–R4)
Findings — documents issues by severity: BLOCKER / CRITICAL / WARNING / SUGGESTION
Report — shows summary in Emacs, offers inline comments
Protocol
Implements the exact Emacs server protocol from server.el:
Client sends first (no server greeting)
Single-line commands:
-auth KEY -eval EXPR\n&-quoting: spaces →&_, newlines →&n, leading-→&-,&→&&Response:
-emacs-pid PID\n-print RESULT\n
Binary Resolution
The extension finds the binary in this order:
EMACS_MCP_BINARYenvironment variablePre-built binary alongside the extension (package distro)
~/.cargo/bin/emacsclient-mcp(cargo install)which emacsclient-mcp(PATH / Homebrew)cargo run --release(dev mode)
Development
# Build the Rust binary
cargo build --release
# Run locally with Pi
pi -e ./extension/index.ts
# Test the MCP binary directly
echo '{"jsonrpc":"2.0","id":1,"method":"initialize",...}' | ./target/release/emacsclient-mcpLicense
MIT © bimawa
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/bimawa/emacsclient-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server