Deployment Guide

Deploy the Strava MCP Server to AWS Lambda in under 10 minutes.

Table of contents

  1. Prerequisites
    1. 1. Bun Runtime
    2. 2. AWS SAM CLI
    3. 3. AWS Account & Credentials
    4. 4. Strava API Credentials
  2. Installation
    1. Clone the Repository
    2. Install Dependencies
    3. Get Strava OAuth Tokens
  3. Deployment
    1. Step 1: Build the Lambda Package
    2. Step 2: Deploy to AWS
    3. Step 3: Get Your Function URL
    4. Step 4: View Configuration Anytime
    5. Step 5: Test the Deployment
  4. Connecting to Claude
    1. Claude Web/Mobile (OAuth)
    2. Claude Desktop (Bearer Token)
  5. Updating
  6. Monitoring
    1. View Logs
    2. View Metrics
    3. Monitor Free Tier Usage
  7. Troubleshooting
    1. “Function URL returned 500”
    2. “AccessDenied” Error
    3. Refresh Token Expired
    4. “Port 8888 in use” (during token retrieval)
  8. Cleanup

Prerequisites

Before deploying, ensure you have:

1. Bun Runtime

curl -fsSL https://bun.sh/install | bash

2. AWS SAM CLI

macOS (Homebrew):

brew install aws-sam-cli

Linux:

wget https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip
unzip aws-sam-cli-linux-x86_64.zip -d sam-installation
sudo ./sam-installation/install

Windows: Download from AWS SAM CLI releases

3. AWS Account & Credentials

Create a free AWS account if you don’t have one.

Configure AWS credentials:

aws configure

Enter:

  • Access Key ID: From AWS IAM
  • Secret Access Key: From AWS IAM
  • Region: us-east-1 (or your preferred region)
  • Output format: json

Don’t have AWS credentials? Go to AWS IAM Console → Users → Create User → Attach AdministratorAccess policy → Security Credentials → Create Access Key

4. Strava API Credentials

Follow these steps to get your Strava API credentials:

  1. Go to strava.com/settings/api
  2. Click “Create an App” (or use existing)
  3. Fill in details:
    • Application Name: Any name (e.g., “My MCP Server”)
    • Category: Choose appropriate category
    • Authorization Callback Domain: localhost
  4. Save and note your Client ID and Client Secret

Installation

Clone the Repository

git clone https://github.com/Stealinglight/StravaMCP.git
cd StravaMCP

Install Dependencies

bun install

Get Strava OAuth Tokens

Run the token helper script:

node get-token.js YOUR_CLIENT_ID YOUR_CLIENT_SECRET

This will:

  1. Start a local server on port 8888
  2. Open your browser for Strava authorization
  3. Display your Refresh Token

Save your refresh token! You’ll need it for deployment.

Deployment

Step 1: Build the Lambda Package

bun run build:lambda

This compiles TypeScript to JavaScript and prepares the deployment package in dist/.

Step 2: Deploy to AWS

First-time deployment (guided):

bun run deploy

You’ll be prompted for:

Prompt What to Enter
Stack name Press Enter (uses strava-mcp-stack)
AWS Region Your region (e.g., us-east-1)
StravaClientId Your Strava Client ID
StravaClientSecret Your Strava Client Secret
StravaRefreshToken Your Strava Refresh Token
Confirm changes before deploy y
Allow SAM CLI IAM role creation y
Disable rollback n
Save arguments to samconfig.toml y

Subsequent deployments:

bun run deploy:fast

Subsequent deploys use saved configuration and are much faster!

Step 3: Get Your Function URL

After successful deployment, you’ll see:

CloudFormation outputs from deployed stack
---------------------------------------------------------
Outputs
---------------------------------------------------------
Key                 ClaudeConnectionUrl
Description         Base URL for Claude OAuth connector
Value               https://abc123xyz.lambda-url.us-east-1.on.aws

Key                 HealthCheckUrl
Description         Health check endpoint
Value               https://abc123xyz.lambda-url.us-east-1.on.aws/health
---------------------------------------------------------

Save the ClaudeConnectionUrl - you’ll need it to connect from Claude!

Step 4: View Configuration Anytime

Forgot your connection details? Retrieve them anytime with:

bun run deploy:show-config

This displays:

  • Base URL for Claude OAuth connector
  • OAuth metadata endpoint
  • MCP endpoint for desktop clients

Use this command whenever you need to reconnect Claude or check your deployment details!

Step 5: Test the Deployment

curl https://YOUR-FUNCTION-URL/health

Expected response:

{"status":"healthy","version":"2.0.0"}

Connecting to Claude

Claude Web/Mobile (OAuth)

  1. Open Claude Settings
  2. Navigate to Connectors
  3. Click Add custom connector
  4. Enter the base URL from deployment (no /mcp or /sse)
  5. Claude will complete OAuth automatically

Claude Desktop (Bearer Token)

  1. Open Claude Settings
  2. Navigate to Custom Connectors (or MCP Servers)
  3. Click Add Connector
  4. Enter:
    {
      "name": "strava",
      "url": "https://your-function-url/mcp",
      "headers": {
        "Authorization": "Bearer your-auth-token"
      }
    }
    
  5. Save

You can now use Strava MCP tools in any Claude conversation!

Updating

When you make code changes:

# Edit files in src/
bun run build:lambda
bun run deploy:fast

Updates deploy in 30-60 seconds with zero downtime.

Monitoring

View Logs

sam logs -n StravaMCPFunction --stack-name strava-mcp-stack --tail

View Metrics

Go to AWS Lambda Console and select your function to see:

  • Invocations
  • Duration
  • Errors
  • Throttles

Monitor Free Tier Usage

  1. Go to AWS Billing Dashboard
  2. Click Free Tier in left menu
  3. Monitor Lambda usage

Troubleshooting

“Function URL returned 500”

Check logs:

sam logs -n StravaMCPFunction --stack-name strava-mcp-stack --tail

Common causes:

  • Missing environment variables
  • Expired Strava refresh token
  • Cold start timeout (wait 30s and retry)

“AccessDenied” Error

Ensure your IAM user has these permissions:

  • AWSCloudFormationFullAccess
  • IAMFullAccess
  • AWSLambda_FullAccess
  • AmazonS3FullAccess

Refresh Token Expired

Re-run the token script:

node get-token.js YOUR_CLIENT_ID YOUR_CLIENT_SECRET

Then update deployment:

sam deploy --parameter-overrides StravaRefreshToken=NEW_TOKEN

“Port 8888 in use” (during token retrieval)

Kill the process using port 8888:

lsof -ti:8888 | xargs kill -9

Or edit get-token.js to use a different port.

Cleanup

To delete the deployment and stop all costs:

sam delete --stack-name strava-mcp-stack

This removes:

  • Lambda function
  • Function URL
  • All AWS resources
  • Stops all charges

Next: Free Tier Guide - Learn how to stay within free tier limits