Aider MCP server

Enables file editing, creation, code extraction, and git operations directly within conversations through tools like edit_files, create_files, and git_status.
Back to servers
Setup instructions
Provider
Hirofumi Tanigami
Release date
Mar 18, 2025
Language
Python
Stats
34 stars

This MCP server connects AI assistants like Claude to Aider's file editing capabilities through the Model Context Protocol, enabling efficient file editing, creation, and code management directly from your AI interactions.

Installation

Using UV (Recommended)

If you have uv installed:

# Install uv if you don't have it
curl -fsSL https://astral.sh/uv/install.sh | bash

# Run directly with uvx (no installation required)
uvx aider-mcp

Using PIP

# Install the package
pip install aider-mcp

# Run the server
aider-mcp

Prerequisites

Before installing, ensure you have:

  • 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

Usage

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

# Run directly with uvx (recommended)
uvx aider-mcp

# With repository path specified
uvx aider-mcp --repo-path=/path/to/your/repo

# With custom Aider executable path
uvx aider-mcp --aider-path=/path/to/aider

# With environment variables
REPO_PATH=/path/to/your/repo uvx aider-mcp

Command Line Options

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:

{
  "mcpServers": {
    "aider-mcp": {
      "command": "uvx",
      "args": [
        "aider-mcp",
        "--repo-path", "/path/to/your/repo"
      ]
    }
  }
}

Cursor IDE

To integrate with Cursor IDE:

  1. Open Cursor Settings
  2. Navigate to Features > MCP Servers
  3. Click Add new MCP server
  4. Enter this configuration:
    name: aider-mcp
    type: command
    command: uvx aider-mcp --repo-path=/path/to/your/repo
    
  5. After configuring, ensure you're in Agent mode in the Composer to use MCP tools

Using with 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

Edit Files

Make targeted code changes in a specified directory

  • Requires a directory path and detailed instructions
  • Automatically accepts all proposed changes (uses --yes-always)
  • Additional Aider options can be specified when needed

Create Files

Create new files with content in a specified directory

  • You can provide multiple files to create at once
  • Optionally commit the new files to git

Git Status

Get git status of a specified directory's repository

  • Quick way to check for modified, added, deleted, and untracked files

Extract Code

Extract code blocks from markdown or text

  • Can optionally save extracted code blocks to files in a specified directory
  • Preserves language information from code block markers

Aider Status

Check Aider installation and environment status

  • Verifies Aider is correctly installed and accessible
  • Can check specific directories for configuration
  • Reports on API keys and environment variables

Aider Config

Get detailed Aider configuration information

  • Shows which configuration files are being used
  • Displays settings from all layers of configuration
  • Reports available environment variables

Configuration Support

This MCP server supports Aider's configuration system, allowing you to:

  1. Use configuration from .aider.conf.yml files in:

    • Your home directory
    • The git repository root
    • The current directory
    • A custom path specified with --config-file
  2. Use environment variables from .env files in:

    • Your home directory
    • The git repository root
    • The current directory
    • A custom path specified with --env-file

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:

# Test with MCP inspector
npx @modelcontextprotocol/inspector uvx aider-mcp

# Test with specific repository path
npx @modelcontextprotocol/inspector uvx aider-mcp --repo-path=/path/to/your/repo

# If running from Python package
npx @modelcontextprotocol/inspector python -m aider_mcp

The inspector provides an interactive UI to:

  • View available tools and their schemas
  • Call tools with test parameters
  • See the responses and debug issues

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "aider-mcp" '{"command":"uvx","args":["aider-mcp","--repo-path","/path/to/your/repo"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "aider-mcp": {
            "command": "uvx",
            "args": [
                "aider-mcp",
                "--repo-path",
                "/path/to/your/repo"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "aider-mcp": {
            "command": "uvx",
            "args": [
                "aider-mcp",
                "--repo-path",
                "/path/to/your/repo"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later