📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

Use MCP Servers and Tools in Aider

Pilots of AI7:51

Transcription

Hello coders. Today I want to show you a little experiment I did to make use of the mCP service inside of ADA.

mCP stands for Model Context Protocol, and it's a protocol developed by Anthropic to pull foreign context into your AI system using a standardized protocol based on standard input/output or server-side events to communicate with other services. It can provide you context.

The problem is that ADA does not support mCP at the moment, and also not support tool use or native tool use. But what ADA supports is it passes the response coming from the LLM, and when it recognizes a bash script, it suggests to execute it automatically.

So I implemented a little CLI tool which acts as a proxy to communicate with mCP servers. You can find the GitHub repository here. The tool is called mcpm-ada, and it's a fork by mCP Club. If I scroll down, then you see a little description how to use that, but I want to show this now live to you. So I switch over to the console.

The first thing you need to do is to install the tool from the npm registry. You type in `npm i` for install, `@ai-for-pilots-of-ai/mcpm-ada`. You can also add `--global` to install it globally in our system.

Okay, now the tool is installed, and we can access the tool with `mcpm-ada`. And now we see its capabilities and commands it can do. You can do `mcpm-ada list` to see which mCP services are currently installed. At the moment, we have none installed here.

If you see an error here, it's important that the tool is originally developed for maintaining mCP servers for the Cloud desktop application. That means it relies on the configuration created for this application. If you do not have it installed, then you need to at least create an empty configuration file in the particular location depending on your operating system. I'm here on Linux, so I needed to create a file under my home directory, `.config/cloud/cloud-desktop-config.json`. That is the configuration file for Cloud Desktop for the mCP servers.

If you now want to install an mCP server, you can write `mcpm-ada search`, and let's say we want to add a Perplexity mCP server here. So I'm looking for Perplexity, then I find some Perplexity mCP services. Pick one of them, for example, the second one here, and then I install this with `mcpm-ada install`. Now it asks me to install it. Let's say yes. And now it needs my Perplexity API key, and I paste it in offscreen.

Okay, that's it. Now the configuration is done. If I do `mcpm-ada list`, I see it's installed, it's enabled, and I also see the command which it runs to execute it.

Important part here is this is only the configuration part. Most of the time, if you have Uvicorn, you also need to install this via pip or via Uvicorn pip. You need to consult the documentation on the GitHub page. `pipx install` to install this globally on my machine. You can always check this if you just execute this by your own. `uvicorn` is the command, and the argument is `run-perplexity`. Yeah, and then you see it's working, it's available, the dependencies are correctly installed.

Let's say you want to add another mCP server. Let's say I want to communicate with my Obsidian world, then I pick, for example, this one. With this, I can read files from my local Obsidian installation. So I install it with this command. I want to install this, and it wants to pass to my local directory. Now it's set up. If I do a list, I see both mCPs installed and available.

Now to use this in ADA, I start ADA with `sonnet`, and then I switch to the code mode because then CLI tools are executed more or less automatically. ADA suggests this for me. What I can do now here is `flow run mcpm-ada tool prompt`, and now it's adding a prompt how to execute the tools here exactly with the parameters it needs, with the description of the functions, and so on. You could also pipe this to a file and then attach the file to the context.

But there's also a handy way to do it. For example, say, "Please consult Perplexity, show me the newest development in the AI area." If I click enter, then the tool saying, "Yeah, I'm aware of mCP tools," and then it makes a call to the mCP-ADA, and I just say yes, and then it comes back with the result here. I can say, for example, "So, based on the Perplexity search results, there's generative AI, medicine, scientific research, and so on."

And now I want to pull something from my Obsidian world. Please read the file now. For example, if we go here, I have this file under "One MOOCs" (stands for Maps of Content) development. Let's pull this one in and summarize it automatically. So I can say, "Please read the file, please read a file from Obsidian and summarize the topics." For example, it's saying, "I'm aware of mCP tools. Yes, let me summarize the content of the development map of content," and then you see the contents from that Obsidian page.

So, one hint is you can start ADA with `--yes` (I think) or always `yes`. I'm not sure exactly. You can look at the documentation, and then you do not need to confirm. Then it's auto-executing it.

And that way, you can pull external context to your application with the help of mCP servers. This could be interesting until the mCP is natively available in ADA. That's all for today. Let me know what you think. If you're interested in more topics about generative AI, ADA, also other AI assistants, then you can follow my channel. If you want, give me a like. Happy coding!