mcp
POST /v1/mcp/connections
Create an MCP connection (Connect AI tool).
تصدیقهویت
یو API کی د بیئرر ټوکن (bearer token) په توګه ولیکئ. کی باید د mcp.manage اجازه ولري؛ له دې اجازې پرته کی د 404 پرځای د 403 په واسطه رد کیږي.
چیرته چې ستاسو د سازمان آی ډي ځي
دا پای ټکی د JSON په متن کې د یوې ساحې په توګه org_id اخلي.
ستاسو د سازمان آی ډي ستاسو په ډشبورډ کې د 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 کنسول ستاسو د اصلي سازمان ID او ستاسو خپله کیلي ډکوي، او غوښتنه د ژوندی API په وړاندې پرمخ وړي ترڅو تاسو وکولی شئ اصلي ځواب وګورئ. دا پای ټکی (endpoint) د 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