strava-mcp is a Model Context Protocol (MCP) server that supports remote MCP connections, has built-in Strava OAuth, and is built on Cloudflare Workers. Users can log in with their Strava account, securely connect MCP clients, and access Strava's activity tracking data.
Purpose
This MCP server plays two roles: first, as the OAuth server for MCP clients, and second, as the OAuth client for the Strava OAuth service. The project can serve as a reference example for integrating an OAuth provider with an MCP server deployed to Cloudflare, using the workers-oauth-provider library. It is suitable for developers who want to integrate Strava authentication with AI tools (such as Claude, Cursor).
Main capabilities
- Secure OAuth authentication and tool access via Strava login.
- Supports remote MCP connections.
- The OAuth Provider library handles OAuth 2.1 server implementation, token issuance and validation, secure token storage in KV, Strava OAuth integration, persistent state management, access to user information via this.props, and conditional tool availability.
- Handles client-server communication, tool definition and management, request/response serialization, and SSE connection maintenance.
Usage
Prerequisites: a Strava account, a Cloudflare account, Node.js and npm installed, Wrangler CLI installed (npm install -g wrangler).
Deployment steps:
- Clone the repository: git clone https://github.com/kw510/strava-mcp.git,cd strava-mcp, npm install.
- Set up Strava API credentials (see below).
- Set up the Cloudflare KV namespace: wrangler kv:namespace create "OAUTH_KV", and update the wrangler.toml file with the generated KV ID.
- Deploy to Cloudflare: wrangler deploy.
Set up Strava API credentials: go to Strava's API settings to create a new application, and configure: application name, category, website URL, application description, authorization callback domain (mcp-strava-oauth.<your-subdomain>.workers.dev), authorization callback URL (https://mcp-strava-oauth.<your-subdomain>.workers.dev/callback). Then set the production environment variables: wrangler secret put STRAVA_CLIENT_ID and wrangler secret put STRAVA_CLIENT_SECRET.
Development environment: create a separate Strava API application for development, configure the authorization callback domain as localhost, and the authorization callback URL as http://localhost:8788/callback。在项目根目录创建 .dev.vars file, containing STRAVA_CLIENT_ID and STRAVA_CLIENT_SECRET.
Test the MCP server:
- Using Inspector: install npx @modelcontextprotocol/inspector@latest; connect to the server: for production, https://mcp-strava-oauth.<your-subdomain>.workers.dev/sse, for development, http://localhost:8788/sse。
- Using Claude Desktop: open Settings -> Developer -> Edit Config, and add the MCP server configuration: {"mcpServers": {"strava": {"command": "npx", "args": ["mcp-remote", "https://mcp-strava-oauth.<your-subdomain>.workers.dev/sse"]}}}. Restart Claude Desktop and complete the OAuth flow.
Local development: run wrangler dev, and the server will be available at http://localhost:8788 .
Applicable scenarios
Suitable for developers who need to connect Strava activity data to AI tools (such as Claude, Cursor), or as a reference example of an MCP server integrating an OAuth provider on Cloudflare.
Limitations
The Strava API has rate limits: 200 requests every 15 minutes, and 2000 requests per day. Troubleshooting: if Claude Desktop shows an error, hover over the 🔨 icon to verify the connection; for Cursor integration, use the "Command" type and combine the command and arguments into a single string; make sure the callback URL exactly matches the Strava application configuration.