Conversation
f52ddb9 to
10ea9ba
Compare
|
I've been testing this PR, and overall it seems to be working quite well. Great job on this! However, while testing, I encountered an error message: I'm not entirely sure if this is expected behavior for this specific configuration, or if I might have missed something in the setup? Additionally, I was also wondering about the feasibility of running aider itself within a container, and using containerized mcpServers. |
|
@imunique-ZJ Thank you for giving this a spin! 😄 I tested your config outside of a docker container. I was able to start and connect to the server. It sounds like you're running the project in a Docker container which might be the problem. When using the MCP SDK's STDIO transport, Aider is responsible for starting and stopping the server processes. This means Aider has to have access to the executables and dependencies needed to start the server (in this case the docker process). So if you're running Aider inside of a Docker container and want to use MCP tools started with Docker you will have to configure some "Docker-in-Docker" solution. I think this might be beyond the scope of this PR though. |
|
Thanks for the detailed explanation and for testing this out! I also tested outside of a container environment, and I did occasionally encounter the same error. However, it didn't seem to affect the core functionality, and I was still able to get the expected results. So, it's not a blocking issue for me. 👍 Regarding the Docker-in-Docker or Podman-in-Podman approach, since it would be outside the scope of this particular PR, so I won't go into further discussion here. Thanks again. |
f979394 to
44b385c
Compare
44b385c to
282b349
Compare
|
I updated the implementation to allow partial (or total) failure when initializing MCP servers. Even if a user's configured MCP servers fail to initialize we should allow the user to continue using Aider but let them know something has gone wrong. Partial FailureTotal FailureMultiple Total Failures |
|
I apologize if I'm missing something obvious, but have you been able to test this using local LLMs? If so, could you describe your setup please? I tried using Qwen3 30B-A3B (which has good agentic support) with both Llama.cpp (using --jinga in LCPP and stream=false in Aider since streaming isn't supported) and also with Ollama, wasn't having success. I quite possibly have something set up incorrectly. With Llama.cpp, Qwen3-30B-A3B, Testing with: It looks like it's attempting to send a tool_call for But Aider tells me For completeness, without the Using Ollama with I still see: But |
|
fyi @ishaan-jaff & @krrishdholakia i think you might think this is cool. aider is a perfect test bed to put the litellm mcp bridge to work! |
|
Looks great, let us know if there's any way we can improve the litellm mcp bridge |
|
@strawberrymelonpanda I ran into the same problem. I looked at the LiteLLM repo and there seems to be an issue tool calling with Ollama models (BerriAI/litellm#7570). I'm not 100% sure this is the exact problem that is happening behind the scenes, but it does look like the tools are being passed to the completion. So it is feeling like this might be related. I was also able to get tool calling working with Ollama with these settings based on this suggestion: env OPENAI_API_BASE=<ollama-base-url>/v1 aider --model openai/<ollama-model>This option does appear to have some limitations though so YMMV. |
|
@quinlanjager Thanks for the pointers, that indeed got it moving. For anyone following along, I changed my A few notes:
@ishaan-jaff, since you're in the thread, any ideas what's happening here? Is the Llama.CPP tool-use
It's probably worth trying to find a way to suppress this message.
Everything worked and there's a new commit as expected, but as a user without always-yes flags set, I'd really want the opportunity to review the MCP tool calls before they're executed. MCP is a must-have for Aider so thanks for this! |
|
Some other thoughts: I'll also mention that I'd love some new / commands specific to MCP if it's at all possible. /tools - Probably the same list a user gets at startup with the --verbose flag set: /servers - Add or disable MCP servers on the fly once Aider is started? Finally, granular MCP endpoint support at a config level, as some MCP clients have. Mostly just nice-to-haves and food for thought. |
|
@strawberrymelonpanda Thanks for the feedback. I think you're right that respecting the As for the warning message, this is happening because some models return "None" content with a tool call (rather than a string like "I'll use tools to find this out for you"). It makes sense to skip this warning if there are tool calls. I'll update my PR to include this. I feel additional Aider commands are beyond the scope of this PR (I think these would be good features to include in a follow up though). I want to focus this PR on the fundamental configuration and execution of MCP tools. Anything building on top of this platform, I'd prefer to leave for follow ups as they benefit from their own discussions. Though these are great suggestions. I actually really like granular tool config. |
|
Hello, I wonder how close this PR is to being merged? |
|
I am not understanding why this issue is not moving ahead. mcp is essential for ai scene.. |
|
I stopped using and advocating for Aider at work because, despite so much community work and dedication, this issue has not progressed, and there has been no feedback from the maintainers. I am not usually the kind of person who writes negative comments like this, but this is just baffling to me. The competition is fierce, and this does not make any sense at all. I understand we don't have a fundamental right to this project being maintained and moving forward, but perhaps some official statement, plan, and/or vision on how the project will move ahead in a time when Claude Code and Gemini CLI are gaining insane traction would be nice. |
I tried asking once, #4149 , the response was:
Personally speaking, until the priority PRs are merged, I'm considering Aider in a sort of "maintenance" mode and trying to adjust my expectations accordingly. 🤷♂️ In the meantime for MCP support, there's Roo-Code and Cline if you don't mind something VS Code based, and the new Crush if you want something for the terminal. Not to take anything away from this PR, of course - using it locally is also an option. it's just hard to see MCP in Aider advancing any further until this PR is merged or another approach is decided on. |
|
For those interested, I have a fork that incorporates this PR with the addition of the streamable http transport type here: I'm not making a PR since I've detailed here: Other PR merges/additions as well as some of my own smaller scale fixes for a few things in the above fork branch. Let me know if there are any other issues but I feel like the decision to largely outsource mcp to litellm and the mcp library was the most correct/maintainable decision to be made for integrating this in the project |
Let me point out that if you're interested in the fork, you should use this URL instead: Same project, but the other link goes to a specific branch (now out of date), while this one goes to the latest changes. 👍
|
|
@paul-gauthier please merge it. |
|
@paul-gauthier Out of curiosity, is there any specific reason to not merge this PR ? Thanks! |
|
Please solve the PR conflicts and merge it. This will add so much value to Aider. |
|
Maybe a better way to convince for this merge is to show which use cases
could be solved by MCP servers.
Not that I am opposing to the merge, quite the opposite, but maybe it is
not super clear what could that bring to aider.
El mar, 16 sept 2025 a las 11:46, Geraldo Andrade ***@***.***>)
escribió:
… *geraldoandradee* left a comment (Aider-AI/aider#3937)
<#3937 (comment)>
Please solve the PR conflicts and merge it. This will add so much value to
Aider.
—
Reply to this email directly, view it on GitHub
<#3937 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAYWPGCIFQTDEAQJTRTO2LT3S7L5RAVCNFSM6AAAAAB4LOUBNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEOJXGE4DOMRTHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
It's already marked as "Priority" by the repo's maintainer, so If it were going to be merged, I'd say he's already convinced. Personally I do not think that is going to happen. The repo's owner has never commented here, or many priority PRs. This is just my opinion, but I personally consider Aider to be in a maintenance mode, with minor updates that are largely assisted by AI. (Each release has a % of code written by AI comment; the last release was 88%) Not that I think there's anything wrong with that, but expectations should probably be adjusted. That said, I'm not trying to discourage anyone from showing support. |
|
If you prefer something in between, there is also AiderDesk. |
Interesting, I didn't know about your project. |
|
Definitely, Aider is dead. At this point, I migrated to OpenCode, and now I can see how outdated Aider really is...
|
|
The best thing about Aider was the "ai!" comments, but for terminal based AI coding OpenCode is the one I also go to now |
|
Looks to work well for me (via |
|
I changed to cline yesterday that for my use case is like an equal replacement |
@RyanCarrier For what it's worth, you can mimic this by leaving "// TODO: ...." comments at points of interest and telling an AI to "Complete the TODOs", or similar. Not quite as seamless but having aider --watch big repos was also very slow at times for me. |
|
Why this PR wasn't approved and merged into main? |
Aider is a stale project now |
|
Why so? If the original author doesnt want to continue developing, step aside and let others work... I dont get you'd let your project fall into the graveyard. |
|
The last release was in August. According to this thread no particular reason is stated: #4584 |
would it not make more sense to mount the docker sock as a volume? thats how other services like cup or watchtower handle that |




Overview
Related: #2525
This PR integrates Model Context Protocol (MCP) servers with Aider using LiteLLM's MCP bridge implementation. Server tools are provided to theunderlying model by Coder so all Coders will have access to them.
Configuration follows the standard MCP Server Configuration JSON schema used by Claude and Cursor. All server operations are ran on the main thread with coroutines. Coders will execute requests to multiple servers concurrently.
Configuration
MCP servers can be configured in multiple ways:
Command Line: Directly specify server configurations as a JSON string:
aider --mcp-servers '{"mcpServers":{"git":{"command":"uvx","args":["mcp-server-git"]}}}'Config File: Use a separate JSON configuration file:
YAML Config: Add to your
.aider.conf.yml:Implementation Details
The integration leverages LiteLLM's experimental_mcp_client module to load tools from configured servers and provide them to OpenAI compatible models.
The McpServer class is used to manage stdio transport connections via the Python MCP SDK.
The Coder class has been extended to initialize and use MCP tools, process tool calls in streaming responses, and execute tools concurrently across multiple servers. While generating a single reply, at most 25 tool calls can be made.
Limitations
Currently stdio is the only supported server transport. This was a scoping decision. The Python MCP SDK has an SSE server transport so implementation should be possible if desired.
It would be nice if we maintained persistent server connections throughout Aider's runtime. Currently, connections only exist for the duration of each request. I've been using this quite a bit and it is reasonably fast but I admit it is not ideal. Implementing context management at the top level using the
withstatement would provide a more efficient approach to connection handling.