Skip to main content

aider -- MCP Tool Specification

Version: v1.0.0 | Status: Active | Last Updated: March 2026

All tools are auto-discovered via the @mcp_tool decorator in mcp_tools.py and surfaced through the PAI MCP bridge. No manual registration required.


aider_check​

Category: aider Description: Check if aider is installed and return version + configured model.

Parameters​

None.

Return Schema​

FieldTypeDescription
statusstr"success" or "error"
installedboolTrue if aider binary found in PATH
versionstrInstalled aider version (e.g. "0.77.0")
modelstrCurrently configured model
install_hintstrPresent when installed=false; contains install command
messagestrPresent when status="error"

Example​

// Request
{"tool": "aider_check"}

// Response (installed)
{"status": "success", "installed": true, "version": "0.77.0", "model": "claude-sonnet-4-6"}

// Response (not installed)
{"status": "success", "installed": false, "version": "", "model": "claude-sonnet-4-6", "install_hint": "uv tool install aider-chat"}

Error Cases​

  • Internal exception: {"status": "error", "message": "..."}

aider_edit​

Category: aider Description: Edit files using aider AI pair programming. Applies code changes based on a natural-language instruction.

Parameters​

NameTypeRequiredDefaultDescription
file_pathslist[str]Yes--List of file paths to edit
instructionstrYes--Natural-language instruction describing the change
modelstrNo"claude-sonnet-4-6"LLM model to use
timeoutintNo300Subprocess timeout in seconds

Return Schema​

FieldTypeDescription
statusstr"success" or "error"
outputstrCaptured stdout from aider
stderrstrCaptured stderr from aider
returncodestrProcess return code ("0" = success)
messagestrPresent when status="error"

Example​

// Request
{
"tool": "aider_edit",
"file_paths": ["src/app.py"],
"instruction": "Add comprehensive error handling to all HTTP calls",
"model": "claude-sonnet-4-6"
}

// Response
{
"status": "success",
"output": "Applied changes to src/app.py\n...",
"stderr": "",
"returncode": "0"
}

Error Cases​

  • Empty file_paths: {"status": "error", "message": "file_paths must not be empty"}
  • Aider not installed: {"status": "error", "message": "aider binary not found in PATH..."}
  • Timeout: {"status": "error", "message": "aider subprocess timed out after 300s"}

aider_ask​

Category: aider Description: Ask aider a question about code without making any file changes. Returns analysis or explanation.

Parameters​

NameTypeRequiredDefaultDescription
file_pathslist[str]Yes--Files to include as context
questionstrYes--Question to ask about the code
modelstrNo"claude-sonnet-4-6"LLM model to use
timeoutintNo120Subprocess timeout in seconds

Return Schema​

FieldTypeDescription
statusstr"success" or "error"
answerstrAider's response to the question
stderrstrCaptured stderr
messagestrPresent when status="error"

Example​

// Request
{
"tool": "aider_ask",
"file_paths": ["src/auth.py"],
"question": "Is this JWT implementation secure? What vulnerabilities exist?"
}

// Response
{
"status": "success",
"answer": "The JWT implementation has several considerations...",
"stderr": ""
}

Error Cases​

  • Aider not installed: {"status": "error", "message": "aider binary not found in PATH..."}
  • Timeout: {"status": "error", "message": "aider subprocess timed out after 120s"}

aider_architect​

Category: aider Description: Use aider's architect mode for complex multi-step refactoring. Uses two-model workflow: one plans, one edits.

Parameters​

NameTypeRequiredDefaultDescription
file_pathslist[str]Yes--Files to include
taskstrYes--Complex task description
modelstrNo"claude-sonnet-4-6"Architect model (planner)
editor_modelstrNo""Editor model (defaults to architect model)
timeoutintNo600Subprocess timeout in seconds

Return Schema​

FieldTypeDescription
statusstr"success" or "error"
outputstrCaptured stdout from aider
stderrstrCaptured stderr
returncodestrProcess return code ("0" = success)
messagestrPresent when status="error"

Example​

// Request
{
"tool": "aider_architect",
"file_paths": ["src/"],
"task": "Add comprehensive logging to all service methods",
"editor_model": "claude-haiku-4-5-20251001"
}

// Response
{
"status": "success",
"output": "Architect plan:\n...\nApplied changes to...",
"stderr": "",
"returncode": "0"
}

Error Cases​

  • Empty file_paths: {"status": "error", "message": "file_paths must not be empty"}
  • Aider not installed: {"status": "error", "message": "aider binary not found in PATH..."}
  • Timeout: {"status": "error", "message": "aider subprocess timed out after 600s"}

aider_config​

Category: aider Description: Return current aider configuration: model, API key presence, and timeout settings.

Parameters​

None.

Return Schema​

FieldTypeDescription
statusstr"success" or "error"
modelstrConfigured model name
has_anthropic_keyboolTrue if ANTHROPIC_API_KEY is set
has_openai_keyboolTrue if OPENAI_API_KEY is set
has_any_keyboolTrue if at least one API key is set
timeoutintConfigured timeout in seconds
messagestrPresent when status="error"

Example​

// Request
{"tool": "aider_config"}

// Response
{
"status": "success",
"model": "claude-sonnet-4-6",
"has_anthropic_key": true,
"has_openai_key": false,
"has_any_key": true,
"timeout": 300
}

Error Cases​

  • Internal exception: {"status": "error", "message": "..."}