mcp
POST /v1/mcp/connections
Create an MCP connection (Connect AI tool).
احراز هویت
یک کلید 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.
بدنه درخواست
| نام | نوع | الزامی | چیست |
|---|---|---|---|
name | string | بله | — |
client | McpClient | خیر | The AI client a connection is for (informational). |
scopes | string[] | بله | 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,… |
sandbox | boolean | خیر | — |
org_id | Uuid | null | خیر | The org the connection belongs to. Defaults to the caller's sole managed org. |
spend_cap_minor | integer | null | خیر | Optional per-window paid-action budget (integer minor units). Null = no cap. |
spend_currency | CurrencyCode | خیر | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
spend_window_seconds | integer | خیر | — |
پاسخ
| نام | نوع | الزامی | چیست |
|---|---|---|---|
id | Uuid | بله | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
name | string | بله | — |
client | McpClient | بله | The AI client a connection is for (informational). |
prefix | string | بله | The token's public lookup prefix (not a secret). |
scopes | string[] | بله | The RBAC permission keys this connection's token may exercise. |
sandbox | boolean | بله | — |
spend_cap_minor | integer | null | خیر | Optional per-window budget (integer minor units, CLAUDE.md §2.8) for AI-triggered paid actions. Null = no cap. |
spend_currency | CurrencyCode | خیر | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
spend_window_seconds | integer | بله | The rolling window the spend cap applies over. |
last_used_at | string | null | خیر | — |
revoked_at | string | null | خیر | — |
created_at | string | بله | — |
token | string | بله | The full zmcp_… token, shown exactly once. |
endpoint | string | بله | The MCP protocol endpoint URL to configure in the AI client. |
config | object | بله | A paste-ready config for the connection's client, embedding the endpoint and token. The shape differs per client: Claude Code gets an http-typed server, Cursor a url +… |
config_file | object | بله | Where that client reads config — e.g. .mcp.json. null when it has no file. |
command | object | بله | A one-line alternative for a client with a command line (Claude Code), else null. It embeds the token, so treat it like the token. |
note | object | بله | Set when the client cannot use a bearer token at all. chatgpt_needs_oauth: ChatGPT connects by OAuth sign-in only, so this token cannot reach it. |
خطاهایی که این نقطه پایانی میتواند برگرداند
401 · 403 · 422 · 429