Logo SportsMCP

SportsMCP

Cộng đồng
gabeperez

Personal MCP server for Strava with OAuth authentication, beautiful dashboard, and personal MCP URLs for AI assistants

Nhà phát hànhgabeperez
Kho mãstrava-mcp
Ngôn ngữTypeScript
Bản fork
10
Sao
19
Công cụ có sẵn
0
Phương thức truyền tảistdio, streamable-http
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    SportsMCP cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    19 sao và 10 bản fork từ kho mã được liên kết.

🏃 SportMCP — Strava for Any AI Agent

Production-ready MCP server for Strava — works with Claude Desktop, Cursor, Windsurf, Cline, Continue.dev, Poke, and any MCP-compatible AI agent.

Deploy to Cloudflare Workers

Cloudflare Workers GitHub MCP Protocol Compatible with Strava License: MIT

A complete Model Context Protocol server that gives any AI assistant secure, read-only access to your personal Strava fitness data. Deploy once to Cloudflare Workers, authenticate with Strava, and paste your personal MCP URL into whichever AI tools you use.

Compatible with Strava. SportMCP is not affiliated with, endorsed, or sponsored by Strava.

✨ Features

  • 🤖 Works with any MCP client — Claude Desktop, Cursor, Windsurf, Cline, Continue.dev, Poke, and more
  • 🔐 Secure OAuth — Standard Strava OAuth 2.0, per-user token isolation
  • 🏃 21 MCP Tools — Activities, laps, kudos, comments, segments, segment efforts, routes, gear, clubs, athlete zones, and more
  • 🔔 Optional Webhooks — Real-time Poke notifications when workouts complete (per-user keys)
  • 🔄 Auto Token Refresh — Tokens renew automatically before expiry
  • 🎨 Dashboard — Web UI with one-click config snippets for every major AI agent
  • ⚡ Edge Performance — Cloudflare Workers global network, <50ms response times
  • 💰 Free Tier — 100k requests/day at zero cost
  • 🛡️ Compliance — Full Strava API agreement compliance, deauth cleanup within 48h

🚀 Quick Start

Note: Deploying to Cloudflare requires some terminal commands, but we've made it as simple as possible!

Click a button, then run one command

Best for users who prefer clicking buttons over typing commands.

⚠️ Make sure to copy/duplicate the Repo First ⚠️

Step 1: Click Deploy to Cloudflare

Deploy to Cloudflare Workers

This will:

  1. Deploy it to your Cloudflare account
  2. Give you a worker URL

Step 2: Finish Configuration

After deployment, you need to configure secrets and webhooks:

  1. Open Terminal (Mac: Cmd+Space, type "Terminal" | Windows: search "PowerShell")

  2. Clone YOUR fork and run setup:

    bash
    # Replace YOUR-USERNAME with your GitHub username
    git clone https://github.com/YOUR-USERNAME/strava-mcp.git
    cd strava-mcp
    npm install
    node scripts/setup.js
  3. Answer the prompts:

  4. Done! Visit your worker URL and authenticate with Strava.

Copy & paste 5 commands, answer a few questions, done!

Best for users comfortable with terminal commands.

This automated script handles everything: forking, database creation, configuration, secrets, webhooks, and deployment.

Step 1: Open Terminal

  • Mac: Press Cmd+Space, type "Terminal", press Enter
  • Windows: Search "Command Prompt" or "PowerShell"

Step 2: Copy & Paste These Commands

Paste these commands one at a time (press Enter after each):

bash
# Download the project
git clone https://github.com/gabeperez/strava-mcp.git

# Go into the folder
cd strava-mcp

# Install dependencies (takes ~30 seconds)
npm install

# Login to Cloudflare (opens browser - just click "Allow")
wrangler login

# Run automated setup (asks you a few questions, then does everything!)
node scripts/setup.js

Step 3: Answer the Prompts

The script will ask you for:

  1. Strava Client ID - Get from strava.com/settings/api
  2. Strava Client Secret - Same page as above
  3. Set up webhooks? - Type "y" for push notifications (optional)
  4. Poke API Key - If you said yes to webhooks, get from poke.com/settings/advanced

Step 4: Done! 🎉

The script automatically:

  • ✅ Creates your database (KV namespace)
  • ✅ Updates all configuration files
  • ✅ Sets your secrets securely
  • ✅ Sets up webhooks (if you chose yes)
  • ✅ Deploys to Cloudflare
  • ✅ Gives you your worker URL

Step 5: Visit Your Dashboard

  1. Open the URL the script gave you (looks like https://sportmcp.yourname.workers.dev)
  2. Click "Authenticate with Strava"
  3. You'll see your beautiful dashboard with:
    • 🏃 Recent activities
    • 📊 Performance stats
    • 🔗 Personal MCP URL for AI assistants
    • 🔔 Webhook status (if enabled)

Step 6: Connect to your AI agent

Copy your personal MCP URL from the dashboard and add it to your preferred AI agent:


🤖 Connecting to AI Agents

SportMCP uses the standard Model Context Protocol, so it works with any MCP-compatible client. Your personal URL looks like:

https://your-worker.workers.dev/mcp?token=YOUR_TOKEN

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{
  "mcpServers": {
    "sportmcp": {
      "url": "https://your-worker.workers.dev/mcp?token=YOUR_TOKEN"
    }
  }
}

Restart Claude Desktop after saving.

Cursor

Go to Settings → Cursor Settings → MCP and add:

json
{
  "mcpServers": {
    "sportmcp": {
      "url": "https://your-worker.workers.dev/mcp?token=YOUR_TOKEN"
    }
  }
}

Windsurf

Go to Settings → Cascade → MCP Servers and add the same JSON block as Cursor above.

Cline (VS Code)

Open Cline → MCP Servers → Edit Config and add the same JSON block.

Continue.dev

Add to ~/.continue/config.json:

json
{
  "mcpServers": [
    {
      "name": "sportmcp",
      "transport": {
        "type": "streamable-http",
        "url": "https://your-worker.workers.dev/mcp?token=YOUR_TOKEN"
      }
    }
  ]
}

Poke

Go to Settings → Integrations → Add MCP Server and paste your MCP URL directly.

Any other MCP client

Two transports are available:

  • Streamable HTTP (recommended): POST /mcp?token=YOUR_TOKEN
  • HTTP+SSE (legacy, e.g. older Claude Desktop): GET /sse?token=YOUR_TOKEN + POST /messages?token=YOUR_TOKEN

That's it! Ask your AI: "Show me my recent Strava workouts" 🎉

For developers who want full control

If you prefer to configure everything manually instead of using the automated script:

Prerequisites:

Commands to run:

bash
# 1. Download and install
git clone https://github.com/gabeperez/strava-mcp.git
cd strava-mcp
npm install

# 2. Login to Cloudflare (opens browser)
wrangler login

# 3. Create database (KV namespace)
wrangler kv:namespace create STRAVA_SESSIONS
# Copy the "id" from output and paste into wrangler.jsonc

# 4. Set your Strava API credentials
wrangler secret put STRAVA_CLIENT_ID
# Paste your Client ID when prompted

wrangler secret put STRAVA_CLIENT_SECRET
# Paste your Client Secret when prompted

# 5. Deploy to Cloudflare
npm run deploy

# 6. Visit your worker URL to authenticate
open https://your-worker-name.your-subdomain.workers.dev/auth

Optional: Set up webhooks

bash
wrangler secret put STRAVA_WEBHOOK_VERIFY_TOKEN
wrangler secret put POKE_API_KEY

See README_DEPLOY.md for detailed manual setup guide.

🔔 Real-time Webhooks (Optional)

⚠️ Personal Use Only: Webhooks currently send notifications to a single Poke API key. Only enable if you're the sole user of this deployment. Multi-user webhook support coming soon.

Get instant push notifications via Poke when you finish workouts!

🏃 New Strava Workout!

**Morning Run**
Type: Run
Date: Oct 29, 2025 7:30 AM
Distance: 10.5 km
Duration: 52 minutes
Pace: 4:57 min/km
Elevation: 120m
Avg HR: 145 bpm
🏆 2 PRs!

Sent instantly to your phone via iMessage/SMS when you complete an activity!

Quick Webhook Setup

bash
# 1. Set Poke API key (get from https://poke.com/settings/advanced)
wrangler secret put POKE_API_KEY

# 2. Set webhook verification token
wrangler secret put STRAVA_WEBHOOK_VERIFY_TOKEN
# Enter: STRAVA_MCP_WEBHOOK

# 3. Test endpoint
node scripts/manage-webhook.js test

# 4. Create subscription
STRAVA_CLIENT_ID=xxx STRAVA_CLIENT_SECRET=xxx \
node scripts/manage-webhook.js create

# 5. Monitor events
wrangler tail

See WEBHOOK_SETUP.md for complete instructions

📚 Available MCP Tools (21 Total)

Ask your AI assistant natural language questions, and these tools will be called automatically:

Activities

ToolExample Query
get-recent-activities"Show me my last 5 workouts"
get-activity-details"Get details for my last ride"
get-activity-streams"Show me heart rate data from my last run"
get-activity-laps"What were my lap splits?"
get-activity-kudos"Who gave me kudos on my run?"
get-activity-comments"What comments did I get?"

Athlete

ToolExample Query
get-athlete-profile"What's my Strava profile info?"
get-athlete-stats"What are my cycling stats this year?"
get-athlete-zones"What are my heart rate training zones?"
get-athlete-clubs"What Strava clubs am I in?"
get-athlete-routes"List my saved routes"

Segments

ToolExample Query
get-starred-segments"What segments have I starred?"
explore-segments"Find climbing segments near San Francisco"
get-segment"Tell me about segment 1234"
get-segment-efforts"What are my best efforts on this segment?"
get-segment-effort"Get details for segment effort 5678"

Gear & Social

ToolExample Query
get-gear"How many miles are on my running shoes?"
get-club"Tell me about my cycling club"
get-route"Get details for my weekend route"
authenticate-strava"How do I connect my Strava account?"
welcome-strava-mcp"How do I get started?"

🌐 Endpoints

EndpointPurpose
/Landing page & documentation
/authStart OAuth flow
/dashboard?token=xxxPersonal dashboard with stats
/mcpMCP server endpoint (for AI assistants)
/webhookStrava webhook receiver (optional)
/test-pokeTest Poke integration

🎯 Usage Examples

With Poke

  1. Add MCP server in Poke settings
  2. Use URL: https://your-worker-url.workers.dev/mcp
  3. Ask: "What was my pace on yesterday's run?"

With Claude Desktop

Add to claude_desktop_config.json:

json
{
  "mcpServers": {
    "strava": {
      "url": "https://your-worker-url.workers.dev/mcp"
    }
  }
}

Natural Language Queries

  • "Show me my recent Strava activities"
  • "What was my heart rate during my last run?"
  • "Get power data from yesterday's bike ride"
  • "Find challenging segments near Boulder"
  • "What are my all-time cycling stats?"

🔒 Security Features

  • Device Fingerprinting - Automatic authentication by browser
  • Token Refresh - Seamless renewal before expiration
  • Per-user Isolation - Complete data separation
  • Secure Storage - KV encryption for tokens
  • CSRF Protection - State validation in OAuth flow
  • Rate Limiting - Respects Strava API quotas

🏗️ Architecture

┌─────────────────┐    ┌──────────────────────┐    ┌─────────────────┐
│  AI Assistant   │───▶│  Cloudflare Worker   │───▶│   Strava API    │
│  (Poke/Claude)  │    │                      │    │                 │
│                 │    │ • MCP Server         │    │ • Activities    │
│ Natural Language│    │ • OAuth Handler      │    │ • Segments      │
│ Queries         │    │ • Device Auth        │    │ • Routes        │
│                 │    │ • Token Manager      │    │ • Stats         │
│                 │    │ • Webhook Handler    │    │                 │
└─────────────────┘    └──────────────────────┘    └─────────────────┘
                                 │                           │
                                 ▼                           ▼
                       ┌──────────────────┐       ┌─────────────────┐
                       │   Cloudflare KV  │       │   Poke API      │
                       │  • Sessions      │       │  • Push Notify  │
                       │  • OAuth Tokens  │       │  • iMessage/SMS │
                       │  • Activity Data │       └─────────────────┘
                       └──────────────────┘

📖 Documentation

🛠️ Tech Stack

  • Runtime: Cloudflare Workers (V8 isolates)
  • Framework: Hono (lightweight web framework)
  • Storage: Cloudflare KV (sessions & tokens)
  • Protocol: Model Context Protocol (MCP)
  • Auth: Strava OAuth 2.0
  • Notifications: Poke API (optional)

💰 Pricing

100% Free! Runs on Cloudflare's generous free tier:

  • Workers: 100,000 requests/day
  • KV Storage: 100,000 reads/day, 1,000 writes/day
  • Bandwidth: Unlimited on free tier

Perfect for personal use. No credit card required.

🔧 Development

Local Testing

bash
# Install dependencies
npm install

# Start local server
wrangler dev

# Visit http://localhost:8787

Run Tests

bash
npm test

Environment Variables

See .env.example for all configuration options.

🐛 Troubleshooting

"Authentication Required" error

  • Visit /auth to re-authenticate
  • Make sure you're using the same browser/device
  • Check /status endpoint to verify session

"Invalid Callback Domain"

  • Verify Strava app callback domain matches worker URL exactly
  • Don't include protocol (http://) or path (/callback)

Not receiving webhook events

  • Run node scripts/manage-webhook.js view to check subscription
  • Monitor logs with wrangler tail
  • Verify athlete is authenticated (visit /dashboard)
  • Check Strava app has correct OAuth scopes

Poke notifications not working

  • Verify POKE_API_KEY is set: wrangler secret list
  • Test manually: curl -X POST https://your-worker-url.workers.dev/test-poke
  • Check logs for Poke API errors

"KV namespace not found"

  • Create namespace: wrangler kv:namespace create STRAVA_SESSIONS
  • Update ID in wrangler.jsonc

"Deployment failed"

  • Verify logged in: wrangler whoami
  • Check syntax in wrangler.jsonc
  • Ensure all secrets are set

🗺️ Roadmap

Coming Soon

  • Multi-user Webhook Support - Per-user notification keys and routing
  • More Notification Channels - Discord, Slack, email, etc.
  • Activity Analytics - Trends, insights, and training load tracking
  • Custom Webhook Filters - Choose which activities trigger notifications

Interested in contributing to any of these? Open a discussion!

🤝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

MIT License - see LICENSE file for details.

🙏 Credits

⭐ Star History

If this project helped you, consider giving it a star!


Made with ❤️ for athletes who love data

Report Bug · Request Feature · Discussions

Cài đặt

TypingMind
{
  "mcpServers": {
    "strava-mcp": {
      "command": "node",
      "args": [
        "scripts/setup.js"
      ]
    }
  }
}

Dùng MCP SportsMCP với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối SportsMCP, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. Bạn có thể chạy MCP ngay trên thiết bị của mình hoặc kết nối qua URL của máy chủ MCP từ xa.

Cách 1: Dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm SportsMCP làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của SportsMCP.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "strava-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sportsmcp"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của SportsMCP, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của SportsMCP.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng SportsMCP giúp tôi làm việc này không?
SportsMCP
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng SportsMCP.

Cách 2: Thêm URL máy chủ MCP

Dùng cách này khi SportsMCP đã được lưu trữ từ xa hoặc nhóm của bạn muốn có một trình kết nối dùng chung cho nhiều người dùng.

1

Mở mục Trình kết nối MCP

Trong TypingMind, vào Plugin, mở mục Trình kết nối MCP, rồi chọn Thêm URL.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Vào mục Plugin.
  3. Mở mục Trình kết nối MCP.
  4. Nhấp vào Thêm URL.
Biểu mẫu Thêm URL máy chủ MCP tùy chỉnh của TypingMind
2

Dán URL máy chủ

Nhập https://your-worker-url.workers.dev/mcp vào trường URL máy chủ. Thêm tên kết nối, mô tả, biểu tượng, header HTTP tùy chỉnh hoặc cài đặt ứng dụng khách OAuth nếu máy chủ yêu cầu.

  1. Dán https://your-worker-url.workers.dev/mcp vào trường URL máy chủ.
  2. Nhập tên kết nối cho SportsMCP.
  3. Thêm mô tả và biểu tượng nếu bạn muốn dễ nhận biết kết nối hơn.
  4. Thêm header HTTP tùy chỉnh hoặc thông tin ứng dụng khách OAuth nếu máy chủ yêu cầu xác thực.
3

Tạo kết nối

Nhấp vào Tạo kết nối, sau đó quay lại danh sách Plugin và xác nhận kết nối MCP mới đang hoạt động.

  1. Nhấp vào Tạo kết nối.
  2. Quay lại danh sách trình kết nối MCP.
  3. Xác nhận kết nối SportsMCP hiển thị trạng thái đang hoạt động.
  4. Làm mới danh sách plugin nếu kết nối chưa xuất hiện ngay.
4

Đổi mô hình mà không cần kết nối lại

Bắt đầu cuộc trò chuyện với mô hình bạn thích, bật các công cụ của SportsMCP trong mục Plugin và chuyển sang mô hình khác khi cần. Kết nối MCP vẫn sẵn dùng trong không gian làm việc TypingMind.

  1. Bắt đầu cuộc trò chuyện mới trong TypingMind.
  2. Chọn mô hình AI bạn muốn dùng.
  3. Bật các công cụ của SportsMCP trong mục Plugin.
  4. Yêu cầu mô hình dùng công cụ khi cần.
  5. Chuyển sang mô hình AI khác và dùng lại cùng kết nối MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng SportsMCP giúp tôi làm việc này không?
SportsMCP
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng SportsMCP.

Câu hỏi thường gặp

Máy chủ MCP SportsMCP dùng để làm gì?

SportsMCP là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP SportsMCP với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng SportsMCP với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP SportsMCP với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối SportsMCP, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP SportsMCP với TypingMind?

Bạn có thể kết nối SportsMCP trong TypingMind bằng trình kết nối MCP cục bộ hoặc bằng cách thêm URL máy chủ MCP từ xa. Dùng trình kết nối cục bộ khi máy chủ cần truy cập tệp, ứng dụng hoặc tài nguyên riêng trên thiết bị của bạn; dùng URL máy chủ khi máy chủ MCP được lưu trữ từ xa.

MCP SportsMCP cung cấp những công cụ nào trong TypingMind?

SportsMCP cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP SportsMCP không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu SportsMCP yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇