aider
WebSocket server that exposes Aider's AI coding capabilities through the Model Context Protocol (MCP) for programmatic access
claude mcp add --transport stdio larock22-aider-mcp node ./dist/mcp-server.js \ --env LOG_LEVEL="info" \ --env AIDER_MODEL="gpt-4o-mini" \ --env OPENAI_API_KEY="your-openai-api-key" \ --env WORKSPACES_DIR="./workspaces"
How to use
This MCP server wraps Aider and exposes its functionality over the MCP WebSocket protocol. Clients connect via JSON-RPC 2.0, initialize a session, and then call one of the exposed tools to interact with Aider in a multi-tenant, isolated workspace per client. The available tools let you run natural language commands, add files to Aider’s workspace, and execute shell commands through Aider. Typical flows include initializing the session, sending an aider_command to produce code or content, optionally adding files with aider_add_file to set up the workspace, and using aider_run_command to run build or test commands within Aider’s environment. The server handles completion detection, so clients receive results only after Aider finishes tasks, and each client’s work is kept separate in its own workspace.
How to install
Prerequisites:
- Node.js 18+ installed on your system
- Git (optional, for cloning)
- An OpenAI API key
Steps:
- Clone the repository (if applicable)
- git clone https://github.com/your- org/aider_mcp.git
- cd aider_mcp
- Install dependencies
- npm install
- Create a local environment file
- cp .env.example .env
- Edit .env and provide your OpenAI API key and desired configuration, e.g.: OPENAI_API_KEY=sk-... AIDER_MODEL=gpt-4o-mini WORKSPACES_DIR=./workspaces
- Run the MCP protocol server (recommended)
- npm run mcp
- Optional: run the custom WebSocket wrapper or other scripts
- npm run dev
- npm run build && npm start
Notes:
- The MCP server is implemented in TypeScript and compiled to JavaScript in dist/
- Ensure dist/mcp-server.js exists after building before starting the server
Additional notes
Tips and common issues:
- Ensure OPENAI_API_KEY is set; missing key is a common startup failure.
- If you see connection errors, verify the server is running (npm run mcp) and that the port in .env matches your client configuration.
- Each client gets an isolated workspace; if you need to reset state, delete the corresponding directory in WORKSPACES_DIR.
- If Aider cannot be found, install Aider and ensure it is available in PATH (as per the README's troubleshooting).
- You can customize the AIDER_MODEL, logging level, and workspace location via environment variables in .env or at runtime with CLI overrides.
- For production deployment, consider compiling to dist and using npm start to run the built server.
Related MCP Servers
obsidian -tools
Add Obsidian integrations like semantic search and custom Templater prompts to Claude or any MCP client.
mcp
Model Context Protocol (MCP) server for the Webflow Data API.
Pare
Dev tools, optimized for agents. Structured, token-efficient MCP servers for git, test runners, npm, Docker, and more.
create -app
A CLI tool for quickly scaffolding Model Context Protocol (MCP) server applications with TypeScript support and modern development tooling
Agentic -Skill
Agentic-MCP, Progressive MCP client with three-layer lazy loading. Validates AgentSkills.io pattern for efficient token usage. Use MCP without pre-install & wasting full-loading
mcp-turso
MCP server for interacting with Turso-hosted LibSQL databases