Strava MCP Server
Access the Strava API to interact with activities, athlete information, and other Strava data.
Strava MCP Server
A Model Context Protocol (MCP) server that provides access to the Strava API. This server enables language models to interact with Strava data, including activities, athlete information, and more.
Features
- πββοΈ Activity tracking and analysis
- π Athlete statistics
- πΊοΈ Route visualization
- π Achievement tracking
- π€ Social features (kudos, comments)
Prerequisites
- Python 3.12+
- Strava API credentials
- pip (Python package installer)
Installation
- Clone the repository:
git clone https://github.com/yourusername/strava_mcp.git
cd strava_mcp
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: .\venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
Configuration
- Create a
config/.envfile with your Strava API credentials:
STRAVA_CLIENT_ID=your_client_id
STRAVA_CLIENT_SECRET=your_client_secret
STRAVA_REFRESH_TOKEN=your_refresh_token
- To obtain Strava API credentials:
- Go to https://www.strava.com/settings/api
- Create a new application
- Note down the Client ID and Client Secret
- Follow the OAuth 2.0 flow to get your refresh token
Usage
Using with Claude
Once connected, you can interact with your Strava data through Claude in various ways:
Activity Queries
- "Show me my recent activities"
- "Get details about my last run"
- "What was my longest ride this month?"
- "Show me activities where I set personal records"
- "Display the route map for my latest activity"
Performance Analysis
- "What's my average running pace this year?"
- "Compare my cycling performance between last month and this month"
- "Show me my heart rate zones from yesterday's workout"
- "What's my total elevation gain for all activities?"
- "Calculate my weekly mileage for running"
Social Interactions
- "Who gave kudos on my latest activity?"
- "Show me comments on my marathon run"
- "List all my club activities"
- "Find activities I did with friends"
Achievement Tracking
- "List all my segment achievements"
- "Show my personal records on local segments"
- "What achievements did I earn this week?"
- "Display my progress on yearly goals"
Data Available Through Claude
-
Activity Details:
- Distance, duration, pace
- Route maps and elevation profiles
- Heart rate, power, and cadence data
- Splits and lap information
- Weather conditions during activity
-
Athlete Statistics:
- Year-to-date and all-time totals
- Personal records and achievements
- Training load and fitness trends
- Equipment usage and maintenance
-
Social Data:
- Kudos and comments
- Club activities and leaderboards
- Friend activities and challenges
- Segment efforts and rankings
-
Route Information:
- Detailed maps with elevation data
- Segment analysis
- Popular routes and segments
- Route planning and analysis
As an MCP Server
Update your Claude Desktop configuration:
{
"mcpServers": {
"Strava": {
"command": "python",
"args": ["src/strava_server.py"],
"cwd": "/path/to/strava_mcp",
"env": {
"STRAVA_CLIENT_ID": "your_client_id",
"STRAVA_CLIENT_SECRET": "your_client_secret",
"STRAVA_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
As an HTTP Server
- Start the server:
./run_server.sh
- Access the API at
http://localhost:8000
Available endpoints:
- GET
/activities/recent- List recent activities - GET
/activities/{id}- Get activity details - GET
/activities/{id}/map- Get activity map visualization - GET
/athlete/stats- Get athlete statistics
Development
Project Structure
strava_mcp/
βββ src/
β βββ strava_server.py # MCP server implementation
β βββ strava_http_server.py # HTTP API server
β βββ map_utils.py # Map visualization utilities
β βββ templates.py # HTML templates
βββ config/
β βββ .env # Environment variables (not in git)
βββ requirements.txt # Python dependencies
βββ run_server.sh # Server startup script
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
Security
- Never commit
.envfiles or API credentials - The
.gitignorefile is configured to prevent sensitive data from being committed - Use environment variables for all sensitive configuration
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Strava API Documentation
- Model Context Protocol (MCP) Specification
- Contributors and maintainers
Related Servers
Remote MCP Server on Cloudflare
A remote MCP server deployable on Cloudflare Workers with OAuth login support, using Cloudflare KV for data storage.
Render MCP Server
Interact with Render resources via LLMs using the Render API.
Cloudways MCP Server
Integrates with the Cloudways API, allowing AI assistants to access and manage Cloudways infrastructure.
MCP Status Observer
Monitors the operational status of major digital platforms.
Amazon Marketplace by CData
Query live Amazon Marketplace data using CData's read-only MCP server.
Bigeye MCP Server
Interact with Bigeye's data quality monitoring platform via its Datawatch API. Supports dynamic API key authentication.
Apillon MCP Server
Interact with Apillon's Storage, Hosting, and NFT modules.
Multi-Cloud VM MCP Server
Manage virtual machines across multiple cloud providers, including AWS EC2, Azure Virtual Machines, and GCP Compute Engine.
Ankr API MCP Server
Access blockchain data using the Ankr API.
DeAI API MCP Server
Interact with the DeAI API for token analysis, holder tracking, and wallet portfolio analytics on Ethereum.