# emacs companion

> Control GNU Emacs buffers, navigate files, and apply edits directly through an MCP Bridge server.

emacs companion is a paid AI agent skill on Agensi by Rolf Marvin Bøe Lindgren, in Workflow Automation. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $5 (one-time purchase)
- Creator: [Rolf Marvin Bøe Lindgren](https://www.agensi.io/creators/rolfmblindgren)
- Category: [Workflow Automation](https://www.agensi.io/skills/workflow-automation)
- Version: 1.0
- Last updated: 2026-10-20
- Security: scan passed (2026-10-19); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/emacs-companion
- Tags: automation, emacs, lisp, mcp, productivity

## About this skill

Context switching between your terminal and Emacs breaks your flow. This skill bridges that gap, allowing an AI agent to interact directly with your running GNU Emacs instance through an MCP connection. It eliminates the manual copy-paste cycle by giving the agent programmatic access to your active buffers and cursor.

### What it does
- **Buffer Inspection** retrieves full buffer content or only the currently selected text for targeted analysis.
- **Precision Editing** inserts text at the cursor, replaces selections, or overwrites entire buffers based on instructions.
- **Navigation Control** opens specific files at defined line numbers or jumps to lines within an active buffer.
- **State Management** lists all open buffers to resolve ambiguity and executes save commands to persist changes to disk.
- **Elisp Execution** runs arbitrary Emacs Lisp expressions if the server owner has enabled the evaluation feature.

### How it works
1. The agent lists active buffers to identify the correct workspace.
2. It pulls the relevant context using scoped read commands to minimize noise.
3. Edits are performed using precise insertion or replacement tools to maintain file integrity.
4. The agent verifies the change by reading back the affected lines and saves the buffer upon request.

### Frameworks & tools
Requires a running GNU Emacs instance, `emacsclient` configured on the local machine, and a compatible MCP Bridge server.

### Why this beats prompting it yourself
Manual prompting requires you to copy code out of Emacs, paste it into a chat, and then manually apply the agent's suggested diffs back into your editor. This skill automates the I/O, ensuring the agent sees exactly what you see and applies changes with line-level precision without user intervention.

### Use cases
- Refactor a specific function selected in your current Emacs window.
- Search across all open Emacs buffers to find a specific variable definition.
- Document a legacy Elisp file by reading the buffer and inserting docstrings.
- Automate repetitive text transformations across multiple open files.

### Known limitations
Requires a pre-installed local MCP Bridge server. It cannot install Emacs or the bridge server for you. Scope is limited to the machine where the server is running.

## Requires

- Python
- Emacs Bridge MCP

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the emacs companion skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What are the technical requirements to use the emacs companion skill?

The emacs companion requires a running GNU Emacs instance with `emacsclient` configured and a compatible MCP Bridge server active on your local machine. Once the bridge is live, the skill allows any MCP-compatible AI agent to communicate directly with your editor.

### How does this skill improve my workflow compared to just pasting code into a chat?

Unlike manual prompting, this skill allows the agent to read and write directly to your active buffers in real-time. This eliminates the need for manual copy-pasting and ensures that the agent always has the exact context of your cursor position and open files.

### Can the AI agent execute custom Emacs Lisp commands?

Yes, if you have enabled the evaluation feature on your MCP Bridge server, the agent can execute arbitrary Elisp expressions. This allows for complex editor tasks like reconfiguring modes or running custom macros programmatically.

### Does the agent have access to my entire file system through this skill?

For security and stability, the agent can only interact with files that are currently open as buffers or specific paths you explicitly grant access to. You retain full control over the session and can see all edits as they happen in your Emacs window.

### What exactly is included in the purchase of this skill?

You will receive the skill definition and integration schema required to connect your AI agent to an MCP Bridge. Please note that the bridge server software and GNU Emacs itself are separate prerequisites and are not included in the skill package.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
