claude-code-emacs
by yuya373·★ 63·Score 46
Emacs package providing MCP integration for Claude Code, enabling AI-powered coding sessions with buffer and LSP operations.
Overview
Claude Code Emacs provides seamless integration between Emacs and Claude Code through the Model Context Protocol. It enables AI-powered coding sessions directly within Emacs with project isolation, smart file completion, and custom commands. The package offers deep integration with Emacs features including buffer operations, LSP diagnostics, and Git workflows, creating a powerful coding assistant environment. Its modular design ensures efficient real-time communication between Emacs and Claude Code through WebSocket connections.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this if you're an Emacs user who wants to integrate Claude Code directly into your editing environment without switching contexts.
When NOT to choose this
Not ideal if you don't use Emacs or prefer a more generalized IDE with AI capabilities, as this solution is tightly coupled with Emacs.
Tools this server exposes
12 tools extracted from the READMElist_buffersList open buffers in Emacs
read_bufferRead contents of an Emacs buffer
get_selected_textGet currently selected text in Emacs
get_diagnosticsGet LSP diagnostics for current buffer
find_definitionFind definition of symbol using LSP
find_referencesFind references to symbol using LSP
describe_symbolGet documentation for symbol using LSP
diff_filesCompare two files showing differences
view_git_changesView git changes for current file
apply_patchApply patch to file
commitCreate git commit
pushPush changes to remote git repository
Note: Tool names inferred from MCP integration section and key features, as README doesn't provide explicit MCP tool documentation
Comparable tools
Installation
# Install MCP server globally
npm install -g claude-code-mcp-server
# Configure Claude Code to use MCP
claude mcp add-json emacs '{
"type": "stdio",
"command": "claude-code-mcp"
}'
# Add to Emacs init.el
(add-to-list 'load-path "/path/to/claude-code")
(require 'claude-code)
(global-set-key (kbd "C-c c") 'claude-code-transient)FAQ
- What Emacs versions are required?
- Emacs 28.1 or later is required. Additional packages like projectile, vterm, transient, and markdown-mode are needed. LSP-mode (9.0.0+) is optional but recommended for full functionality.
- How does the MCP server communicate with Emacs?
- The server uses stdio communication with Claude Code and maintains a separate WebSocket connection for each project. This enables real-time event batching and automatic reconnection with health monitoring.
Compare claude-code-emacs with
Last updated · Auto-generated from public README + GitHub signals.