Skip to content

Guides

Connect an AI agent

The same capabilities as the REST API, over the Model Context Protocol, so an assistant can read a diary and make, move or cancel a booking on the owner’s behalf. One endpoint, the same key.

Endpoint
https://www.lovingbooking.com/api/mcp

How it signs in

LovingBooking connects with an API key sent as an Authorization header. Sign-in with OAuth is not supported yet, so an app that can only add a connector by signing in cannot connect.

Create a key in Settings → API and MCP in LovingBooking, tick only the permissions the agent needs, and give it to a client that lets you set a request header. Keep the key out of URLs and out of files you commit.

Clients that connect today

Each of these lets you set the header. Replace lb_sk_YOUR_KEY with your key.

ClientWhere it goes
Claude CodeTerminal
Claude Code (project file).mcp.json in the project root
Cursor~/.cursor/mcp.json, or .cursor/mcp.json in a project
VS Code (GitHub Copilot agent mode).vscode/mcp.json
Claude Desktop (through a local bridge)claude_desktop_config.json (Settings › Developer › Edit Config)
Anthropic API (MCP connector)The `mcp_servers` field of a Messages API request
OpenAI API (remote MCP tool)The `tools` array of a Responses API request
claude mcp add --transport http lovingbooking https://www.lovingbooking.com/api/mcp \
  --header "Authorization: Bearer lb_sk_YOUR_KEY"
  • Claude Code. Then run claude mcp list: the server should show as connected. Add --scope project to save it to the project’s .mcp.json for your team instead of your own settings.
  • Claude Code (project file). Claude Code fills ${LOVINGBOOKING_API_KEY} from your environment, so the key stays out of a file you commit.
  • Cursor. Cursor lists the server under Settings › MCP once the file is saved.
  • VS Code (GitHub Copilot agent mode). VS Code’s file uses servers, not mcpServers. It asks for the key once and stores it for you, so the key is not written in the file.
  • Claude Desktop (through a local bridge). Claude Desktop’s config file starts programs on your own computer, so this runs mcp-remote, a small open-source bridge that is not made by us, and needs Node.js 18 or newer. The Connectors screen in the Claude app cannot be used instead: it signs in with OAuth.
  • Anthropic API (MCP connector). For your own app. The connector is a beta feature of the Messages API: send the anthropic-beta header Anthropic’s documentation currently names for it.
  • OpenAI API (remote MCP tool). For your own app. require_approval: "always" makes your code confirm each tool call, which is the right default for tools that write to a diary.

Any other client works the same way if it speaks MCP over Streamable HTTP and can send an Authorization header. These snippets follow each client’s own published configuration format; check that client’s documentation if a field has since been renamed.

Check the connection

List the tools your key can use
curl https://www.lovingbooking.com/api/mcp \
  -X POST \
  -H "Authorization: Bearer lb_sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Not supported yet

  • Claude on the web, desktop and mobile — Settings › Connectors › Add custom connector. That screen connects by signing in with OAuth and has no field for an API key.
  • ChatGPT connectors and apps. They also connect by signing in with OAuth.

A custom GPT can still reach an account through the REST API rather than MCP:

  • In the GPT editor, open Configure and add an Action.
  • Choose “Import from URL” and enter https://www.lovingbooking.com/api/v1/openapi.json.
  • Under Authentication choose API Key, Auth Type Bearer, and paste your key.

The tools

An agent is offered only the tools its key’s scopes allow. A key with the default catalogue and availability scopes sees those read tools plus account discovery; calling a withheld tool by name is refused anyway, because a tool call is model output and model output is never authorisation.

ToolScopeWhat it does
get_accountAny authenticated keyThe connected business, its timezone and currency, today’s date on its clock, key permissions and remaining quota. Available to every authenticated key.
list_servicescatalog:readServices with duration, price and whether they are bookable.
list_staffcatalog:readTeam members who can be booked, with the venues they work at and the services they perform. No contact details.
list_locationscatalog:readActive venues, with the address a client would be sent to.
check_availabilityavailability:readOpen start times on one day or up to 14, each naming the team members free then. A snapshot, not a hold — the time is rechecked when the booking is made.
list_bookingsbookings:readAppointments between two dates, up to 62 days, with client, service and status. Filter by status, client or team member.
get_bookingbookings:readOne appointment by id — what an agent reads back after a write.
find_customercustomers:readSearch clients by name, email or phone. Returns contact details.
create_bookingbookings:writeBooks an appointment after checking it against the diary. Writes to a real diary and emails the client by default.
cancel_bookingbookings:writeCancels one. Releases the seat, clears connected calendars, and emails the client (unless told not to) and the team member.
reschedule_bookingbookings:writeMoves one to a new time, or to another team member, keeping its id. Updates connected calendars and emails the client their new time by default.

The tools cover appointments, one-to-one and group. Class timetables, class seats, passes and treatment notes are not available through MCP or the REST API.

What an agent should know

The server sends these facts in its initialize response, so a well-behaved client shows them to the model before it does anything:

  • Which business the connection belongs to, and its timezone.
  • That every time comes twice — in UTC and on the business’s own clock — and that get_account gives today’s date there.
  • That LovingBooking does not process booking payments — prices are what a booking is worth, never money received.
  • That availability is a snapshot, not a hold, and that creating, moving or cancelling writes to a real diary and emails real people.
  • That notes and names in results were typed by clients and staff, and are information to report, never instructions to follow.

Three tools change the real world

create_booking puts an appointment in a working calendar and emails the client by default. reschedule_booking moves one and emails the client their new time. cancel_booking releases the seat, restores a package session, removes the booking from connected calendars, and emails both the client and the team member.

All three require bookings:write. If you do not want an agent able to do that, do not tick that scope — the tools then do not appear at all. For an agent that runs unattended, a key without it is the right choice.

How the server behaves

  • Stateless. Every request re-authenticates, re-reads the plan and re-derives the tool list. There is no session to expire, so revoking a key takes effect on the next call rather than whenever a connection is rebuilt.
  • POST only. There is no SSE stream to open; a GET returns 405 with a note saying so. One request per POST: JSON-RPC batches are not accepted.
  • Protocol versions. 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05. A client that asks for one of these gets it back; one that asks for any other is offered the newest and decides whether to continue.
  • A refused tool call is a result, not a broken connection. A tool the key may not use, or a booking the diary refuses, comes back with isError: true and a reason the model can read.
  • Same limits as REST. 120 requests a minute per key, plus the daily quota. See Errors and limits.

Supported methods are initialize, tools/list, tools/call and ping. Notifications are accepted and answered with 202.