Aider MCP Server
STDIOMCP server that connects Claude and other clients to Aider for file editing.
MCP server that connects Claude and other clients to Aider for file editing.
A Model Context Protocol (MCP) server that allows Claude and other MCP clients to connect to Aider for efficient file editing capabilities.
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:
pip install aider-chat
)You can install the Aider MCP server in several ways:
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
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.
# 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
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 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
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
Pass custom Aider options when editing files through the MCP tools.
Once connected to Claude, you can use prompts like:
The MCP server provides these directory-based tools:
edit_files
: Make targeted code changes in a specified directory
--yes-always
)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
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:
For local development:
git clone https://github.com/yourusername/aider-mcp-server.git cd aider-mcp-server pip install -e .
Unlicense