aider.com
aider.com logo

Aider

Enables file editing, creation, code extraction, and git operations directly within conversations through tools like edi...

Created byApr 22, 2025

Aider MCP Server

A Model Context Protocol (MCP) server that allows Claude and other MCP clients to connect to Aider for efficient file editing capabilities.

Overview

This MCP server bridges the gap between AI assistants like Claude and Aider's powerful file editing capabilities. It provides a standardized interface through the Model Context Protocol, allowing Claude to:
  • Edit existing files using Aider's capabilities
  • Create new files with content
  • Extract code blocks from markdown text
  • Get git status information
  • Check Aider installation status
  • Access and use Aider's configuration system

Prerequisites

  • Python 3.8 or higher
  • Aider installed (pip install aider-chat)
  • An API key for OpenAI or Anthropic (depending on which model you want Aider to use)
  • Git repository for file editing

Installation

You can install the Aider MCP server in several ways:

Using UV (Recommended)

If you have uv installed:

Using PIP

Usage

The Aider MCP server runs in MCP protocol mode over stdio by default, which is designed for direct integration with MCP clients like Claude Desktop and Cursor IDE.

Command Line Options

You can customize the server with these environment variables or command-line arguments:
  • --aider-path: Path to the Aider executable (default: "aider", automatically searches PATH)
  • --repo-path: Path to the git repository (default: current directory)
  • --config-file: Path to a custom Aider config file
  • --env-file: Path to a custom .env file
  • --verbose, -v: Enable verbose output

Client Configuration

Claude Desktop

Add this to your Claude Desktop configuration file:

Cursor IDE

To integrate with Cursor IDE:
  1. Open Cursor Settings
  1. Navigate to Features > MCP Servers
  1. Click Add new MCP server
  1. Enter this configuration:
  1. After configuring, ensure you're in Agent mode in the Composer to use MCP tools

Aider Configuration Support

This MCP server supports Aider's configuration system, allowing you to:
  1. Use configuration from .aider.conf.yml files in:
  1. Use environment variables from .env files in:
  1. Pass custom Aider options when editing files through the MCP tools.

Example Prompts for Claude

Once connected to Claude, you can use prompts like:
  • "Edit my app.py file to add error handling to the main function"
  • "Create a new file called utils.py with helper functions for date formatting"
  • "Show me the current git status of the repository"
  • "Extract the Python code from this explanation and save it to a file"

Available Tools

The MCP server provides these directory-based tools:
  • edit_files: Make targeted code changes in a specified directory
  • create_files: Create new files with content in a specified directory
  • git_status: Get git status of a specified directory's repository
  • extract_code: Extract code blocks from markdown or text
  • aider_status: Check Aider installation and environment status
  • aider_config: Get detailed Aider configuration information

Environment Variables

The server uses environment variables which can be set directly or through .env files:
  • AIDER_PATH: Path to the Aider executable
  • REPO_PATH: Path to the git repository
  • AIDER_CONFIG_FILE: Path to a custom Aider config file
  • AIDER_ENV_FILE: Path to a custom .env file
  • AIDER_MCP_VERBOSE: Enable verbose logging
  • OPENAI_API_KEY: Your OpenAI API key (if using GPT-4 with Aider)
  • ANTHROPIC_API_KEY: Your Anthropic API key (if using Claude with Aider)

Debugging

You can use the MCP inspector to debug the server:
The inspector provides an interactive UI to:
  1. View available tools and their schemas
  1. Call tools with test parameters
  1. See the responses and debug issues

Development

For local development:

License

Unlicense

Aider MCP Server

A Model Context Protocol (MCP) server that allows Claude and other MCP clients to connect to Aider for efficient file editing capabilities.

Overview

This MCP server bridges the gap between AI assistants like Claude and Aider's powerful file editing capabilities. It provides a standardized interface through the Model Context Protocol, allowing Claude to:
  • Edit existing files using Aider's capabilities
  • Create new files with content
  • Extract code blocks from markdown text
  • Get git status information
  • Check Aider installation status
  • Access and use Aider's configuration system

Prerequisites

  • Python 3.8 or higher
  • Aider installed (pip install aider-chat)
  • An API key for OpenAI or Anthropic (depending on which model you want Aider to use)
  • Git repository for file editing

Installation

You can install the Aider MCP server in several ways:

Using UV (Recommended)

If you have uv installed:

Using PIP

Usage

The Aider MCP server runs in MCP protocol mode over stdio by default, which is designed for direct integration with MCP clients like Claude Desktop and Cursor IDE.

Command Line Options

You can customize the server with these environment variables or command-line arguments:
  • --aider-path: Path to the Aider executable (default: "aider", automatically searches PATH)
  • --repo-path: Path to the git repository (default: current directory)
  • --config-file: Path to a custom Aider config file
  • --env-file: Path to a custom .env file
  • --verbose, -v: Enable verbose output

Client Configuration

Claude Desktop

Add this to your Claude Desktop configuration file:

Cursor IDE

To integrate with Cursor IDE:
  1. Open Cursor Settings
  1. Navigate to Features > MCP Servers
  1. Click Add new MCP server
  1. Enter this configuration:
  1. After configuring, ensure you're in Agent mode in the Composer to use MCP tools

Aider Configuration Support

This MCP server supports Aider's configuration system, allowing you to:
  1. Use configuration from .aider.conf.yml files in:
  1. Use environment variables from .env files in:
  1. Pass custom Aider options when editing files through the MCP tools.

Example Prompts for Claude

Once connected to Claude, you can use prompts like:
  • "Edit my app.py file to add error handling to the main function"
  • "Create a new file called utils.py with helper functions for date formatting"
  • "Show me the current git status of the repository"
  • "Extract the Python code from this explanation and save it to a file"

Available Tools

The MCP server provides these directory-based tools:
  • edit_files: Make targeted code changes in a specified directory
  • create_files: Create new files with content in a specified directory
  • git_status: Get git status of a specified directory's repository
  • extract_code: Extract code blocks from markdown or text
  • aider_status: Check Aider installation and environment status
  • aider_config: Get detailed Aider configuration information

Environment Variables

The server uses environment variables which can be set directly or through .env files:
  • AIDER_PATH: Path to the Aider executable
  • REPO_PATH: Path to the git repository
  • AIDER_CONFIG_FILE: Path to a custom Aider config file
  • AIDER_ENV_FILE: Path to a custom .env file
  • AIDER_MCP_VERBOSE: Enable verbose logging
  • OPENAI_API_KEY: Your OpenAI API key (if using GPT-4 with Aider)
  • ANTHROPIC_API_KEY: Your Anthropic API key (if using Claude with Aider)

Debugging

You can use the MCP inspector to debug the server:
The inspector provides an interactive UI to:
  1. View available tools and their schemas
  1. Call tools with test parameters
  1. See the responses and debug issues

Development

For local development:

License

Unlicense