Deployment Guide
Deploy the Strava MCP Server to AWS Lambda in under 10 minutes.
Table of contents
- Prerequisites
- Installation
- Deployment
- Connecting to Claude
- Updating
- Monitoring
- Troubleshooting
- 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
AdministratorAccesspolicy → Security Credentials → Create Access Key
4. Strava API Credentials
Follow these steps to get your Strava API credentials:
- Go to strava.com/settings/api
- Click “Create an App” (or use existing)
- Fill in details:
- Application Name: Any name (e.g., “My MCP Server”)
- Category: Choose appropriate category
- Authorization Callback Domain:
localhost
- 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:
- Start a local server on port 8888
- Open your browser for Strava authorization
- 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)
- Open Claude Settings
- Navigate to Connectors
- Click Add custom connector
- Enter the base URL from deployment (no
/mcpor/sse) - Claude will complete OAuth automatically
Claude Desktop (Bearer Token)
- Open Claude Settings
- Navigate to Custom Connectors (or MCP Servers)
- Click Add Connector
- Enter:
{ "name": "strava", "url": "https://your-function-url/mcp", "headers": { "Authorization": "Bearer your-auth-token" } } - 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
- Go to AWS Billing Dashboard
- Click Free Tier in left menu
- 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:
AWSCloudFormationFullAccessIAMFullAccessAWSLambda_FullAccessAmazonS3FullAccess
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