Token导航 LogoToken导航TokenDH.com
Aider MCP Server (Disler) logo
开发工具stdio官方级别未说明来源级核验

Aider MCP Server (Disler)

MCP Server

Aider MCP服务器是一个实验性服务,用于将AI编码任务卸载到Aider开源AI编码助手,以提高开发效率和灵活性。

工具数

0

提示词数

0

GitHub Stars

297

资源数

0
开发工具PythonClaude开源工具Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

disler

提供方

disler

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uv run pytest

详细介绍

MCP服务器助手-实验

模型上下文协议服务器,用于将AI编码工作卸载到Aider,提高开发效率和灵活性。

概述

该服务器允许Claude Code将AI编码任务卸载给Aider,最好的开源AI编码助手。通过将某些编码任务委托给Aider,我们可以降低成本,控制我们的编码模型,并以更协调的方式操作Claude Code来审查和修改代码。

设置

  1. 克隆存储库:
git clone https://github.com/disler/aider-mcp-server.git
  1. 安装依赖项:
uv sync
  1. 创建环境文件:
cp .env.sample .env
  1. 在中配置API密钥 .env 文件(或使用mcpServers的“env”部分)中包含您要在aider中使用的模型所需的api密钥:
GEMINI_API_KEY=your_gemini_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here
...see .env.sample for more
  1. 复制并填写 .mcp.json 进入项目的根目录并更新 --directory 指向此项目的根目录和 --current-working-dir 指向项目的根源。
{
  "mcpServers": {
    "aider-mcp-server": {
      "type": "stdio",
      "command": "uv",
      "args": [
        "--directory",
        "
",
        "run",
        "aider-mcp-server",
        "--editor-model",
        "gpt-4o",
        "--current-working-dir",
        "
"
      ],
      "env": {
        "GEMINI_API_KEY": "",
        "OPENAI_API_KEY": "",
        "ANTHROPIC_API_KEY": "",
        ...see .env.sample for more
      }
    }
  }
}

测试

使用gemini-2.5-pro-exp-03-25进行测试

要运行所有测试,请执行以下操作:

uv run pytest

要运行特定测试,请执行以下操作:

# Test listing models
uv run pytest src/aider_mcp_server/tests/atoms/tools/test_aider_list_models.py

# Test AI coding
uv run pytest src/aider_mcp_server/tests/atoms/tools/test_aider_ai_code.py

注:AI编码测试需要Gemini模型的有效API密钥。确保将其设置在您的 .env 在运行测试之前,请先打开文件。

将此MCP服务器添加到Claude Code

使用添加 gemini-2.5-pro-exp-03-25

claude mcp add aider-mcp-server -s local \
  -- \
  uv --directory "
" \
  run aider-mcp-server \
  --editor-model "gemini/gemini-2.5-pro-exp-03-25" \
  --current-working-dir "
"

使用添加 gemini-2.5-pro-preview-03-25

claude mcp add aider-mcp-server -s local \
  -- \
  uv --directory "
" \
  run aider-mcp-server \
  --editor-model "gemini/gemini-2.5-pro-preview-03-25" \
  --current-working-dir "
"

使用添加 quasar-alpha

claude mcp add aider-mcp-server -s local \
  -- \
  uv --directory "
" \
  run aider-mcp-server \
  --editor-model "openrouter/openrouter/quasar-alpha" \
  --current-working-dir "
"

使用添加 llama4-maverick-instruct-basic

claude mcp add aider-mcp-server -s local \
  -- \
  uv --directory "
" \
  run aider-mcp-server \
  --editor-model "fireworks_ai/accounts/fireworks/models/llama4-maverick-instruct-basic" \
  --current-working-dir "
"

用法

此MCP服务器提供以下功能:

  1. 将AI编码任务卸载到Aider:

- 获取提示和文件路径 - 使用Aider实现请求的更改 - 返回成功或失败

  1. 列出可用型号:

- 提供与子字符串匹配的模型列表 - 有助于发现支持的模型

可用工具

此MCP服务器公开了以下工具:

1. aider_ai_code

此工具允许您运行Aider,根据提供的提示和指定的文件执行AI编码任务。

参数:

  • ai_coding_prompt (string,必填):AI编码任务的自然语言指令。
  • relative_editable_files (字符串列表,必填):文件路径列表(相对于 current_working_dir)允许助手修改。如果文件不存在,它将被创建。
  • relative_readonly_files (字符串列表,可选):文件路径列表(相对于 current_working_dir)Aider可以读取上下文,但不能修改。默认为空列表 [].
  • model (字符串,可选):Aider应使用的主要AI模型来生成代码。默认为 "gemini/gemini-2.5-pro-exp-03-25"。您可以使用 list_models 该工具用于查找其他可用型号。
  • editor_model (字符串,可选):AI模型助手应用于编辑/细化代码,特别是在使用架构师模式时。如果没有提供,主要 model 可能会根据Aider的内部逻辑使用。默认为 None.

示例用法(在MCP请求中):

克劳德代码提示:

Use the Aider AI Code tool to: Refactor the calculate_sum function in calculator.py to handle potential TypeError exceptions.

结果:

{
  "name": "aider_ai_code",
  "parameters": {
    "ai_coding_prompt": "Refactor the calculate_sum function in calculator.py to handle potential TypeError exceptions.",
    "relative_editable_files": ["src/calculator.py"],
    "relative_readonly_files": ["docs/requirements.txt"],
    "model": "openai/gpt-4o"
  }
}

退货:

  • 一句简单的格言:{成功,差异}

- success:boolean-操作是否成功。 - diff:string-对文件所做更改的差异。

2. list_models

此工具列出了Aider支持的与给定子字符串匹配的可用AI模型。

参数:

  • substring (string,必填):在可用模型的名称中搜索的子字符串。

示例用法(在MCP请求中):

克劳德代码提示:

Use the Aider List Models tool to: List models that contain the substring "gemini".

结果:

{
  "name": "list_models",
  "parameters": {
    "substring": "gemini"
  }
}

退货:

  • 与提供的子字符串匹配的模型名称字符串列表。示例: ["gemini/gemini-1.5-flash", "gemini/gemini-1.5-pro", "gemini/gemini-pro"]

建筑

服务器的结构如下:

  • 服务器层:处理MCP协议通信
  • 原子层:独立、纯功能组件

- 工具:特定功能(AI编码、列出模型) - 有用:常量和辅助函数 - 数据类型:使用Pydantic的类型定义

所有组件都经过了彻底的可靠性测试。

代码库结构

该项目分为以下主要目录和文件:

.
├── ai_docs                   # Documentation related to AI models and examples
│   ├── just-prompt-example-mcp-server.xml
│   └── programmable-aider-documentation.md
├── pyproject.toml            # Project metadata and dependencies
├── README.md                 # This file
├── specs                     # Specification documents
│   └── init-aider-mcp-exp.md
├── src                       # Source code directory
│   └── aider_mcp_server      # Main package for the server
│       ├── __init__.py       # Package initializer
│       ├── __main__.py       # Main entry point for the server executable
│       ├── atoms             # Core, reusable components (pure functions)
│       │   ├── __init__.py
│       │   ├── data_types.py # Pydantic models for data structures
│       │   ├── logging.py    # Custom logging setup
│       │   ├── tools         # Individual tool implementations
│       │   │   ├── __init__.py
│       │   │   ├── aider_ai_code.py # Logic for the aider_ai_code tool
│       │   │   └── aider_list_models.py # Logic for the list_models tool
│       │   └── utils.py      # Utility functions and constants (like default models)
│       ├── server.py         # MCP server logic, tool registration, request handling
│       └── tests             # Unit and integration tests
│           ├── __init__.py
│           └── atoms         # Tests for the atoms layer
│               ├── __init__.py
│               ├── test_logging.py # Tests for logging
│               └── tools     # Tests for the tools
│                   ├── __init__.py
│                   ├── test_aider_ai_code.py # Tests for AI coding tool
│                   └── test_aider_list_models.py # Tests for model listing tool
  • src/aider_mcp_server:包含主要应用程序代码。

- atoms:掌握基本构件。这些被设计为具有最小依赖性的纯函数或简单类。 - tools:这里的每个文件都实现了特定MCP工具的核心逻辑(aider_ai_code, list_models). - utils.py:包含共享常量,如默认模型名称。 - data_types.py:为请求/响应结构定义Pydantic模型,确保数据验证。 - logging.py:为控制台和文件输出设置一致的日志记录格式。 - server.py:编排MCP服务器。它初始化服务器,注册在 atoms/tools 目录,处理传入的请求,将它们路由到适当的工具逻辑,并根据MCP协议发回响应。 - __main__.py:提供命令行界面入口点(aider-mcp-server),解析参数,如 --editor-model 并启动中定义的服务器 server.py. - tests:包含反映结构的测试 src 目录,确保每个组件(尤其是原子)按预期工作。

目录标签

目录标签

开发工具PythonClaude开源工具AI编码本地部署开发效率任务卸载

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

api-key

运行时(runtime,运行环境)

Python

部署方式(deploymentType,部署类型)

local-only

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdioapi-keylocal-only

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP