aider icon indicating copy to clipboard operation
aider copied to clipboard

Please add support for model context protocol from anthropic

Open hemangjoshi37a opened this issue 11 months ago • 20 comments
trafficstars

Issue

Please add support for model context protocol from anthropic

Version and model info

latest

hemangjoshi37a avatar Dec 03 '24 15:12 hemangjoshi37a

what would you want to do with this? One thing I thought is that its a way to get cheaper access to Sonnet. $20/Month Claude subscription could be used to do coding work instead of using API tokens. I know aider has --apply-clipboard-edits but that's very clunky, much better to be able to interactively edit while using Claude desktop.

On the other hand, in some ways MCP might make Aider redundant. Why not just hook up VSCode with Claude MCP access to local files, why do we even need Aider in the loop at all.

Personally, I really like Aider and think it still has a place. I think that using LLMs is all about context management, and Aider does it very well with its ability to add and drop files, use the repo map etc. Aider could use MCP to dynamically load context and save tokens. I'd be very interested to hear from @fry69 or @paul-gauthier if they think that MCP is going to be useful for Aider.

lockmeister avatar Dec 05 '24 20:12 lockmeister

MCP could be a game changer for Aider. If Aider is the host then it could access the capabilities of MCP servers. For example, imagine a MCP server that provides function calls (aka tool use) into the project's LSP server. Aider could incorporate a project's symbols and call graphs into the session's context. It would bring greater understanding to stacktraces and be able to analyse the impact of each edit that it proposes. Another example, imagine another MCP server that provides access to an application's cloud logs or GitHub issues. This would give Aider the capability find connections between multiple issues. If Aider is the host it replaces the Claude for Desktop app, and opens up a world of different plugins.

But Aider could also be a server itself, and provide other hosts (like Claude for Desktop) with code editing capabilities that go beyond just modifying bytes on disk. Aider would automatically lint, test, increase test coverage, demo, deploy and close GitHub/Jira issues.

au-phiware avatar Dec 06 '24 02:12 au-phiware

Or we can make aider as a MCP server. Wow what an idea sirji

hemangjoshi37a avatar Dec 06 '24 05:12 hemangjoshi37a

We can learn from Cline: https://github.com/cline/cline/releases/tag/v2.2.0

therealtimex avatar Dec 13 '24 06:12 therealtimex

I just used Cline to create some user stories for my project and create Gitlab Issues for it. Would love to see MCP support in Aider.

grafik

MehrCurry avatar Dec 17 '24 14:12 MehrCurry

what would you want to do with this? One thing I thought is that its a way to get cheaper access to Sonnet. $20/Month Claude subscription could be used to do coding work instead of using API tokens. I know aider has --apply-clipboard-edits but that's very clunky, much better to be able to interactively edit while using Claude desktop.

On the other hand, in some ways MCP might make Aider redundant. Why not just hook up VSCode with Claude MCP access to local files, why do we even need Aider in the loop at all.

Personally, I really like Aider and think it still has a place. I think that using LLMs is all about context management, and Aider does it very well with its ability to add and drop files, use the repo map etc. Aider could use MCP to dynamically load context and save tokens. I'd be very interested to hear from @fry69 or @paul-gauthier if they think that MCP is going to be useful for Aider.

I've used Claude Desktop with MCP. Comparing it to aider, the code generating speed is nowhere as fast as aider. Simply asking it to write 1 large XML files (prompts for aider) tends to result in me hitting the message limit (not the hourly message limit, just whatever limit Claude Desktop has for a single response)..

I use AI to help write Infrastructure-as-Code like Terraform or Ansible, and one weakness is typically the lack of current information. Resource names, arguments, or collection names can be inaccurate. With MCP Brave Search + Fetch I can usually work around it by asking Claude to fetch the current docs. If MCP is added I'll probably lean on aider even more.

AgentWong avatar Jan 06 '25 06:01 AgentWong

+1 for MCP integration! And I'd be willing to help with the implementation.

As pointed out above, there is support for Brave and fetch to allow for up to date context as libraries change. There is also a playwright MCP server that might allow Aider to not have to implement /web using code in this codebase.

mikegehard avatar Jan 20 '25 20:01 mikegehard

As I've already commented on #1005, MCP could also solve all the requests for an RAG solution in a cleaner way.

luke3butler avatar Jan 23 '25 15:01 luke3butler

With MCP, we could add tools like memory and sequential thinking, or github, or git, etc...

roychri avatar Jan 31 '25 21:01 roychri

Here an experiment:

https://www.youtube.com/watch?v=OM1h4YDPjRU https://github.com/lutzleonhardt/mcpm-aider

lutzleonhardt avatar Feb 05 '25 14:02 lutzleonhardt

I support this!

alberto-abarzua avatar Feb 13 '25 14:02 alberto-abarzua

It's highly required feature,by implement this ,Aider become choice of development in "Vibe coding" era.

rajivmehtaflex avatar Feb 17 '25 06:02 rajivmehtaflex

If anyone is interested in MCP server support, AiderDesk - an Electron-based UI built on top of Aider - has just introduced experimental support for MCP servers.

Feel free to check it out and share any feedback.

I am also happy to share details of the implementation, so this could be incorporated directly into Aider.

wladimiiir avatar Mar 02 '25 13:03 wladimiiir

what would you want to do with this? One thing I thought is that its a way to get cheaper access to Sonnet. $20/Month Claude subscription could be used to do coding work instead of using API tokens. I know aider has --apply-clipboard-edits but that's very clunky, much better to be able to interactively edit while using Claude desktop.

On the other hand, in some ways MCP might make Aider redundant. Why not just hook up VSCode with Claude MCP access to local files, why do we even need Aider in the loop at all.

Personally, I really like Aider and think it still has a place. I think that using LLMs is all about context management, and Aider does it very well with its ability to add and drop files, use the repo map etc. Aider could use MCP to dynamically load context and save tokens. I'd be very interested to hear from @fry69 or @paul-gauthier if they think that MCP is going to be useful for Aider.

I look at MCP in a couple ways.

First, tool calling, obviously. But Second, if you're going to be doing tool calling, you're going to have to prompt it correctly to get the behavior you want. and you're going to have to manage those prompts, and you're going to have to have all those prompts live in your chat history.

So by compartmentalizing all of that into an MCP server, all that knowledge can be segmented away into a known good solution and the prompts that do all the wrangling don't pollute your chat history. So it helps expand the capability of an agent in a composable way without putting all the weight on the top-level coordinating conversation context.

andrewluetgers avatar Mar 06 '25 15:03 andrewluetgers

"Claude Code" has added MCP, and it's a game-changer. There's a reason why every AI coding assistant is integrating MCP right now.

So the real question isn't "IF"—it's "HOW" and "WHEN"? 😏

michabbb avatar Mar 06 '25 16:03 michabbb

I checked Claude's code—really impressive! However, it locks you into a specific vendor. I believe Aider has the potential to change the game with its open approach. A CLI tool that enables seamless, agentic workflows without needing to switch to a desktop would be a niche breakthrough...

Karif avatar Mar 06 '25 20:03 Karif

Goose, from Block, is similar to Claude Code and Aider but allows different models. It also supports MCP.

https://github.com/block/goose

mikegehard avatar Mar 06 '25 20:03 mikegehard

I see a lot of potential for MCP support in aider (directly, not through workarounds). I don't agree that MCP makes Aider redundant. Aider still gives me finer control than something like Claude code. I don't think the point is to make Aider act like Claude Code, it's just to give it access to more tools. For example, the puppeteer MCP server would make building & testing front-end apps much more effective.

bendavis78 avatar Mar 19 '25 21:03 bendavis78

I see this has been implemented in https://github.com/Aider-AI/aider/pull/3672 but not yet merged

jamesmstone avatar Mar 29 '25 11:03 jamesmstone

despite the hard work done in https://github.com/Aider-AI/aider/pull/3672, i would argue that it might be better for aider to offload the mcp client work to litellm, which already has a beta mcp client implementation: https://docs.litellm.ai/docs/mcp#litellm-python-sdk-mcp-bridge

rawwerks avatar Apr 19 '25 18:04 rawwerks

~@rawwerks currently it looks like litellm will not support MCP servers that use the STDIO transport.~

[edit] see below, apparently it does work w/ stdio

bendavis78 avatar May 02 '25 21:05 bendavis78

despite the hard work done in #3672, i would argue that it might be better for aider to offload the mcp client work to litellm, which already has a beta mcp client implementation: https://docs.litellm.ai/docs/mcp#litellm-python-sdk-mcp-bridge

I'm the author of the PR, I was thinking about rewriting the pr for the litellm bridge, since there are some problems due to the nature of mcp tools being async & subprocesses, that add a lots of complexity/boilerplate code to the codebase

Antonin-Deniau avatar May 03 '25 07:05 Antonin-Deniau

I took a stab at an implementation that uses the LiteLLM Bridge: https://github.com/Aider-AI/aider/pull/3937

Like Claude and Cursor, only stdio servers are supported. But the PR offers a basic implementation that runs on a single thread.

@bendavis78 All of the servers I've been testing with used stdio, so I don't think this is accurate.

quinlanjager avatar May 03 '25 07:05 quinlanjager

+1 to add MCP support to Aider.

A very great use case is the Context7 MCP which provides up-to-date code examples and documentation available to any AI Assistant equipped with MCP capabilities.

ReginaldoSantos avatar May 26 '25 23:05 ReginaldoSantos

For a few months, I have been using: https://github.com/hotovo/aider-desk 🚀 🤖 It's amazing !! Under the hood it's aider, but combined with a nice Ui, MCP, and some other stuff, it's awesome ❤ Give it a try 😊

michabbb avatar May 26 '25 23:05 michabbb

As a starter, MCP is nice for:

  • having a feedback loop to give to the model. You do a frontend change, how can it be tested ? Give it mcp/playwright, and it will get the page and try its own changes. You end up with better chances to have a working solutions.
  • you're using a up-to-date library, but the model is not that up to date, and end up generate the same old past solutions ? give it context7 and it can look it up by himself

tito avatar Jun 12 '25 22:06 tito