home / mcp / aider mcp server

Aider MCP Server

Provides a local MCP server that connects Claude and other clients to Aider for editing files, creating content, extracting code blocks, and git status.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "sengokudaikon-aider-mcp-server": {
      "command": "uvx",
      "args": [
        "aider-mcp"
      ],
      "env": {
        "REPO_PATH": "REPO_PATH placeholder",
        "AIDER_PATH": "YOUR_AIDER_PATH",
        "AIDER_ENV_FILE": "/home/user/.env",
        "OPENAI_API_KEY": "sk-...",
        "AIDER_CONFIG_FILE": "/home/user/.aider.conf.yml",
        "AIDER_MCP_VERBOSE": "true",
        "ANTHROPIC_API_KEY": "sk-..."
      }
    }
  }
}

You run an MCP server that lets Claude and other clients connect to Aider for efficient file editing, new file creation, code extraction from markdown, and quick access to git status. It provides a stable bridge between your editor-focused workflows and Aider’s editing capabilities, so you can automate common file edits from your MCP-enabled tools.

How to use

Start the MCP server to enable connections from your MCP clients. Run the server in stdio mode so clients like Claude Desktop or Cursor IDE can communicate directly with Aider.

Choose how you want to run the server. The recommended approach is to start it through the runtime launcher, which exposes the MCP endpoint to your client tools.

How to install

Prerequisites: ensure you have Python 3.8 or higher installed on your system.

Install the MCP server package and run the server in one of the supported ways.

Using UV (recommended) components, run the server directly with uvx to avoid a separate installation step.

# 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

Alternatively, install via Python’s package manager and run the server from the installed package.

pip install aider-mcp

aider-mcp

You can optionally customize the run with repository paths, custom Aider paths, or environment variables as needed.

uvx aider-mcp
uvx aider-mcp --repo-path=/path/to/your/repo
uvx aider-mcp --aider-path=/path/to/aider
REPO_PATH=/path/to/your/repo uvx aider-mcp

Configuration and environment variables

The server supports a range of environment variables to tailor its behavior and to pass your Aider and API keys.

Common variables include:

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
ANTHROPIC_API_KEY: Your Anthropic API key

Claude Desktop and Cursor IDE configuration

Connect Claude Desktop by configuring an MCP server entry that runs the runtime launcher with the appropriate repo path.

For Cursor IDE, add a new MCP server using the command runner with the repo path configured.

Aider configuration support

You can leverage Aider’s configuration system to customize behavior through .aider.conf.yml files and .env files located in your home directory, the repository root, or the current directory.

Environment variables and custom options can be loaded from these locations to influence how edits are performed.

Usage examples with prompts

Prompt examples you can use after you connect:

  • Edit my app.py to add error handling in the main function
  • Create a new file utils.py with date formatting helpers
  • Show me the current git status of the repository
  • Extract Python code blocks from this explanation and save to a file

Available actions you can perform with MCP tools

This MCP server exposes a set of directory-based tools to edit files, create new files, inspect git status, extract code blocks, check Aider installation, and view configuration details.

Available tools

edit_files

Make targeted code changes in a specified directory by providing detailed instructions. This tool automatically accepts changes with a yes-always flow.

create_files

Create new files with content in a specified directory. You can add multiple files and optionally commit them to git.

git_status

Retrieve the git status of a given repository directory to see modified, added, deleted, and untracked files.

extract_code

Extract code blocks from markdown or text and optionally save them to files while preserving language information.

aider_status

Check Aider installation and environment status, including API keys and configuration presence.

aider_config

Display detailed Aider configuration information and the sources in use.