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.
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
# Install the package
pip install aider-mcp
# Run the server
aider-mcp
Before installing, ensure you have:
pip install aider-chat
)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
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 outputAdd this to your Claude Desktop configuration file:
{
"mcpServers": {
"aider-mcp": {
"command": "uvx",
"args": [
"aider-mcp",
"--repo-path", "/path/to/your/repo"
]
}
}
}
To integrate with Cursor IDE:
Features
> MCP Servers
Add new MCP server
name: aider-mcp
type: command
command: uvx aider-mcp --repo-path=/path/to/your/repo
Once connected to Claude, you can use prompts like:
Make targeted code changes in a specified directory
--yes-always
)Create new files with content in a specified directory
Get git status of a specified directory's repository
Extract code blocks from markdown or text
Check Aider installation and environment status
Get detailed Aider configuration information
This MCP server supports Aider's configuration system, allowing you to:
Use configuration from .aider.conf.yml
files in:
--config-file
Use environment variables from .env
files in:
--env-file
The server uses environment variables which can be set directly or through .env
files:
AIDER_PATH
: Path to the Aider executableREPO_PATH
: Path to the git repositoryAIDER_CONFIG_FILE
: Path to a custom Aider config fileAIDER_ENV_FILE
: Path to a custom .env fileAIDER_MCP_VERBOSE
: Enable verbose loggingOPENAI_API_KEY
: Your OpenAI API key (if using GPT-4 with Aider)ANTHROPIC_API_KEY
: Your Anthropic API key (if using Claude with Aider)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:
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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