Cover image
Try Now
2025-04-14

带有strava oauth集成的模型上下文协议(MCP)服务器,建立在Cloudflare工人上。通过Strava登录,可以为Claude和Cursor等MCP客户端提供安全的身份验证和工具访问。非常适合希望将Strava身份验证与AI工具集成的开发人员。

3 years

Works with Finder

2

Github Watches

0

Github Forks

6

Github Stars

Model Context Protocol (MCP) Server + Strava OAuth

This is a Model Context Protocol (MCP) server that supports remote MCP connections, with Strava OAuth built-in. It allows users to connect to your MCP server by signing in with their Strava account.

Overview

The MCP server (powered by Cloudflare Workers) serves two roles:

  • Acts as an OAuth Server for your MCP clients
  • Acts as an OAuth Client for Strava's OAuth services

This project serves as a reference example for integrating OAuth providers with an MCP server deployed to Cloudflare, using the workers-oauth-provider library.

Prerequisites

  • A Strava account
  • A Cloudflare account
  • Node.js and npm installed
  • Wrangler CLI installed (npm install -g wrangler)

Quick Start

  1. Clone the repository:

    git clone https://github.com/kw510/strava-mcp.git
    cd strava-mcp
    npm install
    
  2. Set up your Strava API credentials (see Setting Up Strava API Credentials)

  3. Set up your Cloudflare KV namespace:

    wrangler kv:namespace create "OAUTH_KV"
    

    Update the wrangler.toml file with the generated KV ID.

  4. Deploy to Cloudflare:

    wrangler deploy
    

Setting Up Strava API Credentials

For Production

  1. Go to Strava's API Settings and create a new application

  2. Configure your application:

    • Application Name: Choose a name for your application
    • Category: Select an appropriate category
    • Website: Your website URL
    • Application Description: Brief description of your application
    • Authorization Callback Domain: mcp-strava-oauth.<your-subdomain>.workers.dev
    • Authorization Callback URL: https://mcp-strava-oauth.<your-subdomain>.workers.dev/callback
  3. Set your production environment variables:

    wrangler secret put STRAVA_CLIENT_ID
    wrangler secret put STRAVA_CLIENT_SECRET
    

For Development

  1. Create a separate Strava API application for development

  2. Configure your development application:

    • Authorization Callback Domain: localhost
    • Authorization Callback URL: http://localhost:8788/callback
  3. Create a .dev.vars file in your project root:

    STRAVA_CLIENT_ID=your_development_strava_client_id
    STRAVA_CLIENT_SECRET=your_development_strava_client_secret
    

Testing Your MCP Server

Using Inspector

  1. Install the Inspector tool:

    npx @modelcontextprotocol/inspector@latest
    
  2. Connect to your server:

    • For production: https://mcp-strava-oauth.<your-subdomain>.workers.dev/sse
    • For development: http://localhost:8788/sse

Using Claude Desktop

  1. Open Claude Desktop and go to Settings -> Developer -> Edit Config
  2. Add your MCP server configuration:
    {
      "mcpServers": {
        "strava": {
          "command": "npx",
          "args": [
            "mcp-remote",
            "https://mcp-strava-oauth.<your-subdomain>.workers.dev/sse"
          ]
        }
      }
    }
    
  3. Restart Claude Desktop and complete the OAuth flow

Development

Local Development

  1. Start the development server:

    wrangler dev
    
  2. The server will be available at http://localhost:8788

API Rate Limits

The Strava API has the following rate limits:

  • 200 requests every 15 minutes
  • 2,000 requests per day

How It Works

OAuth Provider

The OAuth Provider library handles:

  • OAuth 2.1 server implementation
  • Token issuance and validation
  • Secure token storage in KV
  • Strava OAuth integration

Durable MCP

Provides:

  • Persistent state management
  • Secure authentication context storage
  • User information access via this.props
  • Conditional tool availability

MCP Remote

Enables:

  • Client-server communication
  • Tool definition and management
  • Request/response serialization
  • SSE connection maintenance

Troubleshooting

  • If you see error messages in Claude Desktop, verify the connection by hovering over the 🔨 icon
  • For Cursor integration, use the "Command" type and combine command and args into one string
  • Ensure your callback URLs match exactly with what's configured in your Strava application

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Lists Tailwind CSS classes in monospaced font

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • tomoyoshi hirata
  • Sony α7IIIマニュアルアシスタント

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • modelcontextprotocol
  • 模型上下文协议服务器

    Reviews

    5 (1)
    Avatar
    user_faBXPzId
    2025-04-17

    Strava-mcp is an outstanding tool for integrating Strava data into multiple platforms seamlessly. Created by kw510, it proves to be reliable and user-friendly, enhancing my workout tracking experience. The detailed documentation on GitHub (https://github.com/kw510/strava-mcp) makes it easy to set up and use. Highly recommended for fitness enthusiasts looking to aggregate their data effortlessly!