Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/ljcl/strava-mcp/agents-mdgit clone --depth 1 https://github.com/ljcl/strava-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/ljcl/strava-mcp/agents-md)<a href="https://agentmods.dev/instructions/ljcl/strava-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/ljcl/strava-mcp/agents-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.04390 | $0.04390 |
| Opus 5 | $0.02195 | $0.02195 |
| Sonnet 5 | $0.00878 | $0.00878 |
| Haiku 4.5 | $0.00439 | $0.00439 |
Grade B, and why
strava-mcp AGENTS.md scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
Turborepo caches all tasks; Biome and Knip run as root tasks (do NOT move root `lint` under turbo — How it starts
The opening of the file, as written. The whole thing — 282 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Strava MCP Server
Remote MCP server for connecting AI tools to your Strava data.
Documentation
Reference docs live in docs/. Read the relevant one before working in its area;
this file holds only the invariants that apply to every change.
| Doc | Read before |
|---|---|
| docs/architecture.md | Changing server internals (transport, HTTP layer, cache, errors, analysis math, tool metadata) |
| docs/mcp-apps.md | Adding or changing an MCP App package, packages/ui, or packages/data |
| docs/tools.md | Adding, renaming, or describing tools/prompts — it is the single catalog; keep it current |
| docs/operations.md | Configuring or debugging a deployed instance |
| docs/development.md | Turborepo, coverage gates, Storybook gates, Docker image build |
| docs/releasing.md | Shipping — PR titles are Conventional Commits; release automation does the rest |
| docs/project.md | Filing/triaging issues, editing the project board |
Architecture invariants
One line each; full rationale in docs/architecture.md. These exist because breaking them has shipped bugs — do not work around them locally.
- Dual-era serving shares one factory.
mcpEndpoint.tsserves the 2026-07-28 revision statelessly per request and routes 2025-era clients through the SDK's legacy fallback; onecreateServerbacks both legs so the eras cannot drift. No sessions (Mcp-Session-Idis gone; GET/DELETE answer 405). The endpoint parses every POST body itself withparseJsonWithLargeInts→ SDKparsedBody; that seam keeps 64-bit ids intact. - Rate limits and retries live in
fetchClient.ts, never per-tool. ParsesX-RateLimit-*/Retry-Afterinto a snapshot; bounded retries honourRetry-After; transient 5xx/network faults retry GET/HEAD only, never writes. - Error types survive translation.
handleApiErrorrethrowsRateLimitErrorintact (context prefixed ontomessage, bare window detail kept) and wraps everything else inStravaApiError extends HttpError. Flattening to plainErrorsilently kills callers'instanceof/status checks — degrade only on a type or status that is still there. - Caching policy lives in
stravaCacheTtl(path-keyed TTLs; key is full URL, TTL matches query-stripped path). Writes invalidate descendants AND ancestors;skipCache: trueguards append reads; handlers floorafter/beforebounds to the minute (quantizedEpochAfter/Before) so a pair's two calls share one cache key. - Stream reads go through the
stravaClient.tswrappers (sharedfetchStreamSet: shape validation, 401 refresh-retry, structured 429). Only genuine 404/empty throwsStreamsUnavailableError— the one error a caller may degrade on. Catching more misreports failures as absences. - Derived numbers have exactly one home. GAP:
hillAnalysis.ts(gapFactor,computeGrades) —splitAnalysis.tsimports, never re-derives. Time-free segment/route profiles:gradientProfile.ts(+ shared prose intools/_profileText.ts). CTL/ATL/TSB and any projection/taper math:fitnessTrend.ts. Route elevation resolves once vialoadRouteProfile(genuine 404 → GPX<ele>fallback). Text tool and app reading different copies is the failure mode these prevent. - Telemetry:
dispatchToolCallemits one JSON line per call; timer starts before token resolution (not-connected calls count); a returnedisErrorcounts as an error;recordToolCallcan never fail the call it describes. - Progress: every handler gets a
ReportProgressclosure (third arg, always present). Tick counter withouttotal(spec demands monotonic increase; multi-phase calls can't carry two denominators); time-based throttle withimportant: truebypass; fire-and-forget. - Tokens come from
getStravaToken(), passed to handlers as argument 2 — never readprocess.env.STRAVA_ACCESS_TOKENin a tool.NoTokenError/TokenRevokedErrormap to one not-connected message naming/auth/start. OAuth POSTs go throughpostOAuthToken, which retries 5xx only — a timeout may have rotated the refresh token server-side. - Ids go through
stravaIdInput(tools/_ids.ts). Advertised schema is string-only (stravaIdJsonSchemaOverride) because ids above 2^53 are rounded by hosts'JSON.parseunrecoverably; safe-int numbers accepted at runtime, normalised to digit strings; handlers pass strings through without parsing back. - Tools returning data publish
outputSchema+ matchingstructuredContentfromtools/outputs.ts(schemas grouped, not per file). Text tools reuse the apps' mappers rather than re-deriving — e.g.get-activity-zonescallsmapActivityZonesfromactivityZones.ts. Empty results emit a valid payload (count: 0).warnOnSchemaDriftkeeps dev honest. - Exports choose delivery via
_exportOutput.ts: omittingoutputpicks file whenROUTE_EXPORT_PATHis set, content otherwise. Content mode caps bytes and says outright that a truncated GPX will not open. sportTypeis an enum:SPORT_TYPES(utils/activityWrite.ts) backs both the advertised schema and the runtime check; rejections name the near miss (Weightlifting→WeightTraining).- Annotations come from the four
_annotations.tsconstants, never inline objects — they decide whether hosts grant reads durably or re-prompt forever.READ_ONLYstatesdestructiveHint: falseexplicitly (its documented default istrue). Nothing may set_meta["anthropic/requiresUserInteraction"].server.annotations.test.tsholds an exhaustive read/write classification table — a new tool must be added to it. - Tool identity is a published contract.
tool-surface.lock.jsonfingerprintsname + annotations + inputSchema + outputSchema + _meta;toolSurface.test.tsfails on drift. Regenerate deliberately (UPDATE_TOOL_SURFACE_LOCK=1 bunx vitest run src/toolSurface.test.ts) and say so in the PR — users pay a round of re-prompting. - Protocol-surface tests go over the wire in both eras
(
server.integration.test.tsunderdescribe.each(ERAS)viamcpTestClient.ts): capabilities, object inputSchemas (no$ref), string ids,structuredContent,isErrornot JSON-RPC errors, app resources, prompts. Extend the shared client, never a new bootstrap copy. - Tool error text has one home:
toolErrorText(tools/_errors.ts). It branches onRateLimitError/HttpError.status(404, 402), never on message text; everyisErrortext starts with❌. Catch blocks and the dispatcher's final catch call it for the text and write the{ content, isError: true }literal themselves. Tests reject with the__fixtures__/errors.tsshapes (handledRateLimit,handledNotFound,handledSubscriptionRequired), never a plainError("404 Not Found"). - The response cache never shares references and coalesces in-flight
GETs. Every value
FetchClienthands out (hit, populating miss, coalesced awaiter) is astructuredClone; concurrent identical cacheable GETs share one upstream promise (failures never cached, write invalidation drops in-flight entries,skipCachebypasses both). Never return a cached object by reference or add a per-tool in-flight map. - Token status is served from memory.
getTokenStatusreadscachedTokensbefore disk and never caches "no tokens": authed/healthand/auth/statuspolls cost no filesystem read and no repeated "Loaded tokens" lines; atokens.jsonreplaced by hand needs a restart, exactly as it does for tool calls. - Auth pages escape at the sink.
authRoutes.tsentity-encodes every reflected string insideerrorPage/successPage, never at call sites:/auth/callbackis public and itserrorbranch runs before the state gate, so a new page helper must escape too. - The Bun version has one home: root
packageManager. CI reads it viabun-version-file;dockerRuntime.test.tspins the Dockerfile'sFROM oven/bun:<tag>lines to the same x.y.z, because Dependabot bumps the base image but neverpackageManager, and the lockfile must be resolved and installed by the same Bun.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday Changed · +27 lines · +475 tokens per session 8169e9c0c28d
- 4d ago First seen · 255 lines · 3,915 tokens per session scan B 3272c8ac6145
strava-mcp AGENTS.md is an instructions file published in the GitHub repository ljcl/strava-mcp (0 stars, last pushed 2d ago), licensed MIT. It adds 4,390 tokens to every session, about $0.0219 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).