TODO Add other headers
Background
During my career break that I started in 2025, I started exploring the ever-changing Generative AI landscape. In Decemember, I was exploring Spring Boot as I hadn't used it in anger professionally having used other Java frameworks like Jersey, Play and I wanted to build something.
In February, everyone in the UK was talking about how it had rained everyday in 2026 so far. I thought that generative AI chatbots like our friend ChatGPT shouldn't miss out on the conversation.
So I set out to build a Model Context Protocol (MCP) server using Spring AI and developed using Cursor agents.
3 things I could tick off my tech backlog (which is probably just as long as my gaming backlog).
Result
An Accuweather MCP server that provides prompts and tools for agents to be able to find out for a location:
- The current weather
- Hourly forecast
- Daily forecast
This is available on the official MCP Registry
Here's what it looks like integrated within Claude:
I had fun building this out and thought I would wrap it up by creating this post, sharing the resources I used to learn as well as gotchas I encountered. Hopefully not only useful for future Jonathan, but others too :D
Learning
You will see a pattern here, but it's how I prefer to learn (I appreciate others may prefer to watch paint dry)
Cursor
Cursor themselves provide great resources that includes plenty of guidance, recommendations and best practises.
Model Context Protocol
If you want to get started and get to grips with the Model Context Protocol, the official documentation is great.
I even encourage anyone to read the specification as for servers it details error handling, implementation considerations and security.
Spring AI
The Spring AI reference provides plenty of guidance and recommendations around MCP as well as other parts of Genative AI such as using chat clients or RAG.
One especially helpful resource were the Spring AI examples that showcase putting everything together. For example, how to use the MCP annotations to create MCP tools.
Gotchas
Time for something more interesting, below are things that I encountered whilst building out my MCP server that took a minute to resolve and more likely help the next person.
Cursor - agents
My goal of this side project was to get used to Agentic development and minimise hand-rolling code. When I started out with a blank slate and aimed to build the current weather feature, I tried one-shotting it by generating a plan and seeing what the result was. Although it did the job, the Agent produced a lot of code to review and used patterns that I didn't want to use. So I then had to course correct with more prompts.
A lot of this is in the Cursor docs, but here's how I improved things for the next feature:
- Added guard rails: Added unit and integration tests, added auto code formatting with spotless, added code analysis using checkstyle
- Incremental rule creation: Any time an Agent got something wrong e.g. it tried to use maven to run a Gradle project, it didn't denote nullables using JSpecify; I added a rule to AGENTS.md
- Use Plan mode and auto model selection: I used Plan mode to define what I wanted and let Cursor decide on which model to use (this helped stretch the Hobby plan as far as I could before purchasing a Pro plan)
- Develop in increments: Instead of building out the daily forecast feature in one go, I got the Agent to build it out layer by layager (HTTP Client, Gateway and MCP Tool). That way I had less code to review and can course correct easier.
- Reference examples: Once I didn't have a blank slate anymore, I referenced existing code as examples so the Agent knew what patterns to follow.
By doing all of this, when it came to the hourly forecast feature, I delegated the entire thing to a Cloud Agent and only had to review the changes.
Spring AI
- turn off console logging
- Debugging using with mcp inspector or claude
- using mcp annotations
MCP registry
- use validate to confirm e.g. description length
- docker version number at end
Publishing
- use jib over semantic release plugins to support multi-arch images


Top comments (0)