mcp
POST /v1/mcp/connections
Create an MCP connection (Connect AI tool).
المصادقة
أرسل مفتاح واجهة برمجة التطبيقات (API key) كرمز حامل (bearer token). يجب أن يحمل المفتاح إذن 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
التفاصيل
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