CS

ctvidic/strava-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

6 stars 5 forks 质量 64 趋势 14MIT

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.

概览

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. - 🏃‍♂️ Activity tracking and analysis - 📊 Athlete statistics - 🗺️ Route visualization - 🏆 Achievement tracking - 🤝 Social features (kudos, comments) - Python 3.12+ - Strava API credentials - pip (Python package installer) 1. Create a config/.env file with your Strava API credentials: 2. 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 Once connected, you can interact with your Strava data through Claude in various ways: - "Show me my recent activities" - "Get details about my last run" - "What was my longest ride this month?

README

以下为原文 README 节选,完整内容请查看原文。

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

  1. Clone the repository:
git clone https://github.com/yourusername/strava_mcp.git
cd strava_mcp
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: .\venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Configuration

  1. Create a config/.env file with your Strava API credentials:
STRAVA_CLIENT_ID=your_client_id
STRAVA_CLIENT_SECRET=your_client_secret
STRAVA_REFRESH_TOKEN=your_refresh_token
  1. To obtain Strava API credentials:

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

  1. Activity Details:

    • Distance, duration, pace
    • Route maps and elevation profiles
    • Heart rate, power, and cadence data
    • Splits and lap information
    • Weather conditions during activity
  2. Athlete Statistics:

    • Year-to-date and all-time totals
    • Personal records and achievements
    • Training load and fitness trends
    • Equipment usage and maintenance
  3. Social Data:

    • Kudos and comments
    • Club activities and leaderboards
    • Friend activities and challenges
    • Segment efforts and rankings
  4. Route Information:

    • Detailed maps with elevation data
    • Segment analysis
    • Popular routes and segments
    • Route planning and analysis

As an MCP Server

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "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" } } } }