### Install Project Dependencies with uv Source: https://github.com/disler/aider-mcp-server/blob/main/README.md Installs all necessary project dependencies using the `uv sync` command, ensuring the environment is ready for operation. ```bash uv sync ``` -------------------------------- ### Clone Aider MCP Server Repository Source: https://github.com/disler/aider-mcp-server/blob/main/README.md Clones the Aider MCP Server project repository from GitHub to your local machine, initiating the setup process. ```bash git clone https://github.com/disler/aider-mcp-server.git ``` -------------------------------- ### Python Functions for Aider AI Coding Assistant Setup and Execution Source: https://github.com/disler/aider-mcp-server/blob/main/ai_docs/programmable-aider-documentation.md This Python snippet defines the `AICodeParams` data model for configuring an AI coding task, specifying parameters like models, context files, and various settings. It includes `build_ai_coding_assistant`, a function that constructs and configures an Aider `Coder` instance, adapting its behavior based on whether an 'architect' mode is enabled and applying model-specific parameters. Finally, the `ai_code` function demonstrates how to execute the AI coding process by running a prompt against the prepared `Coder` instance. ```python class AICodeParams(BaseModel): architect: bool = True prompt: str model: str editor_model: Optional[str] = None editable_context: List[str] readonly_context: List[str] = [] settings: Optional[dict] use_git: bool = True def build_ai_coding_assistant(params: AICodeParams) -> Coder: """Create and configure a Coder instance based on provided parameters""" settings = params.settings or {} auto_commits = settings.get("auto_commits", False) suggest_shell_commands = settings.get("suggest_shell_commands", False) detect_urls = settings.get("detect_urls", False) # Extract budget_tokens setting once for both models budget_tokens = settings.get("budget_tokens") if params.architect: model = Model(model=params.model, editor_model=params.editor_model) extra_params = {} # Add reasoning_effort if available if settings.get("reasoning_effort"): extra_params["reasoning_effort"] = settings["reasoning_effort"] # Add thinking budget if specified if budget_tokens is not None: extra_params = add_thinking_budget_to_params(extra_params, budget_tokens) model.extra_params = extra_params return Coder.create( main_model=model, edit_format="architect", io=InputOutput(yes=True), fnames=params.editable_context, read_only_fnames=params.readonly_context, auto_commits=auto_commits, suggest_shell_commands=suggest_shell_commands, detect_urls=detect_urls, use_git=params.use_git, ) else: model = Model(params.model) extra_params = {} # Add reasoning_effort if available if settings.get("reasoning_effort"): extra_params["reasoning_effort"] = settings["reasoning_effort"] # Add thinking budget if specified (consistent for both modes) if budget_tokens is not None: extra_params = add_thinking_budget_to_params(extra_params, budget_tokens) model.extra_params = extra_params return Coder.create( main_model=model, io=InputOutput(yes=True), fnames=params.editable_context, read_only_fnames=params.readonly_context, auto_commits=auto_commits, suggest_shell_commands=suggest_shell_commands, detect_urls=detect_urls, use_git=params.use_git, ) def ai_code(coder: Coder, params: AICodeParams): """Execute AI coding using provided coder instance and parameters""" # Execute the AI coding with the provided prompt coder.run(params.prompt) ``` -------------------------------- ### Shell Command: Validate Aider MCP Server Installation Source: https://github.com/disler/aider-mcp-server/blob/main/specs/init-aider-mcp-exp.md Provides the command to validate the server's installation and functionality by displaying its help message. ```Shell uv run aider-mcp-server --help ``` -------------------------------- ### Create Local Environment Configuration File Source: https://github.com/disler/aider-mcp-server/blob/main/README.md Copies the sample environment file (`.env.sample`) to create a new `.env` file, which will be used to store local configuration and API keys. ```bash cp .env.sample .env ``` -------------------------------- ### Shell Command: Add Python Package with uv Source: https://github.com/disler/aider-mcp-server/blob/main/specs/init-aider-mcp-exp.md Illustrates how to add additional Python packages to the project using the `uv` package manager. ```Shell uv add ``` -------------------------------- ### Add Aider MCP Server to Claude Code (gemini-2.5-pro-preview-03-25) Source: https://github.com/disler/aider-mcp-server/blob/main/README.md Registers the Aider MCP server with Claude Code, configuring it to use the `gemini-2.5-pro-preview-03-25` model for AI coding tasks. Replace placeholders with actual project paths. ```bash 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 "" ``` -------------------------------- ### Add Aider MCP Server to Claude Code (quasar-alpha) Source: https://github.com/disler/aider-mcp-server/blob/main/README.md Registers the Aider MCP server with Claude Code, configuring it to use the `openrouter/openrouter/quasar-alpha` model for AI coding tasks. Replace placeholders with actual project paths. ```bash claude mcp add aider-mcp-server -s local \ -- \ uv --directory "" \ run aider-mcp-server \ --editor-model "openrouter/openrouter/quasar-alpha" \ --current-working-dir "" ``` -------------------------------- ### Python API: Aider MCP Server Core Source: https://github.com/disler/aider-mcp-server/blob/main/specs/init-aider-mcp-exp.md Defines the main server entry point and its configuration parameters for the Aider MCP server. ```APIDOC server.py: serve(editor_model: str = DEFAULT_EDITOR_MODEL, current_working_dir: str = ".", architect_model: str = None) -> None ``` -------------------------------- ### Configure API Keys for AI Models in .env Source: https://github.com/disler/aider-mcp-server/blob/main/README.md Illustrates how to set various AI model API keys (e.g., Gemini, OpenAI, Anthropic) within the `.env` file. These keys are required for Aider to interact with different models. Refer to `.env.sample` for a complete list of supported keys. ```bash 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 ``` -------------------------------- ### Add Aider MCP Server to Claude Code (gemini-2.5-pro-exp-03-25) Source: https://github.com/disler/aider-mcp-server/blob/main/README.md Registers the Aider MCP server with Claude Code, configuring it to use the `gemini-2.5-pro-exp-03-25` model for AI coding tasks. Replace placeholders with actual project paths. ```bash 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 "" ``` -------------------------------- ### Shell Command: Run Pytest with uv Source: https://github.com/disler/aider-mcp-server/blob/main/specs/init-aider-mcp-exp.md Shows the command to execute specific Python test files using `pytest` via the `uv` runner. Emphasizes running real LLM calls and testing failure paths. ```Shell uv run pytest ``` -------------------------------- ### Add Aider MCP Server to Claude Code (llama4-maverick-instruct-basic) Source: https://github.com/disler/aider-mcp-server/blob/main/README.md Registers the Aider MCP server with Claude Code, configuring it to use the `fireworks_ai/accounts/fireworks/models/llama4-maverick-instruct-basic` model for AI coding tasks. Replace placeholders with actual project paths. ```bash 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 "" ``` -------------------------------- ### Execute All Project Tests Source: https://github.com/disler/aider-mcp-server/blob/main/README.md Runs all available tests for the Aider MCP server using `pytest` via `uv run`, ensuring the entire codebase functions as expected. ```bash uv run pytest ``` -------------------------------- ### Run Specific Test: AI Coding Functionality Source: https://github.com/disler/aider-mcp-server/blob/main/README.md Executes a specific test file that validates the AI coding capabilities of the server. This test requires a valid Gemini API key configured in the `.env` file. ```bash uv run pytest src/aider_mcp_server/tests/atoms/tools/test_aider_ai_code.py ``` -------------------------------- ### Configure .mcp.json for Aider MCP Server Integration Source: https://github.com/disler/aider-mcp-server/blob/main/README.md Provides a JSON configuration snippet for integrating the Aider MCP server into a project. It defines the server type, command, arguments (including project paths and editor model), and environment variables for API keys. ```json { "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": "" } } } } ``` -------------------------------- ### Run Specific Test: Listing Models Source: https://github.com/disler/aider-mcp-server/blob/main/README.md Executes a specific test file focused on verifying the functionality of listing available AI models, useful for targeted debugging or validation. ```bash uv run pytest src/aider_mcp_server/tests/atoms/tools/test_aider_list_models.py ``` -------------------------------- ### Aider AI Code Tool Reference Source: https://github.com/disler/aider-mcp-server/blob/main/README.md The `aider_ai_code` tool enables AI-driven code modifications and generation. It requires a natural language prompt and a list of editable files, with options for read-only context files and specific AI models. The tool returns a success status and a diff of the changes made. ```APIDOC aider_ai_code: description: This tool allows you to run Aider to perform AI coding tasks based on a provided prompt and specified files. parameters: ai_coding_prompt: type: string required: true description: The natural language instruction for the AI coding task. relative_editable_files: type: list of strings required: true description: A list of file paths (relative to the current_working_dir) that Aider is allowed to modify. If a file doesn't exist, it will be created. relative_readonly_files: type: list of strings required: false default: [] description: A list of file paths (relative to the current_working_dir) that Aider can read for context but cannot modify. model: type: string required: false default: "gemini/gemini-2.5-pro-exp-03-25" description: The primary AI model Aider should use for generating code. editor_model: type: string required: false default: None description: The AI model Aider should use for editing/refining code, particularly when using architect mode. returns: type: dict properties: success: type: boolean description: Whether the operation was successful. diff: type: string description: The diff of the changes made to the file. ``` ```JSON { "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" } } ``` -------------------------------- ### Python API: Aider AI Code Generation Tool Source: https://github.com/disler/aider-mcp-server/blob/main/specs/init-aider-mcp-exp.md Details the `code_with_aider` function, which runs a one-shot Aider process for AI code generation based on provided prompts and file lists. It indicates whether the operation was successful or failed. ```APIDOC atoms/tools/aider_ai_code.py: code_with_aider(ai_coding_prompt: str, relative_editable_files: List[str], relative_readonly_files: List[str] = []) -> str - Runs one-shot Aider based on ai_docs/programmable-aider-documentation.md. - Outputs 'success' or 'failure'. ``` -------------------------------- ### Python API: Aider Model Listing Tool Source: https://github.com/disler/aider-mcp-server/blob/main/specs/init-aider-mcp-exp.md Describes the `list_models` function, which queries Aider's internal model fuzzy matching utility to return a list of models based on a given substring. ```APIDOC atoms/tools/aider_list_models.py: list_models(substring: str) -> List[str] - Calls aider.models.fuzzy_match_models(substr: str) and returns the list of models. ``` -------------------------------- ### Aider List Models Tool Reference Source: https://github.com/disler/aider-mcp-server/blob/main/README.md The `list_models` tool provides a way to discover available AI models supported by Aider. It filters models based on a provided substring, returning a list of matching model names. ```APIDOC list_models: description: This tool lists available AI models supported by Aider that match a given substring. parameters: substring: type: string required: true description: The substring to search for within the names of available models. returns: type: list of strings example: ["gemini/gemini-1.5-flash", "gemini/gemini-1.5-pro", "gemini/gemini-pro"] description: A list of model name strings that match the provided substring. ``` ```JSON { "name": "list_models", "parameters": { "substring": "gemini" } } ``` -------------------------------- ### Python API: Aider MCP Utility Constants Source: https://github.com/disler/aider-mcp-server/blob/main/specs/init-aider-mcp-exp.md Defines default model names used across the Aider MCP server for editor and architect roles. ```APIDOC atoms/utils.py: DEFAULT_EDITOR_MODEL = "gemini/gemini-2.5-pro-exp-03-25" DEFAULT_ARCHITECT_MODEL = "gemini/gemini-2.5-pro-exp-03-25" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.