# FavCRM workspace MCP OAuth: agent quickstart

Connect a remote MCP client to one FavCRM workspace. The browser lets an owner or administrator select individual permissions; nothing is granted by default. Booking Lite only offers the permissions that apply to its booking and customer workflows.

## Copy-paste prompt for a compatible remote MCP client

> Connect to FavCRM at `https://api.favcrm.io/mcp/oauth` using Streamable HTTP and OAuth. Open browser sign-in so I can choose my workspace and permissions. Do not ask for credentials or tokens in chat. Once connected, call `get_workspace` to confirm the workspace and scopes. Use `find_tools` for the available operations and their schemas. Confirm a change with me before calling `request_action`; report a pending approval as pending.

## Connect

- **Server name:** `favcrm`
- **Transport:** Remote Streamable HTTP
- **Server URL and OAuth resource:** `https://api.favcrm.io/mcp/oauth`

Add the URL to the client's remote MCP settings. The [protected-resource metadata](https://api.favcrm.io/.well-known/oauth-protected-resource/mcp/oauth) points to the workspace issuer. Use Authorization Code with PKCE S256 and the exact resource above. Do not use an API key or portal access token.

The person authorizing must be an active owner or admin of the target company. Platform admin status alone is not enough. Select the company in the browser. Merchant permissions start unchecked; select at least one.

For general setup, omit `scope` if the client supports it. The browser offers permissions available to the client and workspace. A non-empty request sets an upper bound. Reconnect with fresh consent to change scopes; explicitly replacing one connection leaves sibling connections unchanged.

OAuth connections do not use API-key slots. Workspace tool-call limits still apply.

### omp example: read bookings

Merge this entry into your project's `.omp/mcp.json` without replacing other servers:

```json
{
  "mcpServers": {
    "favcrm": {
      "type": "http",
      "url": "https://api.favcrm.io/mcp/oauth"
    }
  }
}
```

In omp, run `/mcp reload` and `/mcp reauth favcrm`. In FavCRM, select `bookings:read` and no write scopes. For Claude and ChatGPT, consult the [host-specific setup notes](https://favcrm.io/docs/simply-booking-mcp.md); their hosted connector flows have not been verified end to end.

## Verify and use

1. Call `get_workspace` with `{}`. Verify the organization, company, role, and granted scopes. Stop on a mismatch before reading records.
2. Call `find_tools` with a query such as `{"query":"list_outlet_bookings_needing_confirmation"}`. Use the exact operation name and schema returned. Available operations depend on the grant, enabled modules, and user permissions.
3. If discovery says `via: execute_tool`, send the exact `toolName` and structured `arguments`. The tool executes one permitted read, not JavaScript, SQL, or a write. Fetch records live and return only the requested fields without changing their values.
4. If discovery says `via: request_action`, confirm the exact change with the user and call `request_action` using the discovered schema and a fresh opaque `idempotencyKey`. A pending approval has not executed. For a reconciling result, retry only the exact same request with the same key.

### Booking workflow

| What you want to do | Scopes to select |
| --- | --- |
| Read bookings, outlets, services and available slots | `bookings:read` |
| Find an existing customer | `contacts:read` |
| Create an individual customer | `contacts:write` |
| Create or reschedule a booking | `bookings:write` |
| Cancel an eligible unpaid booking | `bookings:cancel`, `bookings:read`, and `contacts:read` |
| Check recorded payment status and amounts | `bookings:read` and `booking_payments:read` |

Use `list_outlets` before selecting an available slot. Selected-outlet members cannot look up availability when schedules aren't outlet-scoped. Payment status comes from FavCRM's ledger, not a live provider check. Paid cancellation is a separate action and requires separate permission and the workspace's refund approval policy. Booking Lite uses the portal for paid cancellations.

For the outlet confirmation queue, use the exact outlet name or ID and `localDate` in `YYYY-MM-DD` in the merchant's timezone. `matchedCount: 0` is a valid successful response. If discovery or execution is denied, check the grant and the user's module, record, and outlet access; do not switch endpoints to bypass the denial.

### Cancel an unpaid booking

`bookings:cancel` is a separate opt-in permission. `bookings:write` does not grant it and is not needed to cancel. If the scope is missing, reconnect and select it with `bookings:read` and `contacts:read`. Older clients may need a new registration. Use the merchant portal if the booking has any payment, credit, or checkout activity.

1. Discover `preview_booking_cancellation` with `find_tools`. Call it through `execute_tool` with `arguments: { bookingId }`.
2. Show the merchant the customer, service, outlet, local date and time, and zero refund. Wait for explicit confirmation in the client. FavCRM requires the preview and the granted permissions; there is no separate approval screen.
3. Call `request_action` with `toolName: "cancel_booking"`, `arguments: { bookingId, previewToken }`, and a fresh `idempotencyKey`. Use the token returned by the preview, not a value supplied in chat. It expires after 15 minutes and applies only to the same booking and connection.
4. Check `get_booking_detail` for `cancelled`. The booking stays in history but leaves the pending confirmation queue. If the booking changed or the preview expired, check the current status before getting a new preview and asking for confirmation again.

## Switch or disconnect

Each grant is bound to one company. For a different company, use a separately authorized connection or run OAuth again and select that company. Switching the active company in the merchant portal does not retarget the grant. Revoke it in **Settings → Connected Apps**.

### Existing connections

The old `/mcp/oauth/view`, `/mcp/oauth/manage`, `/mcp/oauth/merchant` and `/mcp/oauth/crm` resources retain their previous policies during migration. Connect to the workspace URL with fresh consent; tokens cannot move across audiences.
