Thank you for your interest in contributing to StravaMCP! This guide covers everything you need to get started.
Found a bug or have an idea? Open an issue using one of our templates:
- Bug Report -- something broken or unexpected
- Feature Request -- new tool, enhancement, or improvement
Before opening an issue:
- Search existing issues to avoid duplicates
- For bugs, include your version (
strava-mcp --version), OS, and MCP client - For security vulnerabilities, do not open a public issue -- see SECURITY.md
- Go 1.25+ (match go.mod)
- Git
- A Strava API application — create one at https://www.strava.com/settings/api
git clone https://github.com/Stealinglight/StravaMCP.git
cd StravaMCP
go build .
go test ./...Required environment variables:
| Variable | Required | Description |
|---|---|---|
STRAVA_CLIENT_ID |
Yes | Your Strava API application client ID |
STRAVA_CLIENT_SECRET |
Yes | Your Strava API application client secret |
STRAVA_TOKEN_PATH |
No | Path to token storage (default: ~/.strava/tokens.json) |
Authenticate with the OAuth browser flow:
export STRAVA_CLIENT_ID=your_id
export STRAVA_CLIENT_SECRET=your_secret
./strava-mcp authThis opens your browser to complete Strava authorization and saves tokens locally.
# Run all tests
go test ./...
# Run with verbose output
go test -v ./...
# Run specific package tests
go test ./internal/tools/...
go test ./internal/strava/...
go test ./internal/auth/...internal/
auth/ - OAuth browser flow and file-based token store
config/ - Environment variable loading and validation
server/ - MCP server setup and tool registration
strava/ - Strava HTTP client with auto-refresh
tools/ - MCP tool handlers (11 tools across 5 categories)
main.go - Entry point (auth subcommand + MCP server mode)
- Create a handler in
internal/tools/following the existing pattern (e.g.,activities.go) - Handler function signature:
func HandleXxx(client *strava.Client) mcp.ToolHandlerFunc - Register in
internal/tools/register.govia aregisterXxxfunction - Add tests in the corresponding
_test.gofile
- Fork the repo and create a branch from
main - Make your changes
- Run
go test ./...andgo vet ./...before submitting - Open a PR -- the PR template will guide you through the checklist
- Follow conventional commits:
feat:,fix:,docs:,refactor: - Keep PRs focused on a single concern
We review PRs within a few days. If your PR adds a new MCP tool, make sure you've followed the steps in Adding a New Tool above.
- Follow standard Go conventions (
gofmt,go vet) - All logging to stderr via
slog(stdout is MCP JSON-RPC) - Use the established handler closure pattern:
HandleXxx(client)returnsToolHandlerFunc - Error handling: use
FormatResponse/HandleToolErrorhelpers frominternal/tools/helpers.go
By contributing, you agree that your contributions will be licensed under the ISC License.