MCP Workspaces
Create and manage workspaces within your organization.
Each MCP Workspace includes one automatically prepared MCP endpoint, configured apps and account choices. Use separate MCP Workspaces for different environments, customers or tool surfaces. Existing API paths and workspace IDs stay the same.
List Workspaces
/api/v1/workspacesList all workspaces in your organization.
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Number of workspaces to return, default 50, max 100 |
offset | integer | No | Number of workspaces to skip for pagination |
includeSuspended | boolean | No | Include suspended workspaces. Defaults to false |
Response
{
"workspaces": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"orgId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production",
"slug": "production",
"mcpServer": {
"id": "660e8400-e29b-41d4-a716-446655440002",
"mode": "CODE",
"authMode": "oauth",
"endUserAccess": "restricted",
"allowWorkspaceMembers": true,
"mcpEndpoint": "https://platform.weavz.io/mcp/srv_660e8400-e29b-41d4-a716-446655440002"
},
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z"
}
],
"total": 1
}Example
curl https://platform.weavz.io/api/v1/workspaces \
-H "Authorization: Bearer wvz_your_api_key"Create Workspace
Creation is atomic: the MCP Workspace and its endpoint are created together. Only name is required; omit slug to generate a unique one. The response includes workspace.mcpServer with id, mode, authMode, endUserAccess, allowWorkspaceMembers and mcpEndpoint. New endpoints use Code Mode, OAuth and restricted access with organization member sign-in enabled.
client.mcpWorkspaces (TypeScript) and client.mcp_workspaces (Python) expose these operations; existing workspaces SDK names remain aliases. Use configureMcp / configure_mcp for explicit endpoint configuration.
/api/v1/workspacesCreate a new workspace.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Workspace name, max 100 chars |
slug | string | No | URL-friendly slug, unique within org, max 50 chars, matching /^[a-z0-9][a-z0-9-]*$/ |
Response (201)
{
"workspace": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"orgId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production",
"slug": "production",
"mcpServer": {
"id": "660e8400-e29b-41d4-a716-446655440002",
"mode": "TOOLS",
"authMode": "oauth",
"endUserAccess": "restricted",
"allowWorkspaceMembers": true,
"mcpEndpoint": "https://platform.weavz.io/mcp/srv_660e8400-e29b-41d4-a716-446655440002"
},
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z"
}
}Example
curl -X POST https://platform.weavz.io/api/v1/workspaces \
-H "Authorization: Bearer wvz_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name": "Production", "slug": "production"}'Errors
| Status | Code | Description |
|---|---|---|
400 | VALIDATION_ERROR | Invalid or missing name/slug |
409 | DUPLICATE | Workspace slug already exists |
Create Private MCP Access
/api/v1/workspaces/:id/access-tokensIssue a private MCP access token for one existing end user. Supply the MCP Workspace ID and your application's external user ID. No separate server creation, server ID or authentication change is required. The token uses the included endpoint's existing authentication mode and is bound to that workspace and end user.
Keep the API key on your backend. Give the returned MCP URL and access token only to that user's intended agent. Connected apps still use the user's own account or the team's explicitly shared account. The token does not grant customer REST API access.
| Field | Type | Required | Description |
|---|---|---|---|
endUserId | string | Yes | Existing external user ID in this workspace. Internal Weavz user UUIDs are not accepted. |
scopes | string[] | No | Defaults to the endpoint's supported scopes. Code Mode supports mcp:tools and mcp:code; Tool Mode supports mcp:tools. |
expiresIn | integer | No | Lifetime in seconds, from 300 to 7776000. Defaults to 2592000 (30 days). |
const access = await client.mcpWorkspaces.createAccessToken(workspace.id, {
endUserId: 'customer_123', expiresIn: 3600,
})access = client.mcp_workspaces.create_access_token(
workspace["id"], end_user_id="customer_123", expires_in=3600,
)The 201 response contains accessToken, mcpEndpoint and token metadata: ID, prefix, external endUserId, scopes, authMethod, tokenType, creation and expiry times. bearerToken is an alias of accessToken only when the endpoint uses bearer authentication. Send accessToken as Authorization: Bearer to mcpEndpoint regardless of authentication mode. The plaintext token is returned once; store it privately.
| Status | Code | Description |
|---|---|---|
400 | VALIDATION_ERROR / INVALID_MCP_SCOPES | Invalid token options or scopes. |
403 | SCOPE_DENIED | API key cannot access this workspace. Suspended workspaces or endpoints also deny issuance. |
404 | WORKSPACE_NOT_FOUND / END_USER_NOT_FOUND | Workspace or external end user does not exist in this organization and workspace. |
409 | MCP_OAUTH_DISABLED / MCP_BEARER_DISABLED | Authentication changed during issuance; retry against the current settings. |
Get Workspace
/api/v1/workspaces/:idRetrieve a specific workspace.
Path Parameters
| Field | Type | Description |
|---|---|---|
id | string (uuid) | Workspace ID |
Response
{
"workspace": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"orgId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production",
"slug": "production",
"mcpServer": {
"id": "660e8400-e29b-41d4-a716-446655440002",
"mode": "CODE",
"authMode": "oauth",
"endUserAccess": "restricted",
"allowWorkspaceMembers": true,
"mcpEndpoint": "https://platform.weavz.io/mcp/srv_660e8400-e29b-41d4-a716-446655440002"
},
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z"
}
}Example
curl https://platform.weavz.io/api/v1/workspaces/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer wvz_your_api_key"Errors
| Status | Code | Description |
|---|---|---|
404 | NOT_FOUND | Workspace not found |
Update Workspace
/api/v1/workspaces/:idUpdate a workspace name or slug.
Path Parameters
| Field | Type | Description |
|---|---|---|
id | string (uuid) | Workspace ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New workspace name |
slug | string | No | New workspace slug. Must be lowercase alphanumeric characters and hyphens, start with a letter or number, and be unique within the organization |
Provide at least one field.
Response
{
"workspace": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"orgId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production EU",
"slug": "production-eu",
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T11:00:00.000Z"
}
}Example
curl -X PATCH https://platform.weavz.io/api/v1/workspaces/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer wvz_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name": "Production EU", "slug": "production-eu"}'Errors
| Status | Code | Description |
|---|---|---|
400 | VALIDATION_ERROR | Invalid name or slug |
400 | NO_UPDATES | No fields provided |
403 | SCOPE_DENIED | API key does not have access to this workspace |
404 | NOT_FOUND | Workspace not found |
409 | DUPLICATE | Workspace slug already exists |
Delete Workspace
/api/v1/workspaces/:idDelete a workspace and all associated resources.
Path Parameters
| Field | Type | Description |
|---|---|---|
id | string (uuid) | Workspace ID |
Response
{
"deleted": true,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}Example
curl -X DELETE https://platform.weavz.io/api/v1/workspaces/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer wvz_your_api_key"Errors
| Status | Code | Description |
|---|---|---|
404 | NOT_FOUND | Workspace not found |