activity-tracker-auth-gateway
Facilitates secure remote access for Model Context Protocol (MCP) sessions by integrating with the Strava platform via OAuth 2.0 flows. Operates concurrently as both an authorization server endpoint for MCP consumers and an authorized client initiating connections with Strava APIs.
Author

kw510
Quick Info
Actions
Tags
Model Context Protocol (MCP) Endpoint with Strava Authorization
This repository implements a Model Context Protocol (MCP) gateway deployed on Cloudflare Workers, featuring embedded Strava authentication capabilities. It enables users to authorize access to the MCP service by authenticating through their established Strava credentials.
High-Level Summary
The MCP service backend (leveraging Cloudflare Workers) fulfills a dual purpose in the authorization stack: - Serves as the primary OAuth Authorization Server endpoint for upstream MCP client applications. - Functions as the OAuth Client, managing the handshake with Strava's external authorization infrastructure.
This solution acts as a practical blueprint for embedding external OAuth identity providers within an MCP service deployed on the Cloudflare edge network, utilizing the workers-oauth-provider utility.
Necessary Prerequisites
- An active Strava user account.
- A valid Cloudflare account.
- Local installation of Node.js and npm.
- The Wrangler CLI utility (
npm install -g wrangler).
Rapid Deployment Guide
-
Obtain a local copy of the source code:
bash git clone https://github.com/kw510/strava-mcp.git cd strava-mcp npm install -
Configure Strava API Credentials (refer to the Strava Credential Setup section).
-
Provision a Cloudflare Key-Value (KV) storage container:
bash wrangler kv:namespace create "OAUTH_KV"Update thewrangler.tomlmanifest with the resulting KV identifier. -
Initiate deployment to the Cloudflare environment:
bash wrangler deploy
Strava API Credential Configuration
Production Deployment
- Navigate to Strava's Developer Application Settings and register a new application.
- Define application parameters:
- Application Name: A distinct identifier for your service.
- Category: Select the most relevant operational domain.
- Website: The canonical URL for your service.
- Application Description: Concise summary of the application's function.
- Authorization Callback Domain:
mcp-strava-oauth.<your-subdomain>.workers.dev -
Authorization Callback URL:
https://mcp-strava-oauth.<your-subdomain>.workers.dev/callback -
Securely inject production secrets:
bash wrangler secret put STRAVA_CLIENT_ID wrangler secret put STRAVA_CLIENT_SECRET
Development/Local Environment
- Register a distinct Strava API application specifically for local testing.
- Configure local endpoints:
- Authorization Callback Domain:
localhost -
Authorization Callback URL:
http://localhost:8788/callback -
Create a
.dev.varsfile in the repository root containing local secrets:STRAVA_CLIENT_ID=your_development_strava_client_id STRAVA_CLIENT_SECRET=your_development_strava_client_secret
Validating the MCP Gateway Service
Using the Inspector Utility
-
Install the official Inspector package:
bash npx @modelcontextprotocol/inspector@latest -
Establish the connection stream to the service endpoint:
- For Live Environment:
https://mcp-strava-oauth.<your-subdomain>.workers.dev/sse - For Local Test:
http://localhost:8788/sse
Integrating with Claude Desktop
- Open the Claude Desktop application and navigate to Settings -> Developer -> Edit Config.
- Append the following configuration block to your servers definition:
json { "mcpServers": { "strava": { "command": "npx", "args": [ "mcp-remote", "https://mcp-strava-oauth.<your-subdomain>.workers.dev/sse" ] } } } - Restart Claude Desktop. The system will prompt you to complete the necessary Strava authorization handshake.
Development Workflow
Local Server Execution
-
Initiate the local execution environment:
bash wrangler dev -
The locally hosted service will be accessible at
http://localhost:8788.
API Throttling Constraints (Strava)
Review the rate limits imposed by the external Strava API: - Burst Limit: 200 operations per 15-minute window. - Daily Limit: 2,000 operations across a 24-hour period.
Operational Mechanics
Authorization Provisioning Layer
This library component manages all facets of the OAuth flow: - Full implementation of the OAuth 2.1 specification. - Secure issuance and verification of access tokens. - Persistent, secure storage of tokens within the KV store. - Abstraction layer for Strava-specific OAuth interactions.
Stateful MCP Context
This layer is responsible for ensuring continuity:
- Durable state persistence across requests.
- Secure handling and isolation of authentication context data.
- Exposing user profile information via the this.props context object.
- Dynamic enabling/disabling of provided tooling based on authentication status.
Remote Communication Protocol
This module governs client interaction: - Establishing and maintaining duplex communication channels (SSE). - Standardized definition and advertisement of available tools. - Serialization/deserialization protocols for data exchange.
Debugging and Resolution
- If connection failures appear within the Claude Desktop interface, visually inspect the 🔨 icon for diagnostic messages.
- For integration within Cursor IDE, utilize the "Command" type, packaging the execution command and arguments into a single string.
- Crucially, confirm absolute parity between the configured Authorization Callback URLs in the Strava developer console and the deployed service endpoints.
WIKIPEDIA: Business management tools encompass the comprehensive array of systems, applications, control mechanisms, computational aids, and procedural frameworks utilized by organizations to effectively navigate dynamic market conditions, secure a competitive posture, and elevate overall organizational performance. These tools are vital for adaptation and optimization.
== Foundational Concepts == Management tools are often segmented according to organizational function, covering aspects such as strategic planning mechanisms, operational process management systems, record-keeping utilities, human capital management utilities, decision support systems, and performance monitoring controls. A functional categorization might include:
Utilities for capturing and verifying data input across all departments. Systems designed for auditing and enhancing the efficiency of business workflows. Platforms for aggregating data sets to facilitate informed executive decision-making. Contemporary business tooling has undergone radical transformation over the past decade, driven by rapid technological acceleration. This pace makes the selection of optimal business instruments for any given corporate context highly complex. This difficulty stems from continuous pressures to reduce operational expenditures, maximize sales revenue, achieve deep comprehension of client demands, and deliver products precisely tailored to those identified needs. In this environment, organizational leaders must adopt a strategic philosophy toward adopting and integrating business management systems, rather than simply chasing the newest technological release. Over-reliance on off-the-shelf solutions without necessary customization frequently leads to operational instability. Consequently, business management tools must be chosen deliberately and subsequently customized to align perfectly with the unique requirements of the enterprise, reversing the common tendency.
== Prominent Implementations == Data from a 2013 survey conducted by Bain & Company highlighted global usage patterns for business instruments, reflecting how their realized value corresponds to regional market demands and economic climates. The top ten categories identified were:
Strategic roadmap formulation Customer relationship management (CRM) Personnel commitment assessment surveys Comparative performance analysis (Benchmarking) Integrated performance measurement frameworks (Balanced Scorecard) Identification of proprietary advantages (Core Competency) Offshoring/outsourcing of non-core functions Structured organizational transformation programs (Change Management) Logistics and materials flow optimization (Supply Chain Management) Formalized purpose and vision documentation Market segmentation and targeting methodologies Comprehensive quality assurance methodologies (TQM)
== Enterprise Software Applications == Software solutions or interconnected suites of computer programs employed by personnel to execute diverse corporate functions are termed business software (or enterprise applications). These applications are engineered to enhance productivity metrics, quantify operational output, and accurately complete various organizational mandates. The progression started with foundational Management Information Systems (MIS), evolved into integrated Enterprise Resource Planning (ERP) systems, subsequently incorporated Customer Relationship Management (CRM) functionalities, and has now largely transitioned into the sphere of cloud-based business management solutions. While a direct correlation exists between IT investment levels and organizational efficacy, two critical factors determine the added value: the efficacy of the deployment process itself, and the judicious selection and subsequent tailoring of the chosen tools.
