Ethos Booker
MCP server for booking gym sessions at Imperial College Ethos. Runs on Cloudflare Workers.
Ask AI about Ethos Booker
Powered by Claude Β· Grounded in docs
I know everything about Ethos Booker. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
ethos-booker
MCP server for booking gym sessions at Imperial College's Ethos sports centre.
Runs on Cloudflare Workers. Single-user: deploy your own instance, store your Imperial credentials as Wrangler secrets, and connect from claude.ai (web/desktop/mobile), Claude Code, or any MCP client. New devices connect with one click β no login form, no re-typing credentials.
Tools
| Tool | What it does |
|---|---|
list_sessions | Show available sessions for a date, filterable by location |
book_session | Book a free session by date, time, and location |
cancel_booking | Cancel a booking by date and optional time |
my_bookings | List your upcoming bookings |
search_sessions | Search across a date range with time/activity filters |
Connect to your deployed instance
Once you've deployed (see below), the same URL works on every device β paste it once per client, click Connect, done.
Claude.ai (web / desktop / mobile)
- Settings β Connectors β Add custom connector
- Paste your worker URL (the one ending in
/mcp):https://ethos-booker.<your-subdomain>.workers.dev/mcp - Leave OAuth Client ID and Client Secret blank
- Click Connect β claude.ai opens a brief redirect (no form), grants access, done
- The connection lasts 30 days; renewal is silent
Claude Code
claude mcp add ethos-booker --transport http https://ethos-booker.<your-subdomain>.workers.dev/mcp
Cursor
Settings β Tools & MCP β Add β paste the URL.
Deploy your own instance
git clone https://github.com/advitrocks9/ethos-booker.git
cd ethos-booker
npm install
# create a KV namespace and put its id into wrangler.jsonc
npx wrangler kv namespace create OAUTH_KV
# store your Imperial credentials as encrypted secrets (one-time)
npx wrangler secret put ETHOS_EMAIL
npx wrangler secret put ETHOS_PASSWORD
npx wrangler deploy
Wrangler will print the worker URL β append /mcp and use it as your connector URL.
For local development, copy .dev.vars.example to .dev.vars and fill in real credentials. .dev.vars is gitignored.
How auth works
The server holds your Ethos credentials as Wrangler secrets and authenticates with Imperial on your behalf. The OAuth dance between claude.ai and the worker is preserved (so each client gets a proper refresh token), but /authorize auto-completes β no login page is ever shown.
Concretely, on first connect from a new device:
- claude.ai discovers OAuth endpoints from
/.well-known/oauth-protected-resource - Opens
/authorizein a popup - The worker verifies it can log into Ethos with the stored secrets, then immediately calls
completeAuthorizationand redirects back - claude.ai exchanges the code for an access token (24h) + refresh token (30d)
- Subsequent tool calls hit
/mcpwith the bearer token
The actual Ethos session (JWT + cookies) is cached in KV under ethos:session:v1 and refreshed lazily based on the JWT exp claim β independent of the OAuth token lifetime, so booking calls don't fail when the OAuth token rotates.
If a booking fails because Ethos returned HTML or a 401-style error, the cached session is invalidated and the worker re-authenticates once before giving up.
Constraints
- Max 2 bookings per day
- 6-day advance booking window (opens at midnight)
- Cancel freely before the session starts
- Multiple no-shows within 7 days = 7-day suspension
Stack
- TypeScript on Cloudflare Workers
@cloudflare/workers-oauth-providerfor OAuth 2.1 (auto-approve mode)@modelcontextprotocol/sdkfor the MCP protocol layer- Cloudflare KV for OAuth state and Ethos session cache
