Model Context Protocol (MCP) Server + Strava OAuth
A Model Context Protocol (MCP) server with Strava OAuth integration, built on Cloudflare Workers. Enables secure authentication and tool access for MCP clients like Claude and Cursor through Strava login. Perfect for developers looking to integrate Strava authentication with AI tools.
kw510
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
-
Clone the repository:
git clone https://github.com/kw510/strava-mcp.git cd strava-mcp npm install -
Set up your Strava API credentials (see Setting Up Strava API Credentials)
-
Set up your Cloudflare KV namespace:
wrangler kv:namespace create "OAUTH_KV"Update the
wrangler.tomlfile with the generated KV ID. -
Deploy to Cloudflare:
wrangler deploy
Setting Up Strava API Credentials
For Production
-
Go to Strava's API Settings and create a new application
-
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
-
Set your production environment variables:
wrangler secret put STRAVA_CLIENT_ID wrangler secret put STRAVA_CLIENT_SECRET
For Development
-
Create a separate Strava API application for development
-
Configure your development application:
- Authorization Callback Domain:
localhost - Authorization Callback URL:
http://localhost:8788/callback
- Authorization Callback Domain:
-
Create a
.dev.varsfile 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
-
Install the Inspector tool:
npx @modelcontextprotocol/inspector@latest -
Connect to your server:
- For production:
https://mcp-strava-oauth.<your-subdomain>.workers.dev/sse - For development:
http://localhost:8788/sse
- For production:
Using Claude Desktop
- Open Claude Desktop and go to Settings -> Developer -> Edit Config
- Add your 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
Development
Local Development
-
Start the development server:
wrangler dev -
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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Linear MCP Server
A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.
Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.