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/gui-wf/purelymail-mcp-server


Presentation 23 September AI Builders Lisbon

Slides of Presentation: PDF Slides | Interactive Reveal.js

Prompts used: Starting Prompt | Implementation Plan

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 human Psychology, Team-leading, Organization (or at least on how one could organize), engineering (how things are built) and logic.


Examples of things that can be done - Curious to try one?:

Implement some tool for yourself to help with your digital work/life chores

Have any ideas?

Let’s talk -> linkedin/guiwf, [email protected]