mcp

POST /v1/mcp/connections

Create an MCP connection (Connect AI tool).

همه نقاط پایانی mcp

احراز هویت

یک کلید API را به عنوان یک توکن حامل ارسال کنید. این کلید باید دارای مجوز mcp.manage باشد؛ کلیدی که فاقد آن باشد با خطای 403 رد می‌شود، نه 404.

جایی که شناسه سازمان شما قرار می‌گیرد

این نقطه پایانی org_id را به عنوان یک فیلد در بدنه JSON دریافت می‌کند.

شناسه سازمان شما در صفحه کلیدهای API در داشبوردتان، در کنار خود کلید قرار دارد. این شناسه در تمام درخواست‌هایی که ارسال می‌کنید یکسان است.

امتحان کنید

هر چیزی را که داخل براکت‌های زاویه‌دار قرار دارد با مقادیر خودتان جایگزین کنید، و نگهدارنده کلید را با کلیدی از داشبورد خود جایگزین نمایید.

curl -X POST https://api.zinndigital.com/v1/mcp/connections \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "name": <string>, "scopes": <string[]> }'

وارد شده‌اید؟ کنسول API در داشبورد شما شناسه سازمان واقعی و کلید خودتان را پر می‌کند و درخواست را روی API زنده اجرا می‌کند تا بتوانید پاسخ واقعی را ببینید. این نقطه پایانی را در کنسول API باز کنید

جزئیات

Mints a per-tool MCP connection and returns the full `zmcp_…` token **once** (only its hash is stored) plus a paste-ready client config snippet. The requested `scopes` must be permissions the caller already holds in the target org — an unheld scope is a `403` (a connection can never out-scope its creator), an unknown one a `422`. An optional spend cap bounds AI-triggered paid actions. Requires `mcp.manage`.

بدنه درخواست

نامنوعالزامیچیست
namestringبله
clientMcpClientخیرThe AI client a connection is for (informational).
scopesstring[]بلهRBAC permission keys to grant the token. Each must be a permission the caller holds in the target org (a connection can never out-scope its creator); an unheld scope is a `403`,…
sandboxbooleanخیر
org_idUuid | nullخیرThe org the connection belongs to. Defaults to the caller's sole managed org.
spend_cap_minorinteger | nullخیرOptional per-window paid-action budget (integer minor units). Null = no cap.
spend_currencyCurrencyCodeخیرISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8).
spend_window_secondsintegerخیر

پاسخ

نامنوعالزامیچیست
idUuidبلهUUIDv7 identifier — sortable by creation time (docs/02 §8).
namestringبله
clientMcpClientبلهThe AI client a connection is for (informational).
prefixstringبلهThe token's public lookup prefix (not a secret).
scopesstring[]بلهThe RBAC permission keys this connection's token may exercise.
sandboxbooleanبله
spend_cap_minorinteger | nullخیرOptional per-window budget (integer minor units, CLAUDE.md §2.8) for AI-triggered paid actions. Null = no cap.
spend_currencyCurrencyCodeخیرISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8).
spend_window_secondsintegerبلهThe rolling window the spend cap applies over.
last_used_atstring | nullخیر
revoked_atstring | nullخیر
created_atstringبله
tokenstringبلهThe full `zmcp_…` token, shown exactly once.
endpointstringبلهThe MCP protocol endpoint URL to configure in the AI client.
configobjectبلهA paste-ready MCP client config snippet embedding the endpoint + token.

خطاهایی که این نقطه پایانی می‌تواند برگرداند

401 · 403 · 422 · 429