डेवलपर दस्तावेज़

Chronosfy MCP — Node.js

@modelcontextprotocol/sdk संस्थापित करें. स्कोपेड इस्तेमाल करें API कुंजी (इस उदाहरण के लिए crm:write), या मानव JWT साथ प्राप्त किया गया POST /auth/login. उसी प्राधिकार शीर्षक पर काम करता है 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();
}
उपकरण/सूची के साथ उपकरण खोजें या 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, भुगतानों: सेटअप के साथ-साथ भुगतान: लिंक की आवश्यकता होती है। भुगतान स्थिति से अलग payment_method_status पढ़ें. create_recurrence accepts first_run_at; इसका निरंतर स्वचालित निचला दायरा ठहराव/पुनर्प्राप्ति और संपादन से बचता है. पूर्ण प्रवाह के लिए /docs/quickstart/renewals देखें. execute_action और trigger_recurrence अपने अलग आवश्यक बनाए रखें 8–200 अक्षर अनुबंध. औज़ार असफलता सेट isError=true; सामग्री [0].text में शामिल है JSON और structuredContent इसमें त्रुटि, संदेश, है status_code और वैकल्पिक क्षेत्र/विवरण HTTP 200 पर MCP परिवहन व्यापार सफलता नहीं है। विकृत JSON-RPC, अज्ञात उपकरण और असमर्थित कार्य अनुरोध प्रोटोकॉल त्रुटियाँ हैं। पीएसपी औज़ार: get_payment_settings, list_payment_providers, get_payment_webhook_url और set_payment_settings वर्तमान मानव मालिक की आवश्यकता है. बचाने के लिए, प्राप्त करें reauth_token से POST /auth/reauth के साथ ऑपरेशनPUT /settings/payment"और इसे पारित करें set_payment_settings उसी लॉगइन का उपयोग कर रहा है JWT. यह 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})