purelymail-mcp-server
Why an MCP Server?
What is an MCP Server? (link to MCP docs - maybe I will explain it in another post)
Why Purelymail?
What is Purelymail?
A colleague has told me about Purelymail and since then I have setted up an account and some users with them for a group Project.
Since then I have been quite interested in using Purelymail for my own emails. For some reasons:
- It’s a great service, it works well.
- They host their service in AWS and has the redundancy and whatnot niceties of being in a big well-known trusted Cloud Provider.
- It’s dead-simple. It’s literally just an email server service. Plain simple. No bells and whistles.
- I put 10$ which is probably sufficient for an year of my usage. Yes 10$. It’s a pay as you go/as you use the service.
- Has an easy to use API.
- The price is just, they are not spending more because of me adding more domains I wanna use. I’m paying for the literal upkeep + of course some profit margin.
- Clear pricing, no BullShit.
I love no-bullshit services and anything that is no-bullshit. And I feel this is one of those things. Just, purely… mail…
More and more I have been using stuff like Claude Code, so being able to quickly open up the terminal and asking stuff related to my email configuration was something I have been thinking about for a few months.
And I want to keep using Purelymail… so I wanted to make an MCP Server for a more seamless integration with Claude Code
With this I could ask things in natural language. Example:
- “I want to add the domain potatos.pt to my purelymail account and then create the email [email protected]. For the domain, I want the DNS setup on my Cloudflare Account, put the necessary configuration into my Cloudflare Account DNS for the zone potatos.pt.”
Here I am assuming I also gave Claude Code access to my Cloudflare zone DNS configurations - either by:
- giving him indication that he can use their API via some
curl
commands - or, via an MCP Server that implements Cloudflare DNS configuration
For authentication with Cloudflare it can use a Token already set in the shell environment
Thought process in Building it
I started looking back at the API specifications (spec.) they provide here: Purelymail OpenAPI swagger page
I knew from a high-level perspective what to do so I wanted to prompt Claude Code to code the MCP Server and any automation necessary to maintain it.
This page to me would not do as it is html and has a lot of noise. So I looked for a more raw API spec.
By looking through the Browser network tool, I found a swagger-spec.js
file being fetched from
the same endpoint as the index.html, whichhad exactly what I wanted: a clean straightforward spec of the API.
With this file and a more solid mental direction about how to attack this problem, I opened Claude on the website and used the more beefy Opus model and prompted it to create a strong prompt (for Claude Code) on how to approach the problem and a plan on how to implement the solution. Then I pasted this prompt generated by Claude into Claude Code. Then it went and did it. It had a few bugs and some gotchas. After some iterations, I had a working MCP Server. I have a few ideas already on how to improve it and will be opening issues as I think of them and on how to fix/approach them. It’s a first version. The tools that are currently defined could be done in a different way. With current version I experience some tool-call formatting friction from the model side. From my human perspective… I feel the model friction… The current choice I took in defining the tools of the MCP Server is showing this trade-off.
The repository with the MCP Server is at: https://github.com/guiwf/purelymail-mcp-server
NOTES - Broadcast Voice and Intention - 23 September AI Builders Lisbon
a self-description of sorts:
I’m learning so much. I’m scared. I feel fragile. I feel strong. I am sensisitve, I am creative. I feel I’m most productive when I don’t have a plan or routine Routine and Planning gives me a sense of validation for my work Without it, I feel I did nothing. Without it, is when I come up with most new ideas I want one, I need both. The one I dislike, makes me dislike myself less, and appreciate myself more One gives me meaning, another removes away the sensation of joyful freedom One makes me ignorant of my productivity, the other makes me feel accomplished. I hate routine. Routine calms me down. I hate planning. Planning calms me down. The divergencies and controversial things in life
The Why… behind the thing.
Frustration-based doing.
All information, context, tools that could be provided to the AI System. My opinion is that to best understand models, and the “blackboxes”/AI systems depending on the models is: a cocktail of some understanding in Psychology, Team-leading, Organization (or at least on how one could organize), engineering (how things are built) and logic.
Materials, Things, Tangible Things I wanna provide/use
- Prompts Used - and behind the scenes
- Demo Account in Purelymail (the Email Service)
- Examples of Things I do regularly with my Purelymail Account
Examples of things that can be done - Curious to try one?:
Thoroughly Document a whole codebase (frontend and backend)
What is the intent: For Assistant to understand (as much as possible) the codebase - as if it was a developer that developed the code from 0:
- structure,
- architeture,
- any code smells,
- possible improvements or bugs just from reading the code,
- atomically pinpoint each relationship between the frontend and backend (endpoints and expected transactions - ex: Request and Response Bodies and which Headers are expected)
Some Challenges come to mind: (+ things taken out of my ass)
- Hard to extract or deduce intent of developer when writing the code
- why some decision was made over another - beyond correctness, the why behind things - the circumstances
- product-led decisions - might be struggles, to go faster, to ship fast, less importance on code more importance in product
- etc etc