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. 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
Add this skill
npx mdskills install kw510/strava-mcpComprehensive MCP server with 24+ tools for analyzing Strava fitness data through natural language queries
1# Model Context Protocol (MCP) Server + Strava OAuth23This is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) 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.45## Overview67The MCP server (powered by [Cloudflare Workers](https://developers.cloudflare.com/workers/)) serves two roles:8- Acts as an OAuth Server for your MCP clients9- Acts as an OAuth Client for Strava's OAuth services1011This project serves as a reference example for integrating OAuth providers with an MCP server deployed to Cloudflare, using the [`workers-oauth-provider` library](https://github.com/cloudflare/workers-oauth-provider).1213## Prerequisites1415- A Strava account16- A Cloudflare account17- Node.js and npm installed18- Wrangler CLI installed (`npm install -g wrangler`)1920## Quick Start21221. Clone the repository:23 ```bash24 git clone https://github.com/kw510/strava-mcp.git25 cd strava-mcp26 npm install27 ```28292. Set up your Strava API credentials (see [Setting Up Strava API Credentials](#setting-up-strava-api-credentials))30313. Set up your Cloudflare KV namespace:32 ```bash33 wrangler kv:namespace create "OAUTH_KV"34 ```35 Update the `wrangler.toml` file with the generated KV ID.36374. Deploy to Cloudflare:38 ```bash39 wrangler deploy40 ```4142## Setting Up Strava API Credentials4344### For Production451. Go to [Strava's API Settings](https://www.strava.com/settings/api) and create a new application462. Configure your application:47 - Application Name: Choose a name for your application48 - Category: Select an appropriate category49 - Website: Your website URL50 - Application Description: Brief description of your application51 - Authorization Callback Domain: `mcp-strava-oauth.<your-subdomain>.workers.dev`52 - Authorization Callback URL: `https://mcp-strava-oauth.<your-subdomain>.workers.dev/callback`53543. Set your production environment variables:55 ```bash56 wrangler secret put STRAVA_CLIENT_ID57 wrangler secret put STRAVA_CLIENT_SECRET58 ```5960### For Development611. Create a separate Strava API application for development622. Configure your development application:63 - Authorization Callback Domain: `localhost`64 - Authorization Callback URL: `http://localhost:8788/callback`65663. Create a `.dev.vars` file in your project root:67 ```68 STRAVA_CLIENT_ID=your_development_strava_client_id69 STRAVA_CLIENT_SECRET=your_development_strava_client_secret70 ```7172## Testing Your MCP Server7374### Using Inspector751. Install the Inspector tool:76 ```bash77 npx @modelcontextprotocol/inspector@latest78 ```79802. Connect to your server:81 - For production: `https://mcp-strava-oauth.<your-subdomain>.workers.dev/sse`82 - For development: `http://localhost:8788/sse`8384### Using Claude Desktop851. Open Claude Desktop and go to Settings -> Developer -> Edit Config862. Add your MCP server configuration:87 ```json88 {89 "mcpServers": {90 "strava": {91 "command": "npx",92 "args": [93 "mcp-remote",94 "https://mcp-strava-oauth.<your-subdomain>.workers.dev/sse"95 ]96 }97 }98 }99 ```1003. Restart Claude Desktop and complete the OAuth flow101102## Development103104### Local Development1051. Start the development server:106 ```bash107 wrangler dev108 ```1091102. The server will be available at `http://localhost:8788`111112### API Rate Limits113The Strava API has the following rate limits:114- 200 requests every 15 minutes115- 2,000 requests per day116117## How It Works118119### OAuth Provider120The OAuth Provider library handles:121- OAuth 2.1 server implementation122- Token issuance and validation123- Secure token storage in KV124- Strava OAuth integration125126### Durable MCP127Provides:128- Persistent state management129- Secure authentication context storage130- User information access via `this.props`131- Conditional tool availability132133### MCP Remote134Enables:135- Client-server communication136- Tool definition and management137- Request/response serialization138- SSE connection maintenance139140## Troubleshooting141142- If you see error messages in Claude Desktop, verify the connection by hovering over the ๐จ icon143- For Cursor integration, use the "Command" type and combine command and args into one string144- Ensure your callback URLs match exactly with what's configured in your Strava application145
Full transparency โ inspect the skill content before installing.