Emacs AI Code Interface
Unified Emacs interface supporting OpenAI Codex, GitHub Copilot CLI, Claude Code, Gemini CLI, Opencode, and more
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
Maintainer
Works with
Installation
Manual Installation
npx ai-code-interface-elConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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)
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)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"))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))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 loginStart 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.
Emacs AI Code Interface Alternatives — Similar Developer Tools Servers
Looking for alternatives to Emacs AI Code Interface? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up Emacs AI Code Interface in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.