alltrails-mcp: Instructions file for Claude Code

CLAUDE.md

alltrails-mcp CLAUDE.md is an instructions file for Claude Code from chrischall/alltrails-mcp. It costs 5,149 tokens per session, scanned A, original, MIT.

A set of instructions for an AI coding agent working on an unofficial AllTrails MCP server. AllTrails is a hiking-trail service, and MCP is a way for an AI assistant to use external tools.

In plain words
What is it for?
It helps maintain read-only tools for searching trails, viewing details, reviews, photos, weather, saved lists, completed trails, and activity feeds.
Why use it?
It explains the project’s commands, structure, authentication, and validation rules, including limitations caused by AllTrails’ lack of a public API.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions .claude-plugin; mentions CLAUDE.md.

This is chrischall/alltrails-mcp's own configuration. It tells Claude Code how to work on alltrails-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything alltrails-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to chrischall/alltrails-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/chrischall/alltrails-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/chrischall/alltrails-mcp

Made for: Claude Code.

Wrote 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.

agentmods badge for alltrails-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/chrischall/alltrails-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/chrischall/alltrails-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/chrischall/alltrails-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/chrischall/alltrails-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for alltrails-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/chrischall/alltrails-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/chrischall/alltrails-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 5,149 This file is loaded in full into every session.
When invoked 5,149 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.05149 $0.05149
Opus 5.5 $0.02060 $0.02060
Sonnet 5.5 $0.01030 $0.01030
Haiku 4.5 $0.00515 $0.00515

Measured 28d ago against content hash 58ec1ec4e09c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

alltrails-mcp CLAUDE.md scanned grade A with 0 findings 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 28d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

alltrails-mcp

Unofficial MCP server for AllTrails. Read-only access to trail search, trail details, reviews, photos, weather, and a signed-in user's saved lists / completed trails / activity feed. stdio transport.

AllTrails has no public API. This reverse-engineers the internal one (alltrails.com), which is fronted by DataDome bot protection and governed by AllTrails' ToS. It may break at any time and automated use may violate their terms. This project is one of a fleet of sibling MCP servers (ofw-mcp is the canonical template); it copies that fleet's auth/validation/packaging patterns.

Commands

npm run build        # tsc → dist/, then esbuild bundle → dist/bundle.js
npm test             # vitest run (all tests)
npm run test:watch   # vitest in watch mode
npm run dev          # node --env-file=.env dist/index.js (requires built dist)

dist/ is gitignored — it is produced at build/release time and shipped in the npm package (package.json files).

Architecture

src/
  index.ts          MCP server entry — runMcp() from @chrischall/mcp-utils (builds McpServer, applies registrars with client as deps, prints banner, wires shutdown + stdio transport)
  protocol.ts       Wire-level constants (BASE_URL, x-at-caller / x-language-locale defaults) — no app key: x-at-key is captured live by client.ts
  transport.ts      createAllTrailsTransport(): the fetchproxy bridge transport (createFetchproxyTransport, port 37149, domains alltrails.com, defaultSubdomain www, createServer test seam)
  client.ts         AllTrailsClient — bridge requests (transport.fetch inside the signed-in tab), live x-at-key capture (memory-only), 429 wait-and-replay, non-JSON interstitial guard
  config.ts         env-driven caller/locale header, user-id, timeout, ws-port and debug getters
  validate.ts       parseAllTrails(): zod validation of AllTrails responses at call sites (lenient reads / strict where a mistype must halt)
  gpx.ts            decodePolyline() (generalized Google polyline varint decoder) + trailToGpx() (offline-detail route geometry → GPX 1.1) + OfflineTrailSchema
  tools/
    _shared.ts      response helpers + resolveUserId (arg → ALLTRAILS_USER_ID → /api/alltrails/me users[0].id) + the compact projections, applied BY DEFAULT via the fleet `view` param (summarizeTrail/TrailDetail/Review/Photo/SearchResult/FeedItem/ListItem/Location/Profile/UserList + their loose schemas + ALLTRAILS_VIEWS)
    trails.ts       get_trail, get_trail_reviews, get_trail_photos, get_trail_weather, get_trail_gpx
    explore.ts      search, resolve_location (suggestions → place records: kind/coords/slug)
    user.ts         get_profile, list_user_lists, get_list_items (GET /lists/{id}/items — sparse trailId refs), list_completed_trails, get_activity_feed (feed?: local|timeline|personal follows the actual feed; omitted → directory)
    healthcheck.ts  alltrails_healthcheck via registerBridgeHealthcheckTool (probes a real trail-detail path through the client)
tests/              mirrors src/; mocks AllTrailsClient.request via vi.spyOn; client tests inject a stub FetchproxyTransport; transport tests use the createServer seam

Read the full file on GitHub · 162 lines

Changes

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.

  1. 28d ago Changed · +3 tokens per session 58ec1ec4e09c
  2. 1mo ago Changed · +64 tokens per session 8fc5e50b997b
  3. 1mo ago Changed · +2 lines · -180 tokens per session f4cc30dc8aca
  4. 1mo ago Changed · +3 tokens per session 8f22104bbbdb
  5. 1mo ago Changed · +70 tokens per session 594f1a95424b
  6. 2mo ago Changed · +12 lines · +583 tokens per session aeb9dd41a632
  7. 2mo ago First seen · 148 lines · 4,606 tokens per session scan A e7c58a3a2300

Subscribe to this mod's changes

alltrails-mcp CLAUDE.md is an instructions file published in the GitHub repository chrischall/alltrails-mcp (0 stars, last pushed 3d ago), licensed MIT. It adds 5,149 tokens to every session, about $0.0206 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

alltrails-mcp CLAUDE.md compared with instructions from other repositories

alltrails-mcp CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
alltrails-mcp CLAUDE.mdchrischall/alltrails-mcpInstructions file03d agoMITA5,149Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,086GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file281k2d agoMITA4,335Codex, OpenCode