Register an MCP server
POST /v1/mcp-servers
| Property | Value |
|---|---|
| Operation | create_mcp_server |
| Group | MCP servers |
| Scope | mcp:write |
| Route class | control |
| Idempotency | Idempotency-Key accepted: a retry with the same key replays the first answer |
| Audit | Audited mcp.server.create (mutation) |
| Released in | 1.60.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Registers a third-party MCP server and creates its Connection (1.60.0), needs_reauth until an oauth Connection is authorized or a bearer token is entered, active for none. The endpoint is checked through the egress guard (validation_failed with egress_denied), and a name already taken is mcp_server_name_taken. The first listing follows as a task.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the mcp:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl -X POST "$VOCAL_API/v1/mcp-servers" \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "crm-hub",
"endpoint": "https://example.test/a",
"auth": "oauth"
}'const response = await fetch(`${process.env.VOCAL_API}/v1/mcp-servers`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "crm-hub",
"endpoint": "https://example.test/a",
"auth": "oauth"
}),
});
console.log(response.status, await response.text());import os
import uuid
import requests
response = requests.post(
f"{os.environ['VOCAL_API']}/v1/mcp-servers",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"name": "crm-hub",
"endpoint": "https://example.test/a",
"auth": "oauth",
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
idempotency-key | header | string | no | A client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response. |
Request body
Content type application/json, required: McpServerCreateRequest.
| Field | Type | Required | Description |
|---|---|---|---|
auth | McpServerAuth | yes | |
default_timeout_ms | integer | no | 5,000 when omitted (a target). |
endpoint | McpEndpoint | yes | |
name | McpServerName | yes |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
201 | application/json | McpServer | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
409 | application/json | ErrorEnvelope | idempotency_in_progress, idempotency_key_reused |
422 | application/json | ErrorEnvelope | validation_failed |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 201 answer
The shape is McpServer.
| Field | Type | Required | Description |
|---|---|---|---|
allowed_tools | array of UpstreamToolName | yes | The tools a Member with mcp:write approved; a tool not listed is never offered to any Agent. |
auth | McpServerAuth | yes | |
authorization_server | string or null | yes | The issuer the client discovered for oauth (RFC 9728, RFC 8414); null before discovery or for other auth. |
connection_id | ConnectionId | yes | The Connection the registration created for its credential. |
created_at | Timestamp | yes | |
default_timeout_ms | integer | yes | |
drift_count | integer | no | How many pinned tools the latest listing found changed or removed (1.61.0): above 0 exactly while status is drift_pending; absent from an api before 1.61.0. |
endpoint | McpEndpoint | yes | |
id | McpServerId | yes | |
last_listed_at | Timestamp or null | yes | |
name | McpServerName | yes | |
object | "mcp_server" | yes | |
organization_id | OrganizationId | yes | |
pins | array of McpToolPin | yes | |
protocol_version | string or null | yes | The negotiated MCP revision; null before the first listing. |
revision | integer | yes | |
status | McpServerStatus | yes | |
updated_at | Timestamp | yes |