Skip to content

gbastkowski/mcp-emacs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP Emacs

Model Context Protocol (MCP) server for Emacs integration. Provides tools to interact with Emacs from Claude Desktop/Code.

Features

Tools

  • 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)

Resources

  • org-tasks://all: All TODO items from org-mode agenda files with status, priority, scheduled/deadline dates

Prerequisites

  • Node.js 20+
  • Emacs with server mode running (M-x server-start or in your init file)
  • emacsclient available in PATH

Installation

npm install
npm run build

Usage with Claude Desktop

Add 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"]
    }
  }
}

Usage with Claude Code

Add to your Claude Code MCP settings:

{
  "emacs": {
    "command": "node",
    "args": ["/path/to/mcp-emacs/dist/index.js"]
  }
}

Development

# Build
npm run build

# Watch mode
npm run watch

Architecture

  • TypeScript/Node.js: MCP server implementation
  • emacsclient: Communication with Emacs via --eval
  • STDIO transport: Standard MCP communication protocol

Requirements

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published