# SnapCount Remote MCP Server

Connect an AI assistant to SnapCount with one address and OAuth browser approval. It reads counts and reports and can create counters and live links. It cannot change a count.

## Endpoint and transport

Server address: `https://api.snapcount.app/mcp`

- Transport: Streamable HTTP, stateless. Requests are `POST` with JSON responses. `GET` and `DELETE` answer `405`.
- The assistant acts as the signed-in user who approved it, with the same roles, organizations, and per-counter access as in the app.
- There is no public write API. The MCP server cannot change, reset, undo, or set a count, delete or archive counters, remove members, change roles, or touch billing.

Setup steps for each assistant:

- [Claude](https://snapcount.app/mcp/claude)
- [ChatGPT](https://snapcount.app/mcp/chatgpt)
- [Cursor](https://snapcount.app/mcp/cursor)
- [VS Code](https://snapcount.app/mcp/vscode)
- [Codex](https://snapcount.app/mcp/codex)
- [Antigravity](https://snapcount.app/mcp/antigravity)
- [Lovable](https://snapcount.app/mcp/lovable)
- [Replit](https://snapcount.app/mcp/replit)
- [Warp](https://snapcount.app/mcp/warp)
- [Zed](https://snapcount.app/mcp/zed)
- [OpenCode](https://snapcount.app/mcp/opencode)
- [Hermes](https://snapcount.app/mcp/hermes)
- [Grok](https://snapcount.app/mcp/grok)

## Plans

The connection is part of Pro and Enterprise, including the Event Pass and lifetime plans. It is not in the trial or the free plan.

- Any signed-in user can open the consent screen. Approving needs at least one organization on Pro and Enterprise. Otherwise the decision answers 403 with `PLAN_REQUIRED` and the request stays open, so the user can upgrade and approve it.
- Every tool refuses an organization that is not on Pro and Enterprise: the result has `isError: true`, the code `PLAN_REQUIRED`, and a `plans_url` to `https://snapcount.app/pricing`. `list_organizations` marks each organization with `assistant_access`.
- Within those plans each tool keeps the rule of the app screen it mirrors: busiest times, by person and timestamped events need Enterprise, and starting a live link needs an owner or admin.

## OAuth and discovery

OAuth 2.1 with browser approval. There is no API key. Clients register themselves with dynamic client registration (RFC 7591) or identify with a Client ID Metadata Document. PKCE with `S256` is required.

- Protected resource metadata (RFC 9728): `https://api.snapcount.app/.well-known/oauth-protected-resource/mcp`
- Authorization server metadata (RFC 8414): `https://api.snapcount.app/.well-known/oauth-authorization-server`
- Authorize: `https://api.snapcount.app/oauth/authorize`
- Token: `https://api.snapcount.app/oauth/token`
- Client registration: `https://api.snapcount.app/oauth/register`
- Revoke: `https://api.snapcount.app/oauth/revoke`

```bash
curl https://api.snapcount.app/.well-known/oauth-protected-resource/mcp
```

The authorize step sends the user to a consent screen on `https://snapcount.app/oauth/authorize`, which names the client and the host its redirect points at and lists what will be granted. Access tokens last 1 hour. Refresh tokens last 30 days and rotate on every use, and one used twice revokes the whole connection. A hosted client that registered with a secret and redirects only to https addresses keeps its refresh token instead, and each refresh extends it to 30 days. Tokens are stored hashed.

## Scopes

- `counters:read`: See your organizations, counters, live totals, reports and live links.
- `counters:write`: Create counters and start live counting links.

A client that asks for no scope gets both. The consent screen always lists what is granted.

## Tools

Six tools. The names are stable. They answer for organizations on Pro and Enterprise, and each keeps the plan and role rule of the screen it mirrors in the app.

- `list_organizations` (List organizations; `counters:read`; read-only): Your organizations, your role in each, the plan, and how many counters and groups each one has. Plan and role: Any member. It says which organizations are on Pro or Enterprise, the only ones the other tools answer for.
- `list_counters` (List counters and live totals; `counters:read`; read-only): Every counter you can see with its live count, goal and lock, grouped by store or worker, with each group's total. Plan and role: Any member of a Pro or Enterprise organization.
- `get_report` (Get a report; `counters:read`; read-only): A snapshot, the daily report (high, low, end of day, events, top counter per day), busiest times, counts by person, or each count with its time, for up to 90 days, in your time zone. Plan and role: Snapshot and daily: Pro or Enterprise. Busiest times, by person and timestamped events: Enterprise.
- `list_live_links` (List live links; `counters:read`; read-only): The live counting links that are running, their counters, the link, and how many devices are connected. Plan and role: Pro or Enterprise.
- `create_counters` (Create counters; `counters:write`; writes, not destructive, not idempotent): One new group with up to 50 named counters, one per store, door or worker, added up by default. Plan and role: Needs write access, on Pro or Enterprise.
- `start_live_link` (Start a live link; `counters:write`; writes, not destructive, idempotent, open world): Starts a live link for up to 30 counters, or hands back the one already running: a link and a QR code anyone can count on without an account. Plan and role: An owner or admin, on Pro or Enterprise.

Live links have the shape `https://snapcount.app/guest/SESSION_ID`. Anyone with the link or its QR code can count on it without an account.

## Prompts

- `daily_report` (optional: organization, date): Each store's or worker's count for the day, next to the same weekday a week earlier, with any unit that has no counts flagged. Ready to send up the chain.
- `weekly_review` (optional: organization, weeks): Totals per unit per week, the best and worst units, and the trend.
- `set_up_counting` (optional: what, units): Proposes counters, creates them once you agree, then starts a live link and hands back the link for the team.

## Errors

A tool that cannot do what was asked returns a result with `isError: true` and a message the assistant can act on: which plan or role is needed, which organization name did not match, or which limit was reached. An organization that is not on Pro and Enterprise gets `PLAN_REQUIRED`.

- 401: no valid access token (never approved, expired, or disconnected). The assistant signs in again.
- 403: on the consent decision only, `PLAN_REQUIRED`: the user has no organization on Pro and Enterprise.
- 405: a `GET` or `DELETE` on the MCP address.
- 429: over 300 tool calls in an hour. Wait for the seconds in `Retry-After`.

## Limits and records

- 300 tool calls an hour per user.
- Reports cover a date range of up to 90 days, in the user's time zone.
- `create_counters` makes one group with up to 50 counters. `start_live_link` takes up to 30 counters.
- Every tool call is recorded for 90 days: the tool, whether it worked, the client, the organization, and how long it took.

## Disconnect an assistant

Signed-in users see each connected assistant and its recent activity in Settings, Developers, AI assistants, and can disconnect any one. The next call from that assistant fails with 401. Clients can also revoke their own tokens at `https://api.snapcount.app/oauth/revoke`.

## Test with MCP Inspector

```bash
npx @modelcontextprotocol/inspector
```

1. Set the transport to Streamable HTTP and the URL to `https://api.snapcount.app/mcp`.
2. Connect. The Inspector runs the OAuth flow, and your browser opens the SnapCount consent screen.
3. List the tools and prompts, then call `list_organizations` to see what your account can reach.

Calls from the Inspector count toward the same hourly limit and are recorded like any other assistant's calls.
