Aider MCP Server

Aider MCP Server

site icon
2025.03.14 22
Python文件管理代码编辑开发效率
Aider MCP Server 是一个基于 Model Context Protocol (MCP) 的服务,旨在连接 Claude 等 MCP 客户端与 Aider,提供高效的文件编辑能力。它通过标准化的 MCP 接口,使 AI 助手能够编辑现有文件、创建新文件、从 Markdown 文本中提取代码块、获取 git 状态信息、检查 Aider 安装状态以及访问和使用 Aider 的配置系统。
View on GitHub

Overview

基本能力

产品定位

Aider MCP Server 是一个桥梁服务,连接 AI 助手(如 Claude)与 Aider 的文件编辑功能,提供标准化的接口。

核心功能

  • 编辑现有文件
  • 创建新文件
  • 从 Markdown 文本中提取代码块
  • 获取 git 状态信息
  • 检查 Aider 安装状态
  • 访问和使用 Aider 的配置系统

适用场景

  • AI 助手辅助编程
  • 代码编辑和文件管理
  • 代码块提取和保存
  • 项目状态检查

工具列表

  • edit_files: 在指定目录中进行代码更改
  • create_files: 在指定目录中创建新文件
  • git_status: 获取指定目录的 git 状态
  • extract_code: 从 Markdown 或文本中提取代码块
  • aider_status: 检查 Aider 安装和环境状态
  • aider_config: 获取详细的 Aider 配置信息

常见问题解答

  • 如何调试?可以使用 MCP inspector 进行调试。
  • 如何指定 Aider 可执行文件路径?使用 --aider-path 参数。
  • 如何指定 git 仓库路径?使用 --repo-path 参数。

使用教程

使用依赖

  • Python 3.8 或更高版本
  • Aider 安装 (pip install aider-chat)
  • OpenAI 或 Anthropic 的 API 密钥
  • Git 仓库

安装教程

使用 UV (推荐)

# 安装 uv
curl -fsSL https://astral.sh/uv/install.sh | bash

# 直接运行
uvx aider-mcp

使用 PIP

# 安装包
pip install aider-mcp

# 运行服务器
aider-mcp

调试方式

# 使用 MCP inspector 测试
npx @modelcontextprotocol/inspector uvx aider-mcp

# 使用特定仓库路径测试
npx @modelcontextprotocol/inspector uvx aider-mcp --repo-path=/path/to/your/repo

# 从 Python 包运行
npx @modelcontextprotocol/inspector python -m aider_mcp

许可证

该项目遵循 Unlicense 开源许可条款,请参阅 Unlicense 了解完整条款。