Strava MCP Server

Strava MCP Server

Integrate Strava OAuth with a cloud-based Model Context Protocol server.

21
Stars
2
Forks
21
Watchers
0
Issues
Provides a Model Context Protocol (MCP) server that enables users to connect via Strava OAuth, backed by Cloudflare Workers for remote context protocol handling. It acts both as an OAuth server for MCP clients and an OAuth client for Strava, supporting secure authentication, persistent state management, and seamless integration for connecting model context tools. Serves as a reference example for deploying MCP servers that integrate third-party OAuth providers like Strava.

Key Features

Supports remote MCP connections
Strava OAuth authentication integration
Deployable on Cloudflare Workers
Acts as both OAuth server and client
Persistent state management with Durable MCP
Secure token storage in Cloudflare KV
Client-server communication for model context
Reference implementation for OAuth + MCP
Quick deployment setup with Wrangler CLI
Supports development and production environments

Use Cases

Allowing users to connect to MCP servers using Strava accounts
Building OAuth-enabled tools for AI model context management
Deploying scalable context servers for fitness data platforms
Providing a template for rapid OAuth provider integration with MCP servers
Integrating third-party authentication into model-driven applications
Securing context protocols with persistent state and token storage
Demonstrating OAuth workflow in Cloudflare's serverless infrastructure
Developing applications requiring both model contexts and user authentication
Testing and inspecting MCP-compliant servers
Onboarding users via familiar identity providers in MCP-based ecosystems

README

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:

    bash
    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:

    bash
    wrangler kv:namespace create "OAUTH_KV"
    

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

  4. Deploy to Cloudflare:

    bash
    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:

    bash
    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:

    bash
    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:
    json
    {
      "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:

    bash
    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

Star History

Star History Chart

Repository Owner

kw510
kw510

User

Repository Details

Language TypeScript
Default Branch main
Size 125 KB
Contributors 1
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

TypeScript
100%

Tags

Topics

authentication cloudflare-workers mcp model-context-protocol oauth strava

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • mcp-cli

    mcp-cli

    A command-line inspector and client for the Model Context Protocol

    mcp-cli is a command-line interface tool designed to interact with Model Context Protocol (MCP) servers. It allows users to run and connect to MCP servers from various sources, inspect available tools, resources, and prompts, and execute commands non-interactively or interactively. The tool supports OAuth for various server types, making integration and automation seamless for developers working with MCP-compliant servers.

    • 391
    • MCP
    • wong2/mcp-cli
  • MyMCP Server (All-in-One Model Context Protocol)

    MyMCP Server (All-in-One Model Context Protocol)

    Powerful and extensible Model Context Protocol server with developer and productivity integrations.

    MyMCP Server is a robust Model Context Protocol (MCP) server implementation that integrates with services like GitLab, Jira, Confluence, YouTube, Google Workspace, and more. It provides AI-powered search, contextual tool execution, and workflow automation for development and productivity tasks. The system supports extensive configuration and enables selective activation of grouped toolsets for various environments. Installation and deployment are streamlined, with both automated and manual setup options available.

    • 93
    • MCP
    • nguyenvanduocit/all-in-one-model-context-protocol
  • MCP Obsidian Server

    MCP Obsidian Server

    Integrate Obsidian note management with AI models via the Model Context Protocol.

    MCP Obsidian Server acts as a bridge between Obsidian and AI models by providing an MCP-compatible server interface. It enables programmatic access to Obsidian vaults through a local REST API, allowing operations like listing files, searching, reading, editing, and deleting notes. Designed to work with Claude Desktop and other MCP-enabled clients, it exposes a set of tools for efficient note and content management within Obsidian.

    • 2,394
    • MCP
    • MarkusPfundstein/mcp-obsidian
  • Shopify Storefront MCP Server

    Shopify Storefront MCP Server

    Seamless Shopify Storefront API access for AI assistants via Model Context Protocol

    Enables AI assistants to interact with Shopify store data through standardized MCP tools. Offers endpoints for product discovery, inventory management, GraphQL queries, cart operations, and comprehensive customer data manipulation. Designed for easy integration with MCP-compatible AI and automated token handling. Simplifies secure connection to Shopify's Storefront API with minimal configuration.

    • 5
    • MCP
    • QuentinCody/shopify-storefront-mcp-server
  • Oura MCP Server

    Oura MCP Server

    Enables language models to access Oura sleep, readiness, and resilience data via MCP.

    Oura MCP Server implements the Model Context Protocol to provide language models with access to Oura API data. It allows querying of sleep, readiness, and resilience metrics for specified date ranges or for the current day. The server supports integration with tools like Claude for Desktop and handles API authentication and error scenarios gracefully. Designed for seamless access to personal health metrics through standardized protocol endpoints.

    • 34
    • MCP
    • tomekkorbak/oura-mcp-server
  • FastMCP

    FastMCP

    TypeScript framework for building robust MCP servers with minimal setup.

    FastMCP is a TypeScript framework designed for building servers that adhere to the Model Context Protocol (MCP), enabling efficient management of client sessions and context. It streamlines the creation of MCP servers by providing intuitive APIs, built-in authentication, session and request tracking, and support for handling various content types such as images and audio. The framework also enforces best practices around error handling, logging, and streaming outputs. Developers benefit from reduced boilerplate and a focus on core MCP functionality.

    • 2,738
    • MCP
    • punkpeye/fastmcp
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results