I am currently giving Cursor another try to code Elixir apps. Although I am quite happy with how it evolved, I kept getting annoyed by the agent adding outdated packages, which I manually had to set to the latest version from hex.pm.
To solve this, I wrote a tiny MCP server, which allows the editor to retrieve the correct versions before adding packages to the project, and it works quite well:
It would be interesting to see if this would work better than Cursor just checking the code by itself. I am quite happy with how Cursor understands my schema and validations, but this might be due to the ‘Large context’ setting I have enabled, so it might just take more of the schema files into account.
Having an MCP running could, of course, guide the chat/composer; would be worth a try.
This is a great help when I am trying to write Elixir code using LLM. I am wondering how hard it would be to write MCP client in Elixir? Either from scratch or wrap another Rust crate (crates.io: Rust Package Registry) using Rustler?
I did not try, but during the discussion of my post on social media, zoedsoupe mentioned their project, which seems to be an Elixir library for building both server and client MCP apps, might be worth a look:
Just to be clear, this is not the package I have built my server on, I used:
I am experimenting with local MCP server fed with PDF books I own, like Sasa Juric’s Elixir in Action and others. The idea is plug them into editor and use them in a sort of RAG fashion. I’m mostly using Windsurf with Sonnet 3.7 these days.
Anyone else and more experienced running similar setup? I’m still in trial & error stage, so looking for inspiration and trying to avoid reinventing the wheel.
I think given that elixir is not as popular as react/js/python, some extra documentation may help. Giving the AI RAG access to locally stored books and HEX Documentation for packages should help it with accuracy.
I am also using Windsurf, and from what I can see, it only supports STDIO MCP.
I think extending one of the Elixir MCP libs to do STDIO would be a good first step. hermes-mcp seems to have STDIO transport as a client so maybe a good starting place to try to add on that?
The other thing is elixir has the great language server, with really good compile time errors and ideally any errors after an AI save should be fed back in as soon as it saves the file.