The Strava MCP Server provides a bridge between Large Language Models and the Strava API, allowing AI assistants to access and interact with your Strava data through the Model Context Protocol (MCP) standard. With this server, you can query your activities, analyze workout data, manage segments, and export routes - all through natural language conversations.
Clone Repository:
git clone https://github.com/r-huijts/strava-mcp.git
cd strava-mcp
Install Dependencies:
npm install
Build the Project:
npm run build
Update your Claude configuration file:
{
"mcpServers": {
"strava-mcp-local": {
"command": "node",
"args": [
"/absolute/path/to/your/strava-mcp/dist/server.js"
]
}
}
}
Make sure to replace /absolute/path/to/your/strava-mcp/
with the actual path to your installation.
localhost
npx tsx scripts/setup-auth.ts
Follow the prompts to complete the authentication flow.
After completing all the above steps, restart Claude Desktop for the changes to take effect.
If you want to use the route export tools, specify a directory for saving exported files:
Edit your .env
file and add/update the ROUTE_EXPORT_PATH
variable:
# Example: ROUTE_EXPORT_PATH=/Users/your_username/strava-exports
ROUTE_EXPORT_PATH=
Replace the placeholder with the absolute path to your desired export directory.
You can ask questions like:
For detailed workout analysis:
To see your performance stats:
For segment exploration and management:
For route management and export:
The server implements automatic token refreshing. When the initial access token expires (typically after 6 hours), the server will automatically use the refresh token to obtain new tokens, ensuring continuous operation.
You can retrieve detailed time-series data for deep analysis:
Get the power and heart rate streams from my last ride with high resolution.
This allows you to analyze specific metrics throughout your activity, perfect for visualizing performance or identifying patterns.
For structured workouts, you can analyze lap data:
Show me the laps from my interval training yesterday. What was my average heart rate for each interval?
This helps you understand performance variations across different segments of your workout.
The server provides numerous tools including:
get-recent-activities
: Fetches your recent Strava activitiesget-athlete-profile
: Retrieves your profile informationget-athlete-stats
: Shows activity statisticsget-activity-details
: Gets details for a specific activityget-activity-streams
: Retrieves time-series data (heart rate, power, etc.)explore-segments
: Searches for segments in a geographical arealist-athlete-routes
: Shows your saved routesexport-route-gpx
/export-route-tcx
: Exports routes to GPX/TCX formatEach tool is designed to work seamlessly with natural language queries through your AI assistant.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "strava-mcp-local" '{"command":"node","args":["/absolute/path/to/your/strava-mcp/dist/server.js"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"strava-mcp-local": {
"command": "node",
"args": [
"/absolute/path/to/your/strava-mcp/dist/server.js"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"strava-mcp-local": {
"command": "node",
"args": [
"/absolute/path/to/your/strava-mcp/dist/server.js"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect