開発者向けドキュメント

Chronosfy MCP — Node.js

@modelcontextprotocol/sdk をインストールします。スコープを使う API 人間のキー(例えばcrm:write)や JWT これは POST /auth/login. 同じ Authorizationヘッダが動作します HTTP そして 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();
}
tools/list または GET /mcp/tools. 両方とも同じ名前とスキームを使用します。 ユース create_checkout_session そして get_checkout_session ホストや埋め込みのために one-off 支払い 繰り返し登録 カードの保管シー /docs/quickstart/checkout. create_person, create_action そして create_recurrence オプションを受け入れる request_key (8–128 letters/digits/._:-). 定期メールは、送信時に選択した個人または会社に登録されているメールアドレスに届きます。 `subject_type: "company"` · `subject_id` create_payment_linkが必要だ同じ論理的要求とペイロードに対してのみ鍵を再使用します。 create_payment_link 受け入れる save_payment_method そして set_as_default支払いリンクと同様に payments:setup を必要とします payment_method_status を支払い状態から別々に読みます。 create_recurrence は first_run_at を受け入れます。 自動的に下限値を維持し 停止・再開・編集を生き延びます完全なフローは /docs/quickstart/renewalsを参照してください。 execute_action そして trigger_recurrence 必要な分離を維持し 8–200 キャラクター契約 ツールの故障セット isError=true;コンテンツ[0テキストが含まれている JSON そして structuredContent エラーやメッセージ status_code オプションフィールド/詳細を入力してください HTTP 200 ここで MCP 輸送はビジネスの成功ではありません 不正なJSON-RPC、未知のツール、サポートされないタスク要求はプロトコルエラーです。 PSP ツール: get_payment_settings, list_payment_providers, get_payment_webhook_url そして set_payment_settings 人間の所有者が必要です保存するには、取得 reauth_token ここから POST /auth/reauth あなたと operation="PUT /settings/payment" と同じログイン JWTを使って set_payment_settings に渡す five-minute証明は失敗した保存を含めて一度消費される。API キー/サービストークンは PSP 認証情報を管理できません。 プロンプト、ログ、共有会話履歴に秘密を含めない。信頼できるクライアントを使って認証情報を提供する。 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. ## 既定の決済事業者 最初の事業者を登録する場合も、認証情報を保存するだけでは既定の設定は変わりません。テナントの所有者が登録済みのアカウントを選び、変更を確定すると、その後の決済で使用されます。既定値を選ぶ前でも、チェックアウト時に事業者を指定できます。
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})