Skip to content
Weavz
Menu

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

GET/api/v1/workspaces

List all workspaces in your organization.

Query Parameters

FieldTypeRequiredDescription
limitintegerNoNumber of workspaces to return, default 50, max 100
offsetintegerNoNumber of workspaces to skip for pagination
includeSuspendedbooleanNoInclude suspended workspaces. Defaults to false

Response

json
{
  "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

bash
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.

POST/api/v1/workspaces

Create a new workspace.

Request Body

FieldTypeRequiredDescription
namestringYesWorkspace name, max 100 chars
slugstringNoURL-friendly slug, unique within org, max 50 chars, matching /^[a-z0-9][a-z0-9-]*$/

Response (201)

json
{
  "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

bash
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

StatusCodeDescription
400VALIDATION_ERRORInvalid or missing name/slug
409DUPLICATEWorkspace slug already exists

Create Private MCP Access

POST/api/v1/workspaces/:id/access-tokens

Issue 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.

FieldTypeRequiredDescription
endUserIdstringYesExisting external user ID in this workspace. Internal Weavz user UUIDs are not accepted.
scopesstring[]NoDefaults to the endpoint's supported scopes. Code Mode supports mcp:tools and mcp:code; Tool Mode supports mcp:tools.
expiresInintegerNoLifetime in seconds, from 300 to 7776000. Defaults to 2592000 (30 days).
typescript
const access = await client.mcpWorkspaces.createAccessToken(workspace.id, {
  endUserId: 'customer_123', expiresIn: 3600,
})
python
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.

StatusCodeDescription
400VALIDATION_ERROR / INVALID_MCP_SCOPESInvalid token options or scopes.
403SCOPE_DENIEDAPI key cannot access this workspace. Suspended workspaces or endpoints also deny issuance.
404WORKSPACE_NOT_FOUND / END_USER_NOT_FOUNDWorkspace or external end user does not exist in this organization and workspace.
409MCP_OAUTH_DISABLED / MCP_BEARER_DISABLEDAuthentication changed during issuance; retry against the current settings.

Get Workspace

GET/api/v1/workspaces/:id

Retrieve a specific workspace.

Path Parameters

FieldTypeDescription
idstring (uuid)Workspace ID

Response

json
{
  "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

bash
curl https://platform.weavz.io/api/v1/workspaces/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer wvz_your_api_key"

Errors

StatusCodeDescription
404NOT_FOUNDWorkspace not found

Update Workspace

PATCH/api/v1/workspaces/:id

Update a workspace name or slug.

Path Parameters

FieldTypeDescription
idstring (uuid)Workspace ID

Request Body

FieldTypeRequiredDescription
namestringNoNew workspace name
slugstringNoNew 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

json
{
  "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

bash
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

StatusCodeDescription
400VALIDATION_ERRORInvalid name or slug
400NO_UPDATESNo fields provided
403SCOPE_DENIEDAPI key does not have access to this workspace
404NOT_FOUNDWorkspace not found
409DUPLICATEWorkspace slug already exists

Delete Workspace

DELETE/api/v1/workspaces/:id

Delete a workspace and all associated resources.

Path Parameters

FieldTypeDescription
idstring (uuid)Workspace ID

Response

json
{
  "deleted": true,
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

Example

bash
curl -X DELETE https://platform.weavz.io/api/v1/workspaces/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer wvz_your_api_key"

Errors

StatusCodeDescription
404NOT_FOUNDWorkspace not found