Guide for developers

Chronosfy MCP — Node.js

Install @modelcontextprotocol/sdk. Use API key with di right scope (crm:write for dis example), or use human JWT from POST /auth/login. Di same Authorization header works for HTTP and MCP.
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
const base = 'https://chronosfy.com/api';
const authorization = process.env.CHRONOSFY_AUTH; // e.g. 'ApiKey ...'; never hardcode secrets
const request_key = 'person:customer-42:v1'; // preserve across retries/restarts
const person = {"name":"Alice","email":"[email protected]","external_id":"customer-42","metadata":{"source":"integration"}};
const client = new Client({ name: 'integration', version: '1' });
await client.connect(new StreamableHTTPClientTransport(new URL(base + '/mcp'), {
  requestInit: { headers: { Authorization: authorization } },
}));
try {
  const result = await client.callTool({ name: 'create_person', arguments: { ...person, request_key } });
  if (result.isError) throw new Error(JSON.stringify(result.structuredContent ?? result.content));
  const replay = await fetch(base + '/crm/persons', { method: 'POST',
    headers: { Authorization: authorization, 'Content-Type': 'application/json', 'Idempotency-Key': request_key },
    body: JSON.stringify(person) });
  if (!replay.ok) throw new Error(await replay.text());
  // Both results identify the same person.
} finally {
  await client.close();
}
To see di tools, use tools/list or GET /mcp/tools. Both dey use di same names and schemas. Use create_checkout_session and get_checkout_session for one-time payment, recurring payment agreement or card storage on hosted or embedded checkout. See /docs/quickstart/checkout. create_person, create_action and create_recurrence fit take optional request_key (8–128 letters/digits/._:-). Each time di scheduled email wan go out, e dey use di email address wey dey for di record of di person or company wey you choose. `subject_type: "company"` · `subject_id` create_payment_link need am. Use di same key again only for di same logical request and payload. create_payment_link fit take save_payment_method and set_as_default. You need payments:setup and payments:links. Check payment_method_status separately from payment status. create_recurrence fit take first_run_at. Di earliest automatic start time wey dem save no change when you pause, resume or edit. See /docs/quickstart/renewals for di complete flow. execute_action and trigger_recurrence still need their own key wey get 8–200 characters. If tool fail, e go set isError=true. content[0].text get JSON, and structuredContent get error, message, status_code and optional fields/details. HTTP 200 for MCP no mean di operation succeed. Bad JSON-RPC, unknown tools and task requests wey di server no support na protocol errors. For PSP tools, na only di current human owner fit call get_payment_settings, list_payment_providers, get_payment_webhook_url and set_payment_settings. To save, get reauth_token from POST /auth/reauth with operation="PUT /settings/payment" and pass am to set_payment_settings with di same login JWT. Di proof last five minutes and you fit use am only once, even if saving fail. API keys and service tokens no fit manage PSP credentials. No put secrets for prompts, logs or shared chat history. Use trusted client to supply credentials. RSVP organizers use /mcp with rsvp:read or rsvp:write. Create an event with create_rsvp_event, open it with update_rsvp_event, then use add_rsvp_invitees and send_rsvp_invitations. Provide request_key on MCP sends or Idempotency-Key on REST sends. Reuse the same key and guest IDs on a network retry. The receipt lists each guest's dispatch state. A dispatching or unknown delivery needs reconciliation before explicitly sending a new batch. A guest can connect to POST /rsvp/guest/mcp using the invitation UUID as a bearer credential. open_rsvp_invitation, respond_to_rsvp_invitation and open_rsvp_pass return the guest's private URL. The person confirms or declines there. The organizer scans the pass with check_in_rsvp_qr. For email delivery, use get_email_stats and list_email_recipients with action_id, page and limit for the list. Platform operators connect to POST /admin/mcp using their named X-Platform-Admin-Token header. GET /admin/mcp/tools and GET /admin/openapi.json return only the operations granted to that operator. ## Default payment provider If you save login details, di default go stay as e be, even for di first provider. To choose di account for new payments, di tenant owner go pick one saved account and confirm di change. You fit name di provider for checkout before you choose default.
GET /api/settings/payment
Authorization: Bearer <owner_access_token>

POST /api/auth/reauth
Authorization: Bearer <owner_access_token>
Content-Type: application/json

{"password":"<password>","operation":"PUT /settings/payment/default"}

PUT /api/settings/payment/default
Authorization: Bearer <owner_access_token>
X-Reauth-Token: <reauth_token>
Content-Type: application/json

{"config_id":"<configurations[].config_id>"}
MCP: set_default_payment_provider({config_id, reauth_token})