Strava MCP
Integrate your Strava activity data with AI models using a local SQLite database.
Create Strava MCP
Automated setup tool for integrating Strava data with Claude Desktop via Model Context Protocol (MCP).
Quick Start
The Python equivalent of npx
is pipx
. Install and run:
# Install pipx if you don't have it
pip install pipx
# Run the setup tool (installs temporarily and executes)
pipx run create-strava-mcp
Or install globally:
# Install globally
pipx install create-strava-mcp
# Run anytime
create-strava-mcp
Or use pip + python -m:
# Install and run directly
pip install create-strava-mcp
python -m create-strava-mcp
What This Tool Does
- Downloads the Strava MCP: Clones the Python repository to your local machine
- Sets up Python Environment: Creates a virtual environment and installs dependencies
- Guides Strava API Setup: Walks you through creating a Strava API application
- Handles Authentication: Manages the OAuth flow to get your tokens
- Data Sync: Downloads your initial Strava activity data to a local SQLite database
- Claude Integration: Automatically updates your Claude Desktop config file
- Optional Restart: Can restart Claude Desktop to activate the MCP immediately
- Ready to Use: After setup, Claude will have access to your Strava data
Strava API Application Setup
The "One App for Everybody" Approach
You need to create ONE Strava API application that all users will authenticate through:
-
Register Your App (you do this once):
- Go to Strava API Settings
- Click "Create App"
- Fill in the details:
- Application Name: "Strava MCP" (or your preferred name)
- Category: Choose appropriate category
- Website:
http://localhost
- Authorization Callback Domain:
localhost
- Click "Create"
-
Share Your App Credentials:
- You'll get a
Client ID
andClient Secret
- Users will use your
Client ID
andClient Secret
- Each user gets their own personal
Access Token
andRefresh Token
- You'll get a
-
User Authentication Flow:
- Users run the setup tool with your app credentials
- They authenticate through your Strava app
- They get their own personal tokens
- Their data stays private to them
Authentication Flow Details
Your Strava App (Client ID + Secret)
↓
User runs setup tool → Browser opens → User logs into Strava
↓
User authorizes YOUR app → Gets personal tokens → Stored locally
↓
MCP uses user's personal tokens → Accesses only their data
Manual Installation
If you prefer manual setup:
# Clone your Strava MCP repository
git clone https://github.com/your-username/strava-mcp.git
cd strava-mcp
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set up environment
cp .env.example .env
# Edit .env with your Strava app credentials
# Run authentication and initial sync
python strava-sync.py
# Add to Claude config manually (see Configuration section)
Configuration
The tool automatically updates your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
- Linux:
~/.config/claude/claude_desktop_config.json
Example configuration:
{
"mcpServers": {
"strava-mcp": {
"command": "python",
"args": ["/path/to/strava-mcp/strava-mcp.py"],
"env": {
"STRAVA_CLIENT_ID": "your_client_id",
"STRAVA_CLIENT_SECRET": "your_client_secret",
"STRAVA_REFRESH_TOKEN": "users_personal_refresh_token",
"STRAVA_DB_PATH": "/path/to/strava_data.db"
}
}
}
}
For Developers: Publishing Your Setup Tool
1. Package Structure
create-strava-mcp/
├── setup_strava_mcp.py # Main setup script
├── pyproject.toml # Modern Python packaging
├── setup.py # Alternative setup file
├── README.md # This file
└── requirements.txt # Dependencies (none for setup tool)
2. Update Configuration
In setup_strava_mcp.py
, update:
# Replace with your actual Strava MCP repository
repo_url = "https://github.com/your-username/strava-mcp.git"
3. Publish to PyPI
# Build the package
python -m pip install build
python -m build
# Upload to PyPI
python -m pip install twine
python -m twine upload dist/*
4. Test Installation
# Test with pipx
pipx run create-strava-mcp
# Or test with pip
pip install create-strava-mcp
create-strava-mcp
Usage After Setup
Once set up, you can ask Claude questions about your Strava data:
- "Show me my recent running activities"
- "What's my average pace this month?"
- "Compare my performance to last year"
- "Generate a training summary"
- "Which bike have I used the most this year?"
Maintenance Commands
# Update your Strava data
cd /path/to/strava-mcp
source venv/bin/activate # On Windows: venv\Scripts\activate
python strava-sync.py
# Check MCP status
# (View Claude Desktop logs)
Troubleshooting
Setup Issues
- Python not found: Install Python 3.8+ from python.org
- Git not found: Install Git from git-scm.com
- Permission errors: Run with appropriate permissions or choose a different install directory
- Virtual environment issues: Ensure you have
venv
module:python -m pip install virtualenv
Strava API Issues
- Invalid credentials: Double-check your Client ID and Client Secret from Strava
- Authorization failed: Ensure your Strava app has the correct callback domain (
localhost
) - Token expired: The MCP automatically refreshes tokens, but you can manually re-run
strava-sync.py
- Rate limiting: Strava has API limits; wait a few minutes if you hit them
Claude Integration Issues
- MCP not appearing: Restart Claude Desktop completely
- Connection errors: Check that file paths in the config are correct
- Python not found: Ensure the Python path in Claude config points to your virtual environment
- Data not loading: Run
python strava-sync.py
in the MCP directory
Token Security
- Your App Credentials: Keep
Client ID
andClient Secret
secure but they can be shared with users - User Tokens: Each user's
Access Token
andRefresh Token
are personal and should stay private - Local Storage: All tokens are stored locally on the user's machine, never sent to you
Uninstalling
To remove the Strava MCP:
- Delete the installation directory (shown during setup)
- Remove the "strava-mcp" entry from your Claude Desktop config file
- Restart Claude Desktop
Alternative to pipx
If users don't want to install pipx, they can also use:
# Direct pip install and run
pip install create-strava-mcp
python -c "import setup_strava_mcp; setup_strava_mcp.main()"
# Or install and use entry point
pip install create-strava-mcp
create-strava-mcp
Support
If you encounter issues:
- Check the troubleshooting section above
- Check Claude Desktop logs for MCP errors
- Re-run
python strava-sync.py
to refresh data - Create an issue on the GitHub repository
Contributing
Contributions welcome! Please see the main repository for guidelines.
License
MIT License - see LICENSE file for details.
Related Servers
Gemini
Provides access to Google Gemini AI capabilities as tools.
My MCP
A remote MCP server deployable on Cloudflare Workers without authentication.
ALECS - MCP Server for Akamai
Manage Akamai's edge platform, including properties, DNS, certificates, security, and performance optimization, using AI assistants.
Cloud PC Management
Manage Azure Cloud PCs using the Microsoft Graph API.
Cloudflare Remote MCP Server
A remote MCP server deployable on Cloudflare Workers or runnable locally, requiring no authentication or external data files.
Shopify
Integrates with the Shopify API to retrieve and manipulate product information.
Remote MCP Server on Cloudflare
Deploy a remote MCP server on Cloudflare Workers with OAuth login support, using Cloudflare KV for data storage.
MCP Gemini CLI
An MCP server for Google's Gemini CLI, allowing AI assistants to leverage Gemini's capabilities.
Snowflake Cortex AI
A server for Snowflake providing tools for its Cortex AI features, including Search, Analyst, and Complete.
Remote MCP Server (Authless)
A remote MCP server without authentication, deployable on Cloudflare Workers.