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,189 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: Claude Code plugin machinery. Also seen: mentions Claude Code.

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,189 This file is loaded in full into every session.
When invoked 5,189 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.05189 $0.05189
Opus 5 $0.02594 $0.02594
Sonnet 5 $0.01038 $0.01038
Haiku 4.5 $0.00519 $0.00519

Measured 3d ago against content hash aeb9dd41a632, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 3d 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 · 160 lines

How it starts

The opening of the file, as written. The whole thing — 160 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, embedded x-at-key app key, header/UA defaults)
  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 header/UA/api-key/user-id/timeout/ws-port/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 + 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 · 160 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. 3d ago Changed · +12 lines · +583 tokens per session aeb9dd41a632
  2. 8d 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 today), licensed MIT. It adds 5,189 tokens to every session, about $0.0259 per session on Opus 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

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.

vercel/next.js · 7,296 tokens

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.

openai/codex · 5,153 tokens

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

microsoft/vscode · 6,785 tokens

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

microsoft/vscode · 5,001 tokens

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.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,737 tokens