Table of contents
How to connect a Strava MCP to Cursor (4 steps)
.png)
Developers building a training analytics library, a coaching platform, or a readiness scoring tool means knowing what Strava actually returns: the exact shape of a segment effort, the fields present on a heart rate stream, the unit conventions for pace and elevation, and so on.
Getting that reference data means leaving Cursor, setting up OAuth separately, running test calls, and copying JSON back into the session where the code lives.
To help your developers access Strava's activity data without leaving Cursor, we'll show you how to connect Strava with Merge Agent Handler's Strava MCP server.
How it works
Merge Agent Handler connects Cursor to the Strava API through the Merge CLI.
Install the CLI, authenticate once, and run a single setup command from your project root.
That command writes a ## Merge CLI section to the project's .cursorrules file, which tells Cursor's agent when to call merge search-tools and merge execute-tool to reach Strava.
Once connected, Merge handles per-user OAuth tokens and token refresh so you never store Strava credentials locally or manage authorization state in the project.
Here's the registration command:
Prerequisites
Before getting started, you'll need the following:
- A Merge Agent Handler account
- Cursor installed
- pipx installed (run
pipx --versionto confirm, or install viapip install pipx) - A Strava account with API access (register your application at
developers.strava.com)
If you want to connect Merge Agent Handler's Strava MCP with internal or customer-facing agentic products, you can follow the steps in our docs.
1. Install the Merge CLI
Run the following to install the Merge CLI and confirm it's available: pipx install merge-api
Verify your installation: merge --version
2. Log in to Merge
Authenticate the CLI with your Merge Agent Handler account: merge login
This links the CLI to your account so it can make authorized requests to Strava on your behalf.
3. Connect the CLI to Cursor
Run the following from the root of the project where you want to use Merge tools:
This writes a ## Merge CLI section to .cursorrules so Cursor knows to use the CLI for third-party services. The command is idempotent, safe to re-run if you need to reset.
4. Authenticate Strava
Open a Cursor chat in your project and start with a query that reflects real development work.
For example, "Fetch my Strava activity data for the past 30 days and return the full JSON for three different activity types, including every field and nested object, so I can write accurate TypeScript interfaces for my training analytics library."
The first time you invoke a Strava tool, a Magic Link will appear to complete connector authentication.

{{this-blog-only-cta}}
Strava MCP FAQ
In case you have more questions on setting up and using the Strava MCP in Cursor, we've addressed several more commonly-asked questions below.
What can you do once the Strava MCP is connected to Cursor?
With Strava connected, Cursor can:
- Inspect activity JSON schemas while writing data models: fetch real activity records across run, ride, and swim types to see exactly which fields exist, how they're named, and what values they carry before defining TypeScript interfaces or Pydantic schemas
- Pull segment metadata while coding route analysis features: retrieve segment details including distance, average grade, and elevation difference inline while writing the route analysis logic that depends on them, rather than consulting docs that may not reflect edge cases
- Fetch heart rate stream data while building training load calculations: query the raw heart rate time series from a real activity to understand the array structure and sampling resolution your load calculation functions need to process correctly
- Check lap split structure while implementing interval analysis: retrieve lap-level data from a real workout to verify the field names and nesting your interval parser needs to traverse before writing unit tests against synthetic fixtures
- Retrieve gear field formats while building equipment tracking features: pull activity records that include shoe or bike data to see how gear is represented in the API response before coding the extraction and normalization logic
- Look up pace and elevation unit conventions while writing conversion utilities: query real activities to confirm whether values are stored in seconds per meter, meters, or platform-specific units before coding the conversion layer your display logic depends on
Why use Merge Agent Handler vs. a self-hosted Strava MCP server?
You can build a self-hosted MCP server on top of Strava's API. For a solo developer building against their own account, the setup is manageable: register an application at developers.strava.com, complete the OAuth flow, and write tool schemas for the endpoints you need.
The challenge arrives when the application supports multiple users.
Strava issues short-lived access tokens paired with refresh tokens. Every connected athlete needs their own token pair, their own refresh cycle, and their own error handling for revoked credentials. A failed refresh silently breaks data access for that athlete, and tracking token health across many accounts with no central view of which connections are active becomes its own maintenance burden.
A self-hosted MCP server doesn't solve this. You still own the OAuth plumbing for every connected athlete, and now you're also maintaining the server itself. Strava doesn't publish an official MCP server, so any community implementation comes with no guarantees on coverage or maintenance.
Merge Agent Handler centralizes credential management and handles token refresh across all connected athletes. You can control exactly which Strava operations each agent can call: an agent that generates weekly summaries, for example, gets access to activity list and detail tools, but can never reach write operations unless those are explicitly included.
For applications where athletes are trusting an agent with personal performance data, that combination of scoped access and audit logging is the baseline for a responsible deployment.
Why connect Strava to Cursor?
Strava's API returns structured activity data that fitness integrations depend on: timestamped records with pace, distance, heart rate, elevation, gear, and lap splits, plus segment metadata and effort history.
For developers building against that data in Cursor, the reference material needed to write correct code sits outside the editor.
Connecting Strava to Cursor means you can query real API responses from within a chat session while writing the code that consumes them.

.png)


%20(6).png)
.png)