Strava MCP Server

Strava MCP Server

Integrates with the Strava API to allow AI assistants to access fitness data including athlete profiles, activity history, and segment statistics. It enables users to query detailed performance metrics and explore geographic segment data through natural language commands.

Category
Visit Server

README

Strava MCP Server

A Model Context Protocol (MCP) server that integrates with the Strava API, allowing AI assistants to access your Strava fitness data.

Features

  • Fetch athlete profile and statistics
  • List and query activities
  • Access segment data and efforts
  • Explore segments by geographic area
  • View starred segments

Prerequisites

  • Node.js 18 or higher
  • A Strava account
  • Strava API credentials (Client ID and Client Secret)

Installation

  1. Clone this repository:
git clone https://github.com/juanlarreapm/strava-mcp-server.git
cd strava-mcp-server
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Strava API Setup

Before using this server, you need to create a Strava API application:

  1. Go to https://www.strava.com/settings/api
  2. Create a new application
  3. Set the Authorization Callback Domain to localhost
  4. Note your Client ID and Client Secret

Getting OAuth Tokens

Run the authentication setup script to obtain your access tokens:

node setup-auth.cjs

This will:

  1. Prompt you for your Client ID and Client Secret
  2. Open a browser for Strava authorization
  3. Display your access token, refresh token, and other credentials

Keep these credentials secure - you'll need them to configure the MCP server.

Configuration

The server requires the following environment variables:

  • STRAVA_ACCESS_TOKEN - Your Strava access token (required)
  • STRAVA_REFRESH_TOKEN - Your refresh token (optional, for token renewal)
  • STRAVA_CLIENT_ID - Your Strava application Client ID (optional)
  • STRAVA_CLIENT_SECRET - Your Strava application Client Secret (optional)

For Claude Desktop

Add this to your Claude Desktop MCP settings file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "strava": {
      "command": "node",
      "args": ["/path/to/strava-mcp-server/dist/index.js"],
      "env": {
        "STRAVA_ACCESS_TOKEN": "your_access_token_here",
        "STRAVA_REFRESH_TOKEN": "your_refresh_token_here",
        "STRAVA_CLIENT_ID": "your_client_id_here",
        "STRAVA_CLIENT_SECRET": "your_client_secret_here"
      }
    }
  }
}

For Other MCP Clients

Create a .env file in the project root (see .env.example):

STRAVA_ACCESS_TOKEN=your_access_token_here
STRAVA_REFRESH_TOKEN=your_refresh_token_here
STRAVA_CLIENT_ID=your_client_id_here
STRAVA_CLIENT_SECRET=your_client_secret_here

Available Tools

The server exposes the following tools:

get_athlete_profile

Get the authenticated athlete's profile information.

get_athlete_stats

Get detailed statistics including totals and recent activity counts.

list_activities

List recent activities with optional pagination and time filtering.

Parameters:

  • before (number): Unix timestamp to get activities before this time
  • after (number): Unix timestamp to get activities after this time
  • page (number): Page number (default: 1)
  • per_page (number): Items per page (default: 30, max: 200)

get_activity

Get detailed information about a specific activity.

Parameters:

  • id (string, required): The activity ID
  • include_all_efforts (boolean): Include all segment efforts

get_segment

Get information about a specific segment.

Parameters:

  • id (string, required): The segment ID

list_starred_segments

List segments starred by the athlete.

Parameters:

  • page (number): Page number
  • per_page (number): Items per page

explore_segments

Explore segments in a geographic area.

Parameters:

  • bounds (string, required): Coordinates as sw_lat,sw_lng,ne_lat,ne_lng
  • activity_type (string): Either running or riding
  • min_cat (number): Minimum climb category (0-5)
  • max_cat (number): Maximum climb category (0-5)

get_segment_efforts

Get efforts on a specific segment.

Parameters:

  • segment_id (string, required): The segment ID
  • start_date_local (string): ISO 8601 formatted start date
  • end_date_local (string): ISO 8601 formatted end date
  • per_page (number): Items per page

Development

Build

npm run build

Watch mode

npm run watch

Run locally

npm start

Token Expiration

Strava access tokens expire after 6 hours. To handle token refresh:

  1. Store your refresh token securely
  2. Implement token refresh logic using the Strava OAuth token endpoint
  3. Or run setup-auth.cjs again to get fresh tokens

Rate Limits

Strava API has rate limits:

  • 100 requests per 15 minutes
  • 1000 requests per day

Plan your usage accordingly.

Troubleshooting

"STRAVA_ACCESS_TOKEN environment variable is required"

Make sure you've set the access token in your MCP configuration or environment variables.

"Strava API error: 401"

Your access token may have expired. Run setup-auth.cjs to get a new token.

"Authorization Callback Domain" error

Ensure you've set the callback domain to localhost in your Strava API settings.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Resources

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured