PureGym Python client and MCP server for class discovery and booking management
Project description
PureGym MCP
puregym-mcp is a Python package and Model Context Protocol server for browsing PureGym centers in Denmark, discovering classes, checking your bookings, and managing bookings from MCP-compatible clients.
This is an independent third-party project and is not affiliated with, endorsed by, or sponsored by PureGym. PureGym is a registered trademark of Pure Gym Limited.
- Docs: puregym-mcp.jorgesintes.dev
- Public read-only endpoint:
https://puregym-mcp.jorgesintes.dev/mcp - PyPI: puregym-mcp
Capabilities
The server exposes a small set of tools for public class discovery and optional authenticated booking actions.
Class discovery
Available without PureGym credentials:
get_capabilitieslist_class_typeslist_centerssearch_classes
Booking management
Available when PUREGYM_USERNAME and PUREGYM_PASSWORD are configured:
list_my_bookingsbook_classcancel_bookingget_center_live_status- Real-time occupancy and capacity dataget_center_open_hours- Opening and staffed hours for a center
Modes
Anonymous modeexposes read-only tools and uses a 14-day search window.Authenticated modeunlocks booking tools and expands the default search window to 28 days.
Breaking Changes in v0.3.0
book_classandcancel_bookingMCP tools now return snake_case field names (participation_idinstead ofparticipationId)- This aligns the MCP output with the internal Python API for consistency
Quickstart
For most users, the easiest setup is local stdio usage from an MCP-compatible client:
{
"mcp": {
"puregym": {
"enabled": true,
"type": "local",
"command": ["uvx", "puregym-mcp"],
"environment": {
"PUREGYM_USERNAME": "your-username",
"PUREGYM_PASSWORD": "your-password"
}
}
}
}
The environment block is optional and only needed for authenticated features.
Remote Deployment
The server supports both streamable-http and sse for remote MCP clients.
Public read-only hosting:
- Hosted endpoint:
https://puregym-mcp.jorgesintes.dev/mcp - Prefer anonymous mode for public deployments.
Security note:
- Do not expose a publicly reachable deployment configured with your personal PureGym credentials.
- Keep authenticated deployments private unless you have proper access control in front of them.
Example commands:
puregym-mcp --transport streamable-http --host 0.0.0.0 --port 8000 --streamable-http-path /mcp
puregym-mcp --transport sse --host 0.0.0.0 --port 8000 --sse-path /sse --message-path /messages/
Python Library
The package also exposes a reusable client and service layer:
from puregym_mcp import PureGymClient, PureGymService
# Anonymous client
client = PureGymClient()
# Authenticated client with custom timeout
client = PureGymClient(
username="your-username",
password="your-password",
timeout=30.0 # seconds
)
service = PureGymService(client)
# Book and cancel return typed results
result = await service.book_class(booking_id, activity_id, payment_type)
print(result.participation_id) # snake_case field
cancel_result = await service.cancel_booking(participation_id)
print(cancel_result.status)
Docker
Build the image:
docker build -t puregym-mcp .
Run a public read-only server:
docker run --rm -p 8000:8000 puregym-mcp
Run a private authenticated server:
docker run --rm -p 8000:8000 \
-e PUREGYM_USERNAME=your-email \
-e PUREGYM_PASSWORD=your-password \
puregym-mcp
Override the default container transport or path when needed:
docker run --rm -p 8000:8000 puregym-mcp \
--transport sse \
--host 0.0.0.0 \
--port 8000 \
--sse-path /sse
Development
Clone the repo and install dev dependencies:
uv sync --dev
Run from source:
uv run puregym-mcp --transport stdio
Run checks:
uv run pytest
uv run python -m compileall puregym_mcp tests
uv build
Test the built package locally before publishing:
uvx --from dist/puregym_mcp-0.3.0-py3-none-any.whl puregym-mcp --transport stdio
Run real API integration tests (requires credentials):
PUREGYM_USERNAME=your-username PUREGYM_PASSWORD=your-password uv run pytest tests/real_api -m real_api
MCP Inspector
Launch the Inspector against this repo:
npx @modelcontextprotocol/inspector \
uv \
--directory /path/to/puregym-mcp \
run \
puregym-mcp --transport stdio
Launch it in authenticated mode:
npx @modelcontextprotocol/inspector \
-e PUREGYM_USERNAME=your-email \
-e PUREGYM_PASSWORD=your-password \
-- \
uv \
--directory /path/to/puregym-mcp \
run \
puregym-mcp --transport stdio
The Inspector UI opens at http://localhost:6274.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file puregym_mcp-0.3.1.tar.gz.
File metadata
- Download URL: puregym_mcp-0.3.1.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de73f850563b4fe974af1cd2aa1445602cc464d236604a854367bf247ba2d379
|
|
| MD5 |
95b2bf2d5b3a821192b8ee8710e60cea
|
|
| BLAKE2b-256 |
086a44c72fbf402607b8d25f8041d7e025132b3db035fbced454eed5bd44d0d1
|
Provenance
The following attestation bundles were made for puregym_mcp-0.3.1.tar.gz:
Publisher:
publish.yml on JorgeSintes/puregym-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
puregym_mcp-0.3.1.tar.gz -
Subject digest:
de73f850563b4fe974af1cd2aa1445602cc464d236604a854367bf247ba2d379 - Sigstore transparency entry: 1194167453
- Sigstore integration time:
-
Permalink:
JorgeSintes/puregym-mcp@9c7576821de7aeb61f59f846c67ed940b92140fc -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/JorgeSintes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9c7576821de7aeb61f59f846c67ed940b92140fc -
Trigger Event:
release
-
Statement type:
File details
Details for the file puregym_mcp-0.3.1-py3-none-any.whl.
File metadata
- Download URL: puregym_mcp-0.3.1-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
962b5141da4fb66523a4096a5b6f7e0b3f3a880a7deba8093a5fadea45c14662
|
|
| MD5 |
624a256d895dfd19117d540d32ed245b
|
|
| BLAKE2b-256 |
d7dd0cfc14ecfa9ef898b344f5390fda4e95c1939981608ec370156c6293c8ba
|
Provenance
The following attestation bundles were made for puregym_mcp-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on JorgeSintes/puregym-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
puregym_mcp-0.3.1-py3-none-any.whl -
Subject digest:
962b5141da4fb66523a4096a5b6f7e0b3f3a880a7deba8093a5fadea45c14662 - Sigstore transparency entry: 1194167466
- Sigstore integration time:
-
Permalink:
JorgeSintes/puregym-mcp@9c7576821de7aeb61f59f846c67ed940b92140fc -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/JorgeSintes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9c7576821de7aeb61f59f846c67ed940b92140fc -
Trigger Event:
release
-
Statement type: