SportsMCP 标志

SportsMCP

社区
gabeperez

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

发布者gabeperez
代码仓库strava-mcp
语言TypeScript
复刻数
10
星标数
19
可用工具
0
传输类型stdio, streamable-http
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    SportsMCP 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 19 个星标和 10 个复刻。

🏃 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

安装

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

将 SportsMCP MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 SportsMCP 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 您可以在自己的设备上本地运行 MCP,也可以通过 URL 连接远程 MCP 服务器。

方式 1:使用本地连接器

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 SportsMCP 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 SportsMCP MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "strava-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sportsmcp"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 SportsMCP MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 SportsMCP MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 SportsMCP 帮我完成这项任务吗?
SportsMCP
当然,我看过了。
以下是我使用 SportsMCP 得到的结果。

方式 2:添加 MCP 服务器 URL

如果 SportsMCP 已托管在远程服务器上,或您的团队希望让多个用户共用一个连接器,请选择此方式。

1

打开 MCP 连接器

在 TypingMind 中,前往“插件”,打开“MCP 连接器”,然后选择“添加 URL”。

  1. 在您的浏览器中打开 TypingMind。
  2. 进入“插件”。
  3. 打开“MCP 连接器”。
  4. 点击“添加 URL”。
TypingMind 的“添加自定义 MCP 服务器 URL”表单
2

粘贴服务器 URL

在“服务器 URL”字段中输入 https://your-worker-url.workers.dev/mcp。根据服务器要求,添加连接名称、描述、图标、自定义 HTTP 请求头或 OAuth 客户端设置。

  1. 将 https://your-worker-url.workers.dev/mcp 粘贴到“服务器 URL”字段中。
  2. 为 SportsMCP 输入连接名称。
  3. 您可以添加描述和图标,以便更容易识别此连接。
  4. 如果服务器需要身份验证,请添加自定义 HTTP 请求头或 OAuth 客户端信息。
3

创建连接

点击“创建连接”,然后返回插件列表,确认新的 MCP 连接处于可用状态。

  1. 点击“创建连接”。
  2. 返回 MCP 连接器列表。
  3. 确认列表中的 SportsMCP 连接显示为可用状态。
  4. 如果连接未立即出现,请刷新插件列表。
4

切换模型,无需重新连接

使用您偏好的模型开始聊天,在“插件”中启用 SportsMCP 工具,并根据需要随时切换到其他模型。该 MCP 连接在 TypingMind 工作区中仍然可用。

  1. 在 TypingMind 中开始新聊天。
  2. 选择您想使用的 AI 模型。
  3. 在“插件”中启用 SportsMCP 工具。
  4. 需要时,请让模型使用该工具。
  5. 切换到其他 AI 模型,继续使用同一个 MCP 连接。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 SportsMCP 帮我完成这项任务吗?
SportsMCP
当然,我看过了。
以下是我使用 SportsMCP 得到的结果。

常见问题

SportsMCP MCP 服务器有什么用途?

SportsMCP 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 SportsMCP MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 SportsMCP。

为什么在 TypingMind 中使用 SportsMCP MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 SportsMCP 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 SportsMCP MCP 连接到 TypingMind?

在 TypingMind 中,您可以使用本地 MCP 连接器或添加远程 MCP 服务器的 URL 来连接 SportsMCP。当服务器需要访问您设备上的文件、应用或私有资源时,请使用本地连接器;如果 MCP 服务器部署在远端,请使用服务器 URL。

SportsMCP MCP 在 TypingMind 中提供哪些工具?

SportsMCP 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 SportsMCP MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 SportsMCP 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇