Emacs AI Code Interface

v1.0.0Developer Toolsstable

Unified Emacs interface supporting OpenAI Codex, GitHub Copilot CLI, Claude Code, Gemini CLI, Opencode, and more

agile-developmentai-coding-assistantaiderantigravity-cliclaude-code
Share:
226
Stars
0
Downloads
0
Weekly
0/5

What is Emacs AI Code Interface?

Emacs AI Code Interface is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to unified emacs interface supporting openai codex, github copilot cli, claude code, gemini cli, opencode, and more

Unified Emacs interface supporting OpenAI Codex, GitHub Copilot CLI, Claude Code, Gemini CLI, Opencode, and more

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Unified Emacs interface supporting OpenAI Codex, GitHub Copi

Use Cases

Integrate multiple AI coding assistants in Emacs editor.
Support Copilot, Claude Code, Gemini, and more.
Accelerate Emacs-based development workflows.
tninja

Maintainer

LicenseApache-2.0
Languageemacs lisp
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx ai-code-interface-el

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Emacs AI Code Interface

ai-code-interface.el is an Emacs package that provides a unified interface for driving over a dozen AI coding CLI tools — including Claude Code, OpenAI Codex, GitHub Copilot CLI, Gemini CLI, Aider, Cursor CLI, and Opencode — all from within Emacs using consistent keybindings and a shared interaction model. Instead of switching between different terminal tools and memorizing their individual CLI syntax, you configure your preferred backend once and use a small set of commands (change code, implement TODOs, ask questions, explain code) that work identically across all supported AI tools. It also supports MCP integration with built-in Emacs tools, TDD cycle automation, PR review workflows, and speech-to-text input.

Prerequisites

  • Emacs 28+ with MELPA package repository configured
  • At least one supported AI CLI installed and authenticated (e.g., Claude Code via npm install -g @anthropic-ai/claude-code, or Gemini CLI)
  • A terminal backend: vterm, eat, or ghostel Emacs package installed
  • API credentials managed by each individual CLI tool (no shared key — each backend handles its own auth)
1

Add MELPA to your Emacs package sources

Ensure MELPA is configured in your Emacs init file so you can install the ai-code package.

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
2

Install the ai-code package

Install via MELPA interactively, or declare it in your init file using use-package or straight.

;; Interactive:
M-x package-install ai-code

;; Or with straight:
(use-package ai-code
  :straight (:host github :repo "tninja/ai-code-interface.el"))
3

Configure your preferred AI backend

Set your default backend and bind the menu to a convenient key. The backend must be installed and authenticated separately according to its own setup (e.g., claude login for Claude Code).

(use-package ai-code
  :config
  (ai-code-set-backend 'claude-code)  ; or 'codex, 'copilot, 'gemini, etc.
  (global-set-key (kbd "C-c a") #'ai-code-menu))
4

Authenticate your chosen AI backend

Each AI tool manages its own credentials. Authenticate before using it inside Emacs.

# Claude Code:
claude login

# OpenAI Codex:
codex login

# Gemini CLI:
gemini auth login
5

Start using the unified interface

Open a code file in Emacs, press C-c a a to start an AI CLI session, then use C-c a c to request code changes, C-c a q to ask questions, or C-c a x to get code explanations.

Emacs AI Code Interface Examples

Client configuration

Emacs use-package configuration for ai-code-interface.el with Claude Code as the default backend and common customizations.

(use-package ai-code
  :straight (:host github :repo "tninja/ai-code-interface.el")
  :config
  (ai-code-set-backend 'claude-code)
  (global-set-key (kbd "C-c a") #'ai-code-menu)
  (setq ai-code-auto-test-type 'ask-me)
  (setq ai-code-discussion-auto-follow-up-enabled t)
  (setq ai-code-backends-infra-terminal-backend 'vterm))

Prompts to try

Example tasks and Emacs commands using the ai-code unified interface.

- Press C-c a a to start an AI session, then type: "Refactor this function to use async/await."
- Select a region and press C-c a c, then: "Extract this block into a separate helper function with a docstring."
- Press C-c a i to implement TODOs in the current file automatically.
- Press C-c a x to ask Claude to explain the selected code in plain English.
- Press C-c a q to ask: "What design pattern is being used in this module?"

Troubleshooting Emacs AI Code Interface

ai-code-menu does nothing or the terminal does not open

Ensure you have a terminal backend installed: run M-x package-install vterm (or eat) and set (setq ai-code-backends-infra-terminal-backend 'vterm) in your config. Without a terminal backend, the AI CLI cannot be launched inside Emacs.

Selected backend reports 'command not found'

The AI CLI for your chosen backend must be installed and on your PATH before Emacs starts. Install it (e.g., npm install -g @anthropic-ai/claude-code for Claude Code) and verify with which claude in a terminal. Restart Emacs after installation.

Code change command sends context but AI does not modify the file

The C-c a c command sends the current function or selected region as context. Ensure you have an active AI session started with C-c a a first. Also confirm that your backend supports interactive file editing (Claude Code and Aider both do; some read-only query backends do not).

Frequently Asked Questions about Emacs AI Code Interface

What is Emacs AI Code Interface?

Emacs AI Code Interface is a Model Context Protocol (MCP) server that unified emacs interface supporting openai codex, github copilot cli, claude code, gemini cli, opencode, and more It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Emacs AI Code Interface?

Follow the installation instructions on the Emacs AI Code Interface GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Emacs AI Code Interface?

Emacs AI Code Interface works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Emacs AI Code Interface free to use?

Yes, Emacs AI Code Interface is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "ai-code-interface-el": { "command": "npx", "args": ["-y", "ai-code-interface-el"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Emacs AI Code Interface?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides