Claude, what do you think to my running?

Anyone that knows me, knows that I enjoy getting out into the hills and running, and if you let me, it’s all I’ll talk about.

That passion for running combines nicely with another passion of mine: data. If you log your runs to a platform like Strava, then you’ll know that there’s a lot of information for you to pore over. I find myself doing this more than I care to admit!

I enjoy digging into the specifics of a run or workout, seeing how my perceived effort maps onto real, hard data, and figuring out where I could improve. But it got me thinking: what would Claude or ChatGPT make of my running activities? Could they suggest improvements? Could they understand trends?

Recently, Anthropic (the people behind Claude) released something called Model Context Protocol (MCP, for short). Large language models like Claude need context to understand how best to answer your question and often, they have learnt enough context to answer your question without you needing to provide it. But there are times when you might want Claude to use up-to-date information from the internet. This is where MCP comes in - it’s a standardised way to connect models to different data sources, like the internet.

It’s also a method to make models like Claude more agentic, i.e., they can figure out that they need to fetch some information from the internet without you having to ask them. MCP is cool and for a more in-depth understanding, Anthropic have written a guide.

Connecting Strava to Claude

By default, Claude doesn’t have access to my Strava data. If you ask it, it’ll tell you:

To connect Claude to my Strava data, I built a simple MCP server. The server runs locally on my laptop and interacts with the Strava API and the Meteostat platform for weather data.

The server exposes two tools to Claude, one to fetch a collection of activities and another to fetch a specific activity. Both tools have a set of parameters that Claude can configure, for example, when fetching a collection of activities, the number of activities and start and end dates can be specified.

Those dates enable Claude to ask for a collection of activities between two dates, e.g., you could ask “Tell me about my activities over the past five days”:

The other tool is to fetch information about a specific activity. Strava’s API provides an endpoint to get a collection of activities, but the information in each of those is limited. To get more information, e.g., segments, splits, and efforts, you have to query the API for a specific activity (more information here).

I did a run a couple of days ago that I called “Lemon Squeezy” because it was an easy run, naturally. Here’s Claude telling me about it:

If we put it all together, first asking Claude about activities over the past week and then using its output to ask a follow up question, this is the result:

You can see that Claude first fetches all activities from this week and provides an analysis. From there, I ask it about a specific run using part of the activity name and Claude extracts the activity name from the week’s activities, uses the tool to fetch a specific activity using the name, and presents back a more detailed analysis. Pretty cool.

There’s loads more that could be done here, e.g., looking at longer term trends or whether seasonality plays a role in my running.

Claude, what do you think to my running?

Claude can now fetch information about activities from Strava, knows how to use date to narrow down the search, and can provide an analysis of the data. But, does Claude have any more in-depth thoughts about my running? Are there any improvements I could make?

There are some good suggestions in there, particularly around recovery (even though I do have dedicated rests, honest) and adding in more flat speedwork (I’m more of a trail runner than road runner).

Roast me Claude

So, we’ve shown that Claude can work with Strava data and has some good suggestions on improvements. But, we could make it more fun. Let’s see what Claude really thinks.

Ouch. My girlfriend absoultely deserves a medal, and I live for those single thumbs up on my runs - you know who you are, thank you :pray:

Thanks Claude.

General Thoughts

Claude is pretty good at understanding what tools it needs to use to generate output. For example, when playing around with the Strava MCP, I found that Claude would fail to get the information it needed and then attempt to use the other tools available to get it, pretty cool.

The MCP does require good docstrings for Claude to understand what tools to use, what the parameters mean, and what format they should be in. If you’re a good engineer, this is standard practise.

Overall, getting an MCP up and running is impressively simple and it’s pretty cool seeing how a model like Claude is able to figure out what tools it needs to generate satisfactory output.

If you fancy seeing what Claude has to say about your Strava activities, you can find the Strava MCP server on my Github: https://github.com/JonoCX/strava-mcp