Skip to main content
Glama

af-unofficial-mcp-server

An unofficial MCP server for Anytime Fitness. Ask your assistant how busy the gym is, when it will be quieter, which nearby clubs are less crowded, or how often you have visited.

It uses the same private API as version 4.5.0 of the Anytime Fitness app. The API may change without warning. This project is not affiliated with Anytime Fitness.

Tools

Tool

What it returns

occupancy

Live headcount, how it compares with the usual crowd, and a go-now verdict

forecast

Typical hourly attendance for a chosen day

nearby_clubs

Nearby clubs, distance, opening status, and live headcount

visits

Visit history and common visit times

auth_status

Login status without exposing tokens

Attendance comparisons use the club's 100-day hourly averages. The server finds the home club and its timezone from your account.

Related MCP server: Boostcamp MCP Server

Setup

You need Python 3.11 or later, uv, and an MCP-compatible client.

git clone https://github.com/Sajush00/af-unofficial-mcp-server.git
cd af-unofficial-mcp-server
uv sync
uv run af-gym login --phone +61400000000

The login command sends an SMS code to the phone number registered with your Anytime Fitness account and prompts you to enter it.

Claude Desktop

Add this to claude_desktop_config.json:

{
  "mcpServers": {
    "af-gym": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/af-unofficial-mcp-server", "af-mcp"]
    }
  }
}

Claude Code

claude mcp add af-gym -- uv run --directory /absolute/path/to/af-unofficial-mcp-server af-mcp

Hermes Agent

Add this to ~/.hermes/config.yaml:

mcp_servers:
  af-gym:
    command: uv
    args: ["run", "--directory", "/absolute/path/to/af-unofficial-mcp-server", "af-mcp"]

Then ask your assistant: "How busy is the gym right now?"

Authentication and privacy

uv run af-gym status
uv run af-gym logout

Tokens are stored in ~/.af_token.json. Pending login details use ~/.af_session.json. Both files are private to your user account, and the CLI and MCP tools never print their contents.

Set AF_CLUB_TZ to an IANA timezone such as Australia/Sydney if you need to override automatic timezone detection.

Development

make check

This runs Ruff, mypy, project-specific static checks, and the offline test suite. Implementation notes are in docs/adr.

License

MIT © 2026 Sajush Arukat

Available Tools

5 tools
auth_statusAuth StatusA

Report whether a saved Anytime Fitness session exists and still refreshes.

Returns only metadata; token values are never returned. When this or any other call reports no usable session, ask the user to run af-gym login --phone <number> in their terminal.

Inputs: no named parameters. Returns: object

forecastForecastA

Typical hourly busy pattern for a day (100-day rolling averages, club-local time).

Inputs: day, club. Returns: object

nearby_clubsNearby ClubsA

Clubs near the home gym, nearest first, each with distance and a live headcount.

Inputs: limit, radius_km. Returns: object

occupancyOccupancyB

Live headcount right now, a go-now verdict, and typical counts for the rest of today.

The verdict compares the live count to the typical count for this hour: go-now, good-time, normal, wait or skip (see verdictMessage). restOfDay lists the typical count for each remaining hour of today.

Inputs: club. Returns: object

visitsVisitsA

Gym check-ins in a date range, newest first, with totals and habits.

Defaults to the last 90 days. Prefer a range over pulling all history: "visits in August" is start "2026-08-01", end "2026-08-31" (count 1 when only the total matters). When the range reaches today it also reports days since the last visit and, when the window is wide enough, 7/30-day counts; it always reports the most common day and hour in the range. Dates are club-local and inclusive.

Inputs: end, count, start. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 5 tools

    Disambiguation4/5

    Occupancy and forecast both deal with busyness and could be confused, but their live-vs-typical distinction is clear from the descriptions. The remaining tools are each tied to a distinct concern: nearby alternatives, visit history, and auth status.

    Naming Consistency5/5

    All tool names are lowercase noun-style names, forming a consistent and predictable query-oriented pattern. Single-word names like occupancy and multi-word names like nearby_clubs both follow snake_case, so there is no convention mixing.

    Tool Count5/5

    Five tools is well-scoped for a gym assistant: live busyness, typical trends, nearby options, visit history, and session status. Each tool earns its place and none feels redundant or missing enough to enlarge the set.

    Completeness4/5

    The core member workflows are covered: deciding when to go, checking nearby alternatives, and reviewing past visits. Minor gaps exist around club details like hours or address and membership info, but the surface seems intentionally focused and auth is explicitly handled via CLI.

    Related MCP Connectors

    Related MCP Servers