Skip to main content
Glama

Strava MCP 서버

CI/CD 파이프라인 코드코브

Strava API와 상호 작용하기 위한 MCP(Model Context Protocol) 서버입니다.

사용자 가이드

설치

uvx 사용하여 Strava MCP를 쉽게 설치할 수 있습니다:

지엑스피1

Strava 자격 증명 설정

  1. Strava API 애플리케이션 만들기 :

    • https://www.strava.com/settings/api 로 이동하세요

    • 클라이언트 ID와 클라이언트 비밀번호를 얻기 위해 새 애플리케이션을 만드세요.

    • "인증 콜백 도메인"에 localhost 입력하세요.

  2. 자격 증명 구성 : 자격 증명 파일을 만듭니다(예: ~/.ssh/strava.sh ):

    export STRAVA_CLIENT_ID=your_client_id
    export STRAVA_CLIENT_SECRET=your_client_secret
  3. Claude Desktop 구성 : Claude 구성에 다음을 추가합니다( /Users/<username>/Library/Application Support/Claude/claude_desktop_config.json ):

    "strava": {
        "command": "bash",
        "args": [
            "-c",
            "source ~/.ssh/strava.sh && uvx strava-mcp"
        ]
    }

입증

Strava MCP 도구를 처음 사용하는 경우:

  1. 인증 흐름이 자동으로 시작됩니다.

  2. 브라우저에서 Strava 인증 페이지가 열립니다.

  3. 승인 후 로컬 페이지로 다시 리디렉션됩니다.

  4. 새로 고침 토큰은 나중에 사용할 수 있도록 자동으로 저장됩니다.

사용 가능한 도구

사용자 활동 가져오기

인증된 사용자에 대한 활동을 검색합니다.

매개변수:

  • before (선택 사항): 필터링을 위한 Epoch 타임스탬프

  • after (선택 사항): 필터링을 위한 Epoch 타임스탬프

  • page (선택 사항): 페이지 번호(기본값: 1)

  • per_page (선택 사항): 페이지당 항목 수(기본값: 30)

활동 받기

특정 활동에 대한 자세한 정보를 얻습니다.

매개변수:

  • activity_id : 활동의 ID

  • include_all_efforts (선택 사항): 세그먼트 작업 포함(기본값: false)

활동 세그먼트 가져오기

특정 활동에서 세그먼트를 검색합니다.

매개변수:

  • activity_id : 활동의 ID

세그먼트 리더보드 받기

특정 세그먼트의 리더보드를 가져옵니다.

매개변수:

  • segment_id : 세그먼트의 ID

  • 다양한 선택 필터(성별, 연령대 등)

Related MCP server: Strava MCP Server

개발자 가이드

프로젝트 설정

  1. 저장소를 복제합니다.

    git clone <repository-url>
    cd strava
  2. 종속성 설치:

    uv install
  3. 환경 변수 설정:

    export STRAVA_CLIENT_ID=your_client_id
    export STRAVA_CLIENT_SECRET=your_client_secret

    또는 이러한 변수를 사용하여 .env 파일을 만듭니다.

개발 모드에서 실행

MCP CLI로 서버를 실행합니다.

mcp dev strava_mcp/main.py

수동 인증

다음을 실행하여 수동으로 새로 고침 토큰을 얻을 수 있습니다.

python get_token.py

프로젝트 구조

  • strava_mcp/ : 메인 패키지 디렉토리

    • __init__.py : 패키지 초기화

    • config.py : pydantic-settings를 사용한 구성 설정

    • models.py : Strava API 엔터티에 대한 Pydantic 모델

    • api.py : Strava용 저수준 API 클라이언트

    • auth.py : Strava OAuth 인증 구현

    • oauth_server.py : 독립형 OAuth 서버 구현

    • service.py : 비즈니스 로직을 위한 서비스 계층

    • server.py : MCP 서버 구현

  • tests/ : 단위 테스트

  • strava_mcp/main.py : 서버를 실행하기 위한 주요 진입점

  • get_token.py : 새로 고침 토큰을 수동으로 가져오는 유틸리티 스크립트

테스트 실행

pytest

PyPI에 게시

패키지 빌드

# Build both sdist and wheel
uv build

PyPI에 게시

# Publish to Test PyPI first
uv publish --index testpypi

# Publish to PyPI
uv publish

특허

MIT 라이센스

감사의 말

Available Tools

3 tools
get_activityC

Get details of a specific activity.

Args: ctx: The MCP request context activity_id: The ID of the activity include_all_efforts: Whether to include all segment efforts

Returns: The activity details

Inputs: activity_id (required), include_all_efforts.

get_activity_segmentsC

Get the segments of a specific activity.

Args: ctx: The MCP request context activity_id: The ID of the activity

Returns: List of segment efforts for the activity

Inputs: activity_id (required).

get_user_activitiesB

Get the authenticated user's activities.

Args: ctx: The MCP request context before: An epoch timestamp for filtering activities before a certain time after: An epoch timestamp for filtering activities after a certain time page: Page number per_page: Number of items per page

Returns: List of activities

Inputs: before, after, page, per_page.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: get_activity retrieves details of a specific activity, get_activity_segments focuses on segments within an activity, and get_user_activities lists the user's activities. The descriptions clearly differentiate these functions, making tool selection unambiguous for an agent.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with snake_case (get_activity, get_activity_segments, get_user_activities). The naming is predictable and readable, using 'get' as the verb throughout, which aligns well with the read-only nature of these tools.

    Tool Count2/5

    With only 3 tools, this server feels under-scoped for a Strava integration, which typically involves activities, segments, athletes, and more. While the tools cover some read operations, the count is too low to support comprehensive agent workflows, such as creating or updating activities, which are common in fitness tracking domains.

    Completeness2/5

    The tool surface is severely incomplete for a Strava server, as it only includes read operations (get) with no support for create, update, or delete actions. There are significant gaps, such as missing tools for managing segments, athletes, or uploading activities, which will likely cause agent failures when attempting full interactions with the Strava API.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that provides language models with access to Strava API data, allowing them to query and analyze athlete activities from Strava.
      4
      25
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables language models to interact with Strava data, including activities, athlete statistics, routes, achievements, and social features.
      6
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      An MCP server that enables interaction with the Strava API v3 to manage fitness activities, athlete profiles, segments, and routes. It supports retrieving detailed performance metrics, exploring geographic data, and managing club information through natural language.
      33
      PolyForm Noncommercial 1.0.0