Developers · Connect

Connect an AI agent to a gym

Every NinjaHQ gym has an AI connector: a Model Context Protocol (MCP) server with 318 tools. Any app that speaks MCP over HTTP can use it, after a person at the gym signs in and approves it. Nobody copies or pastes an API key.

Quick start: ChatGPT, Claude or another app

  1. Add a connector. Claude: Settings, Connectors, Add custom connector. ChatGPT: Plugins (on chatgpt.com/plugins), Add, Add MCP server, type Streamable HTTP. Name it NinjaHQ and use the address https://mcp.ninjahq.ai/mcp.
  2. Pick the gym. Type the gym's website or name.
  3. Sign in to the gym's back office with your own email and the code NinjaHQ sends you (or a passkey).
  4. Press Yes, connect. The page shows what the app will be able to do.
  5. Ask in plain words. "Add a Saturday open gym from 1 to 3." The app reads first, shows the change and asks before it saves.

Plans: OpenAI offers custom connectors on ChatGPT Business, Enterprise and Edu; on other plans they may be missing or read-only. Some Claude plans don't include custom connectors. Step by step: ChatGPT, Claude, a web developer's own agent.

The address

One address for every gym: https://mcp.ninjahq.ai/mcp. When an app connects, NinjaHQ asks which gym, then the person signs in to that gym's own back office. A gym's own address, https://yourgym.com/mcp, works too and skips the question.

WhatValue
TransportMCP Streamable HTTP, stateless: POST JSON-RPC 2.0, the answer is JSON (no event stream, no session). GET and DELETE answer 405.
Protocol versions2025-06-18, 2025-03-26, 2024-11-05
Sign-inOAuth 2.1: discovery documents, dynamic client registration, authorization code with PKCE (S256 only), rotating refresh tokens
KeysAccess token 1 hour, refresh token 90 days. Tied to one gym, one person and one app. Stored only as SHA-256 hashes.
Methodsinitialize, ping, tools/list, tools/call (resources/list and prompts/list answer empty lists)

Who can connect, and what they get

RoleWhat the app can do
OwnerEvery tool (318). Owners can switch the connector off and disconnect anyone's app.
ManagerThe same list; tools that are owners only answer that an owner has to do it.
Web developerOnly the 66 website tools: pages, design, site versions, photos, menus, logo, redirects, the website's words, email drafts, the Help Center and the website's analytics (counts only). No customers, payments, staff or settings. How to give a web developer access
Front desk staffCan't connect an app.

An owner adds a web developer under Staff with the role Web developer; they sign in with a code sent to their own email. How to give your web developer access.

The OAuth flow, for MCP client authors

RequestWhat it does
POST /mcp without a key401 with WWW-Authenticate pointing at the protected-resource document
GET /.well-known/oauth-protected-resource/mcpWhich authorization server protects /mcp (RFC 9728)
GET /.well-known/oauth-authorization-serverThe endpoints below (RFC 8414)
POST /oauth/registerDynamic client registration: the app's name and redirect addresses (https, or this computer for desktop apps; matched exactly)
GET /connect?client_id=…The consent step: which gym, sign in, Yes, connect (PKCE S256 required)
POST /oauth/tokenCode for an access token (1 hour) and a refresh token (90 days, a new one each time)

The calls

With a key, every call is one POST. List the tools:

curl https://mcp.ninjahq.ai/mcp \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Each tool comes with its name, title, description, JSON Schema and annotations (readOnlyHint, destructiveHint, openWorldHint). Call one:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "add_closure",
    "arguments": {
      "date": "2026-11-26",
      "reason": "Thanksgiving",
      "dry_run": true
    }
  }
}

The answer has the result as text and as structuredContent. A mistake the person can fix comes back as isError: true with a plain sentence, such as which option was wrong and what it accepts:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ …what would change… }"
      }
    ],
    "structuredContent": {
      "…": "…"
    },
    "isError": false
  }
}

Safety rules every call follows

  • One gym only. The key, the address and every database query belong to that gym.
  • Same checks as the back office. Writes go through the same validation as the back office forms. Unknown options, missing required ones and values outside a list are refused in plain words.
  • dry_run. 166 tools take dry_run: true to show what would change and save nothing.
  • confirm. Turning something off, removing, publishing and restoring take confirm: true (64 tools).
  • History. Every change is recorded under "<person's email> (via <app>)" and can be put back with restore_change or the History page.
  • Totals, not people. Reads give totals; they never return a customer's name or contact details.
  • Nothing that moves money or reaches people. No payments or refunds; emails are saved as drafts the owner sends; no code runs on the site.
  • Limits per gym: 120 changes and 1,500 questions an hour, 40 photos a day.

Discovery files on every live gym site

  • /.well-known/mcp/server-card.json: the MCP server card
  • /.well-known/api-catalog: the API catalog (RFC 9727)
  • /.well-known/ai-catalog.json and /.well-known/agent-skills/index.json: what an agent can do there
  • /auth.md: how an assistant connects, in plain Markdown
  • /llms.txt and /developers.md: the site and the developers' guide for AI assistants

These docs, machine-readable

Ask NinjaHQ

Answers from our Help Center and website

Ask anything about NinjaHQ, or try:

AI answers from NinjaHQ's own pages and can make mistakes. Your questions are sent to Anthropic, the AI company, to answer; NinjaHQ doesn't keep them. Privacy